← 返回命令列表

Linux command

cardano-node 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Run a Cardano node

cardano-node run --topology [path/to/topology.json] --database-path [path/to/db] --socket-path [path/to/node.socket] --config [path/to/config.json]

Run a node

cardano-node run --topology [topology.json] --database-path [db/] --socket-path [node.socket] --host-addr [127.0.0.1] --port [3001] --config [config.json]

Run a block-producing node

cardano-node run --topology [topology.json] --database-path [db/] --socket-path [node.socket] --config [config.json] --shelley-kes-key [kes.skey] --shelley-vrf-key [vrf.skey] --shelley-operational-certificate [node.cert]

Run as a relay node

cardano-node run --non-producing-node --topology [topology.json] --database-path [db/] --socket-path [node.socket] --config [config.json]

Validate the database

cardano-node run --validate-db --topology [topology.json] --database-path [db/] --socket-path [node.socket] --config [config.json]

说明

cardano-node is the core component of the Cardano blockchain network, implementing the Ouroboros consensus protocol. It maintains a local copy of the blockchain, validates transactions, and participates in the peer-to-peer network. The node can operate in two modes: as a relay node that forwards transactions and blocks, or as a block-producing node (stake pool) that creates new blocks when selected by the protocol. Block producers require KES keys, VRF keys, and an operational certificate. Communication with the node happens through a Unix domain socket specified by --socket-path. The cardano-cli tool and other applications use the CARDANO_NODE_SOCKET_PATH environment variable to locate this socket for queries and transaction submission.

参数

--topology _FILEPATH_
Path to the topology.json file describing network peers
--database-path _FILEPATH_
Directory where blockchain state is stored
--socket-path _FILEPATH_
Path to the Unix domain socket for IPC communication
--config _FILEPATH_
Path to the node configuration JSON file
--host-addr _IPV4_
IPv4 address to bind for incoming connections
--host-ipv6-addr _IPV6_
IPv6 address to bind for incoming connections
--port _PORT_
Port number for listening to peer connections
--shelley-kes-key _FILEPATH_
Path to the KES (Key Evolving Signature) signing key for block production
--shelley-vrf-key _FILEPATH_
Path to the VRF (Verifiable Random Function) signing key
--shelley-operational-certificate _FILEPATH_
Path to the operational certificate for stake pool
--non-producing-node
Start as a relay node even if credentials are specified
--validate-db
Validate all database files on startup
--shutdown-on-slot-synced _SLOT_
Shut down after syncing to the specified slot number
--shutdown-on-block-synced _BLOCK_
Shut down after syncing to the specified block number
--shutdown-ipc _FD_
Shut down when the inherited file descriptor reaches EOF
-h, --help
Display help information
--version
Display version information

FAQ

What is the cardano-node command used for?

cardano-node is the core component of the Cardano blockchain network, implementing the Ouroboros consensus protocol. It maintains a local copy of the blockchain, validates transactions, and participates in the peer-to-peer network. The node can operate in two modes: as a relay node that forwards transactions and blocks, or as a block-producing node (stake pool) that creates new blocks when selected by the protocol. Block producers require KES keys, VRF keys, and an operational certificate. Communication with the node happens through a Unix domain socket specified by --socket-path. The cardano-cli tool and other applications use the CARDANO_NODE_SOCKET_PATH environment variable to locate this socket for queries and transaction submission.

How do I run a basic cardano-node example?

Run `cardano-node run --topology [path/to/topology.json] --database-path [path/to/db] --socket-path [path/to/node.socket] --config [path/to/config.json]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --topology _FILEPATH_ do in cardano-node?

Path to the topology.json file describing network peers