Getting started without Docker
This tutorial guides you through the same setup as the docker-based one, but without using Docker containers and only using executables and scripts.
All steps of this tutorial are also available in a combined process-compose setup via nix run .#demo
Preparation
Make sure that you have cardano-node, cardano-cli, hydra-node, and hydra-tui executables in your scope. You can either
- use
nix develop .#demoor cabal buildandcabal execthem (do not forget the--before passing further arguments).
All further commands are written as if executed from the demo folder in the project repository:
cd demo
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.
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!
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 "$(command -v cardano-cli)" "$(command -v 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:
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.
- Alice
- Bob
- Carol
source .env && hydra-node \
--node-id 1 --listen 127.0.0.1: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 \
--deposit-period 10s --deposit-activation 10s \
--testnet-magic 42 \
--node-socket devnet/node.socket \
--persistence-dir devnet/persistence/alice
source .env && hydra-node \
--node-id 2 --listen 127.0.0.1:5002 --api-port 4002 --monitoring-port 6002 \
--peer 127.0.0.1:5001 \
--peer 127.0.0.1:5003 \
--hydra-signing-key bob.sk \
--hydra-verification-key alice.vk \
--hydra-verification-key carol.vk \
--hydra-scripts-tx-id $HYDRA_SCRIPTS_TX_ID \
--cardano-signing-key devnet/credentials/bob.sk \
--cardano-verification-key devnet/credentials/alice.vk \
--cardano-verification-key devnet/credentials/carol.vk \
--ledger-protocol-parameters devnet/protocol-parameters.json \
--deposit-period 10s --deposit-activation 10s \
--testnet-magic 42 \
--node-socket devnet/node.socket \
--persistence-dir devnet/persistence/bob
source .env && hydra-node \
--node-id 3 --listen 127.0.0.1:5003 --api-port 4003 --monitoring-port 6003 \
--peer 127.0.0.1:5001 \
--peer 127.0.0.1:5002 \
--hydra-signing-key carol.sk \
--hydra-verification-key alice.vk \
--hydra-verification-key bob.vk \
--hydra-scripts-tx-id $HYDRA_SCRIPTS_TX_ID \
--cardano-signing-key devnet/credentials/carol.sk \
--cardano-verification-key devnet/credentials/alice.vk \
--cardano-verification-key devnet/credentials/bob.vk \
--ledger-protocol-parameters devnet/protocol-parameters.json \
--deposit-period 10s --deposit-activation 10s \
--testnet-magic 42 \
--node-socket devnet/node.socket \
--persistence-dir devnet/persistence/carol
If things go well, the nodes should start logging once connected to the chain.
The short deposit timings above are for this local devnet. Use the default timings on public networks unless you have assessed the rollback and recovery requirements.
Run Hydra clients
Connect to the nodes using hydra-tui.
- Alice
- Bob
- Carol
hydra-tui \
--connect 127.0.0.1:4001 \
--funds-signing-key devnet/credentials/alice-funds.sk \
--fuel-key devnet/credentials/alice.vk \
--testnet-magic 42 \
--node-socket devnet/node.socket
hydra-tui \
--connect 127.0.0.1:4002 \
--funds-signing-key devnet/credentials/bob-funds.sk \
--fuel-key devnet/credentials/bob.vk \
--testnet-magic 42 \
--node-socket devnet/node.socket
hydra-tui \
--connect 127.0.0.1:4003 \
--funds-signing-key devnet/credentials/carol-funds.sk \
--fuel-key devnet/credentials/carol.vk \
--testnet-magic 42 \
--node-socket devnet/node.socket

