Skip to main content

Getting started without Docker

Running the demo without Docker containers, but with plain executables and scripts.

Preparation

Make sure that you have a cardano-node, hydra-node and hydra-tui executable in your scope. You can either

  • use nix develop .#demo or
  • cabal build and cabal exec them (do not forget the -- before passing further arguments).
Tip for tmux users

In the demo nix shell, there is a run-tmux script which starts a new tmux session with multiple windows and panes executing all the commands below!

All further commands are written as if executed from the demo folder in the project repository, so make sure to cd demo before continuing.

Tip for nix-direnv users

Allowing the demo/.envrc will ensure you have the nix shell environment available whenever you are in the demo/ directory. To use this, opt-in via direnv allow after cd demo.

Set up the devnet

First, let's prepare and start an ad-hoc, single cardano-node devnet using our configuration. Note that this will create a devnet directory in your current working directory:

./prepare-devnet.sh
cd devnet
cardano-node run \
--config cardano-node.json \
--topology topology.json \
--database-path db \
--socket-path node.socket \
--shelley-operational-certificate opcert.cert \
--shelley-kes-key kes.skey \
--shelley-vrf-key vrf.skey

From the demo folder you can use the seed-devnet.sh script by passing it the path/command to a cardano-cli and hydra-node executable to use, instead of having it using the Docker container. For example:

export CARDANO_NODE_SOCKET_PATH=devnet/node.socket
./seed-devnet.sh $(which cardano-cli) $(which hydra-node)

Note, should you want to use cabal, pass the invocation for example like this "cabal exec hydra-node --".

Start Hydra nodes

Then, in 3 different terminals, start 3 Hydra nodes from the demo/ directory:

Note

We are trying to force ipv4 addresses by using --peer 127.0.0.1. If you don't see any connected peers in the tui it probably means that your system is configured to use ipv6.

source .env && hydra-node \
--node-id 1 --port 5001 --api-port 4001 --monitoring-port 6001 \
--peer 127.0.0.1:5002 \
--peer 127.0.0.1:5003 \
--hydra-signing-key alice.sk \
--hydra-verification-key bob.vk \
--hydra-verification-key carol.vk \
--hydra-scripts-tx-id $HYDRA_SCRIPTS_TX_ID \
--cardano-signing-key devnet/credentials/alice.sk \
--cardano-verification-key devnet/credentials/bob.vk \
--cardano-verification-key devnet/credentials/carol.vk \
--ledger-protocol-parameters devnet/protocol-parameters.json \
--testnet-magic 42 \
--node-socket devnet/node.socket \
--persistence-dir devnet/persistence/alice

If things go well, the nodes should start logging once connected to the chain.

Run Hydra clients

Connect to the nodes using hydra-tui.

hydra-tui \
--connect 0.0.0.0:4001 \
--cardano-signing-key devnet/credentials/alice-funds.sk \
--testnet-magic 42 \
--node-socket devnet/node.socket