Start your node

Starting the node uses the command cardano-node run and a set of options.
You can get the complete list of available options with cardano-node run
--topology FILEPATH The path to a file describing the topology.
--database-path FILEPATH Directory where the state is stored.
--socket-path FILEPATH Path to a cardano-node socket
--host-addr HOST-NAME Optionally limit node to one ipv6 or ipv4 address
--port PORT The port number
--config NODE-CONFIGURATION Configuration file for the cardano-node
--validate-db Validate all on-disk database files
--shutdown-ipc FD Shut down the process when this inherited FD reaches EOF
--shutdown-on-slot-synced SLOT Shut down the process after ChainDB is synced up to the
specified slot
-h,--help Show this help text
To start the node, run the following command from inside the relay directory, note that we will create the db directory. this will contain the chain database.
cardano-node run \
--topology topology.json \
--database-path db \
--socket-path db/node.socket \
--host-addr \
--port 3001 \
--config config.json
Now, to interact with our node and with the blockchain, we need a new terminal or ssh session
Create the environment variable CARDANO_NODE_SOCKET_PATH
export CARDANO_NODE_SOCKET_PATH=~/relay/db/node.socket
Check whether the node is syncing by querying the current tip `--testnet-magic 2` identifies the Cardano Preview Testnet. When your node is in sync with the tip of the blockchain you will get "syncProgress": "100.00"
cardano-cli query tip --testnet-magic 2
"block": 43994,
"epoch": 13,
"era": "Babbage",
"hash": "095e0b9383d3595ebd11f963b10dcf12886f767a977e4bde7655a3a0e184202f",
"slot": 1123781,
"syncProgress": "82.32"
cardano-cli query tip --testnet-magic 2
"block": 55171,
"epoch": 15,
"era": "Babbage",
"hash": "3d4a8758a634e36905232fcebc15b379cb8f6a008fb401e77ba59870da8fe72c",
"slot": 1365925,
"syncProgress": "100.00"
If you have any questions and suggestions while taking the lessons please feel free to ask in the forum and we will respond as soon as possible.