Cardano Blockchain Developer cookbook
  • Contents
  • Blockchain Basics
    • Basics of addresses and types of addresses
    • Basics of Cryptography
    • Cardano Architecture - Different Components
    • Cardano Architecture (consensus networking etc)
  • Module 2: Handson tools
    • Cardano Node CLI
    • KOIOS
      • Using Koios with Python
    • Ogmios
    • Tangocrypto
Powered by GitBook
On this page
  1. Module 2: Handson tools

Cardano Node CLI

PreviousModule 2: Handson toolsNextKOIOS

Last updated 2 years ago

The first step in using cardano node is to install the node sw and start running. Please note that this is not needed if you plan to use demeter.run that was explained earlier

To install cardano node and cardano-cli get the latest version from IOHK github. Although you can compile the node yourself, its easier to use precompiled node in the beginning

For node version 1.34.4 here is the link

Once you install the node, copy it to /usr/local/bin. Cardano has two testnests named preview and preprod. It is preferable to use preview testnet

Download the topology files from here for preview testnet

The node can be started with following comands

#!/bin/bash
DIRECTORY=/home/cardanouser/cardano-my-node
PORT=6000
HOSTADDR=0.0.0.0
TOPOLOGY=${DIRECTORY}/topology.json
DB_PATH=${DIRECTORY}/db
SOCKET_PATH=${DIRECTORY}/db/socket
CONFIG=${DIRECTORY}/config.json
/usr/local/bin/cardano-node run +RTS -N --disable-delayed-os-memory-return -I0.3 -Iw600 -A16m -F1.5 -H2500M -qb -qg1 -c -S -RTS --topology ${TOPOLOGY} --database-path ${DB_PATH} --socket-path ${SOCKET_PATH} --host-addr ${HOSTADDR} --port ${PORT} --config ${CONFIG}

Testnet will take sometime to sync.

Cardano CLI

Once the node is synced, cardano coomandline can be used to interact. Following github gives details on commands that can be used

In this cardano-cli address , cardano-cli stake-address & cardano-cli transaction are important to write simple scripts to build and send transaction.

Playing with Cardano CLI using python

This is an example to send payments.

https://update-cardano-mainnet.iohk.io/cardano-node-releases/cardano-node-1.35.4-linux.tar.gz
Environments - The Cardano Operations Book
cardano-node/cardano-node-cli-reference.md at master · input-output-hk/cardano-nodeGitHub
GitHub - cardano-apexpool/paymentsGitHub
Logo
Logo
Logo