4

I am running a Cardano node using docker, on the testnet, and now I need to check if it works properly and accepts cardano-cli arguments like querying and what not.

Is there a convenient way to do it?

2
  • 1
    What happens when you enter cardano-cli into the terminal of the docker container running the Cardano node? Jun 21 at 18:31
  • Resolving it, as I reached success with connecting to the docker container and running the queries from there, and everything works fine.
    – Adam
    Jun 22 at 8:49
2

To run cardano-cli in the container:

docker exec -it -e CARDANO_NODE_SOCKET_PATH=/path/to/node.sock cardano-node cardano-cli

So to check the tip: docker exec -it -e CARDANO_NODE_SOCKET_PATH=/path/to/node.sock cardano-node cardano-cli query tip --mainnet

I put cardano-cli as an alias: alias cardano-cli='docker exec -it -e CARDANO_NODE_SOCKET_PATH=/path/to/node.sock cardano-node cardano-cli'. That way you can just invoke the cli as if the cardano-cli was in your PATH.

1

The correct way to do that was to docker exec into the container, and cardano-cli works just fine from there.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.