@@ -4,29 +4,110 @@ Builds a Cardano full node from source on Debian. This image attempts to keep
4
4
interface compatibility with ` inputoutput/cardano-node ` , but may diverge
5
5
slightly, particularly with any Nix-specific paths.
6
6
7
- ## Running a node
7
+ We found that the learning curve for using Nix is too high for many in the
8
+ community who need to run a full node for various reasons but don't want to
9
+ get too heavy into learning a new operating system just to extend a container
10
+ image. This image uses FHS paths and installs into ` /usr/local ` while taking
11
+ advantage of multi-stage image builds to reduce final image size over the
12
+ official Nix-based distribution.
8
13
9
- To run a Cardano full node on mainnet:
14
+ ## Running a Cardano Node
15
+
16
+ The container image has some differing behaviors depending on how it's
17
+ invoked. There is a ` NETWORK ` environment variable which can be used as a
18
+ short cut to starting nodes on a specific named Cardano network with a default
19
+ configuration.
20
+
21
+ ### Using run (Recommended for SPO)
22
+
23
+ Using the ` run ` argument to the image causes the entrypoint script to use the
24
+ fully configurable code path.
25
+
26
+ To run a Cardano full node on mainnet with minimal configuration and defaults:
10
27
11
28
``` bash
12
29
docker run --detach \
13
30
--name cardano-node \
14
31
-v node-data:/opt/cardano/data \
15
32
-v node-ipc:/opt/cardano/ipc \
16
33
-p 3001:3001 \
17
- ghcr.io/cloudstruct /cardano-node run
34
+ ghcr.io/blinklabs-io /cardano-node run
18
35
```
19
36
20
37
The above maps port 3001 on the host to 3001 on the container, suitable
21
- for use as a mainnet relay node.
38
+ for use as a mainnet relay node. We use docker volumes for our persistent data
39
+ storage and IPC (interprocess communication) so they live beyond the lifetime
40
+ of the container.
22
41
23
42
Node logs can be followed:
24
43
25
44
``` bash
26
45
docker logs -f cardano-node
27
46
```
28
47
29
- Running a node on a different network uses a slightly different syntax.
48
+ #### Configuration using environment variables
49
+
50
+ The power in using ` run ` is being able to configure the node's behavior to
51
+ provide the correct type of service.
52
+
53
+ This behavior can be changes via the following environment variables:
54
+
55
+ - ` CARDANO_CONFIG_BASE `
56
+ - A directory which contains configuration files (default:
57
+ ` /opt/cardano/config ` )
58
+ - This variable is used as the base for other configuration variable default
59
+ - ` CARDANO_BIND_ADDR `
60
+ - IP address to bind for listening (default: ` 0.0.0.0 ` )
61
+ - ` CARDANO_BLOCK_PRODUCER `
62
+ - Set to true for a block producing node (default: false)
63
+ - Requires key files and node certificates to be present to start
64
+ - ` CARDANO_CONFIG `
65
+ - Full path to the Cardano node configuration (default:
66
+ ` ${CARDANO_CONFIG_BASE}/mainnet-config.json ` )
67
+ - Use your own configuration file to modify the node behavior fully
68
+ - ` CARDANO_DATABASE_PATH `
69
+ - A directory which contains the ledger database files (default:
70
+ ` /opt/cardano/data ` )
71
+ - This is the location for persistent data storage for the ledger
72
+ - ` CARDANO_PORT `
73
+ - TCP port to bind for listening (default: ` 3001 ` )
74
+ - ` CARDANO_RTS_OPTS `
75
+ - Controls the Cardano node's Haskell runtime (default:
76
+ ` -N2 -A64m -I0 -qg -qb --disable-delayed-os-memory-return ` )
77
+ - This allows tuning the node for specific use cases or resource contraints
78
+ - ` CARDANO_SOCKET_PATH `
79
+ - UNIX socket path for listening (default: ` /opt/cardano/ipc/socket ` )
80
+ - This socket speaks Ouroboros NtC and is used by client software
81
+ - ` CARDANO_TOPOLOGY `
82
+ - Full path to the Cardano node topology (default:
83
+ ` ${CARDANO_CONFIG_BASE}/mainnet-topology.json ` )
84
+
85
+ #### Running a block producer
86
+
87
+ To run a block producing node, you should, at minimum, configure your topology
88
+ to recommended settings and have only your own relays listed. You will need to
89
+ set ` CARDANO_BLOCK_PRODUCER ` to ` true ` and provide the appropriate key files
90
+ and operational certificate.
91
+
92
+ - ` CARDANO_SHELLEY_KES_KEY `
93
+ - Stake pool hot key, authenticates (default:
94
+ ` ${CARDANO_CONFIG_BASE}/keys/kes.skey ` )
95
+ - ` CARDANO_SHELLEY_VRF_KEY `
96
+ - Stake pool signing key, verifies (default:
97
+ ` ${CARDANO_CONFIG_BASE}/keys/vrf.skey ` )
98
+ - ` CARDANO_SHELLEY_OPERATIONAL_CERTIFICATE `
99
+ - Stake pool identity certificate (default:
100
+ ` ${CARDANO_CONFIG_BASE}/keys/node.cert `
101
+
102
+ ### Using NETWORK (standalone)
103
+
104
+ Using the ` NETWORK ` environment variable causes the entrypoint script to use
105
+ the simplified path. The only configurable option in this path is the
106
+ ` NETWORK ` environment variable itself.
107
+
108
+ ** NOTE** The container paths for persist disks is different in this mode
109
+
110
+ This is in keeping with the IOHK image behavior.
30
111
31
112
To run a Cardano full node on preview:
32
113
@@ -37,7 +118,7 @@ docker run --detach \
37
118
-v node-ipc:/ipc \
38
119
-e NETWORK=preview \
39
120
-p 3001:3001 \
40
- ghcr.io/cloudstruct /cardano-node
121
+ ghcr.io/blinklabs-io /cardano-node
41
122
```
42
123
43
124
## Running the CLI
@@ -47,15 +128,15 @@ To run a Cardano CLI command, we use the `node-ipc` volume from our node.
47
128
``` bash
48
129
docker run --rm -ti \
49
130
-v node-ipc:/opt/cardano/ipc \
50
- ghcr.io/cloudstruct /cardano-node cli < command>
131
+ ghcr.io/blinklabs-io /cardano-node cli < command>
51
132
```
52
133
53
134
This can be added to a shell alias:
54
135
55
136
``` bash
56
137
alias cardano-cli=" docker run --rm -ti \
57
138
-v node-ipc:/opt/cardano/ipc \
58
- ghcr.io/cloudstruct /cardano-node cli"
139
+ ghcr.io/blinklabs-io /cardano-node cli"
59
140
```
60
141
61
142
Now, you can use cardano-cli commands as you would, normally.
0 commit comments