0

I'm trying to replicate what Lars was demonstrating at the start of the week03 testnet setup video https://www.youtube.com/watch?v=ABtffZPoUqU&list=PLNEK_Ejlx3x2zxcfoVGARFExzOHwXFCCL&index=6 (time 0:49-1:05), but after picking the hydra binaries, he is magically in a nix-shell and able to do cardano-node --version.

My question is what steps were done after downloading the binaries in order to be able from run cardano-node from a nix-shell? I'm new to nix so not always sure what has to be done to get things working.

I've tried just running the nix-shell, which spent quite a while updating dependencies, but in the end cardano-node didn't exist - ie running cardano-node --version in shell did nothing, neither did 'which cardano-node'.

Can someone please provide specific steps to get cardano-node running in the nix-shell. Thanks

1
  • How are you running your node? Did you install the binaries? If so which one for which OS? Or are you using a docker image?
    – d_fajardo
    Feb 1, 2022 at 6:38

3 Answers 3

1

easiest way to get a testnet node running: nix run github:input-output-hk/cardano-node#testnet/node --no-write-lock-file

0

Once you have nix-shell and downloaded the repository, you run it: cabal build cardano-node cardano-cli (it takes about 30 minutes) and then: cardano-node run. You open the second console, restart nix-shell and can play with cardano-cli.

0

I think Lars skipped some steps because they are not necessarily relevant to Plutus. It's more general and will depend on your operating system. Assuming you're running Linux like Lars, follow the steps below. Note that you can be in a Nix shell for this, but you don't have to be. This is just downloading a binary and putting it on your PATH.

In the video, Lars cuts while on this page: https://hydra.iohk.io/build/9941098#tabs-constituents

From there, you should click on cardano-node-linux (job #9941151)

Click on cardano-node-1.33.0-linux.tar.gz binary distribution to download the tarball

Make a permanent directory in which to store the binaries

mkdir ~/cardano-node

Extract the tarball contents into the directory. Note that your downloaded tarball may be in a different directory depending on how your system is configured.

tar -xf ~/Downloads/cardano-node-1.33.0-linux.tar.gz -C ~/cardano-node

At this point, you can execute cardano-node

cd ~/cardano-node
cardano-node --version

But you probably want to be able to run it from anywhere, not just in that one directory.

To do that, make sure the ~/cardano-node directory is always part of your PATH when you log in by editing ~/.bashrc and adding the following line

export PATH="$HOME/cardano-node:$PATH"

While you're editing .bashrc, save yourself some time later by adding this environment variable, too. You'll need it later. Note: Change the path if your plutus-pioneer-program directory is somewhere else.

export CARDANO_NODE_SOCKET_PATH="$HOME/plutus-pioneer-program/code/week03/testnet/node.socket"

Finally, source .bashrc to make sure the PATH and that environment variable are set in your current session

source ~/.bashrc

At this point, you'll be at the same point Lars is in the video.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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