1- # Cardano Node Configuration
21
3- This repository contains the code to setup and configure cardano and hydra nodes for different networks.
2+
3+ ## Installation
4+
5+ ** ⚠️ Warning:** Only ** x86/64 Linux** platform is supported.
6+
7+
8+
9+ ``` bash
10+ pip install adaup
11+ ```
12+
13+ #### SystemWide Installation
14+ ```
15+ sudo pip install --upgrade adaup --break-system-packages
16+ ```
17+ After installation, the ` cardano ` executable will be available in your PATH.
18+
19+ ## Usage
20+
21+ The ` cardano ` executable provides a command-line interface to manage Cardano and Hydra nodes.
22+
23+ ### Running a Cardano Node
24+
25+ To start a Cardano node for a specific network (e.g., ` preview ` or ` preprod ` or ` mainnet ` ), use the ` node ` command:
26+
27+ ``` bash
28+ cardano node preview
29+ ```
30+
31+ You can also specify a different network or node version:
32+
33+ ``` bash
34+ cardano node mainnet
35+ ```
36+
37+ ### Running Cardano CLI Commands
38+
39+ To execute ` cardano-cli ` commands, use the ` cli ` subcommand followed by the ` cardano-cli ` arguments:
40+
41+ ``` bash
42+ export CARDANO_NODE_SOCKET_PATH=~ /.cardano/preview/node.socket
43+ cardano cli query tip --testnet-magic 2
44+ cardano cli query tip --testnet-magic=2 --socket-path=~ /.cardano/preview/node.socket # # socket path in the cli
45+ ```
46+
47+ ### Running a Hydra Cluster
48+
49+ To set up and run a Hydra cluster:
50+
51+ 1 . ** Bootstrap Hydra Node Credentials:**
52+ Generate the necessary folders and credentials for your Hydra nodes. This will create ` hydra-{n} ` directories under ` $HOME/.cardano/<network_name>/ ` .
53+
54+ ** e.g.** this will generate configuration for running 2 hydra nodes.
55+ ``` bash
56+ cardano hydra bootstrap preview 2
57+ ```
58+
59+ 2. ** Start 1st Hydra Node:**
60+
61+
62+ ` ` ` bash
63+ cardano hydra node preview 0
64+ ` ` `
65+ 2. ** Start 2nd Hydra Node in different terminal:**
66+
67+
68+ ` ` ` bash
69+ cardano hydra node preview 1
70+ ` ` `
71+ ** Note** the command to run this node is available at ` ~/.cardano/preview/hydra-0/run.sh`
72+
73+ 3. ** Watch hydra status in Hydra TUI :**
74+ To interact with a running Hydra node, you can open the Text User Interface (TUI):
75+
76+ ` ` ` bash
77+ cardano hydra tui 0
78+ ` ` `
79+
80+ 4. ** Reset Hydra Head Data :**
81+ Shutdown you nodes, and use ` reset` command to restart a new hydra head with same configurations. You can then start the nodes again.
82+
83+ ` ` ` bash
84+ cardano hydra reset preview
85+ ` ` `
86+
87+ 5. ** Prune Hydra Cluster :**
88+ To remove all keys, data and cluster information. You need to ` bootstrap` the cluster again.
89+
90+ ` ` ` bash
91+ cardano hydra prune preview
92+ ` ` `
493
594# # Generated Directory Structure
695
@@ -16,8 +105,8 @@ $HOME/
16105 │ │── db
17106 │ │── hydra-{index}
18107 │ └── ...
19- ├── preview
108+ ├── preview (same as mainnet)
20109 │ └── ...
21- ├── preprod
110+ ├── preprod (same as mainnet)
22111 │ └── ...
23112```
0 commit comments