@@ -140,22 +140,62 @@ docker run --detach \
140
140
-e CARDANO_SHELLEY_KES_KEY=/opt/cardano/config/keys/kes.skey \
141
141
-e CARDANO_SHELLEY_OPERATIONAL_CERTIFICATE=/opt/cardano/config/keys/node.cert \
142
142
-e CARDANO_SHELLEY_VRF_KEY=/opt/cardano/config/keys/vrf.skey \
143
- -v /src /cardano/node-keys:/opt/cardano/config/keys \
143
+ -v /srv /cardano/node-keys:/opt/cardano/config/keys \
144
144
-v /srv/cardano/node-db:/data/db \
145
145
-v /srv/cardano/node-ipc:/ipc \
146
146
-p 3001:3001 \
147
147
-p 12798:12798 \
148
148
ghcr.io/blinklabs-io/cardano-node run
149
149
```
150
150
151
+ ##### Dynamic Block Forging
152
+
153
+ To start a block producer in non-producing mode initially (for dynamic block forging):
154
+
155
+ ``` bash
156
+ docker run --detach \
157
+ --name cardano-node \
158
+ --restart unless-stopped \
159
+ -e CARDANO_BLOCK_PRODUCER=true \
160
+ -e START_AS_NON_PRODUCING=true \
161
+ -e CARDANO_SHELLEY_KES_KEY=/opt/cardano/config/keys/kes.skey \
162
+ -e CARDANO_SHELLEY_OPERATIONAL_CERTIFICATE=/opt/cardano/config/keys/node.cert \
163
+ -e CARDANO_SHELLEY_VRF_KEY=/opt/cardano/config/keys/vrf.skey \
164
+ -v /srv/cardano/node-keys:/opt/cardano/config/keys \
165
+ -v /srv/cardano/node-db:/data/db \
166
+ -v /srv/cardano/node-ipc:/ipc \
167
+ -p 3001:3001 \
168
+ -p 12798:12798 \
169
+ ghcr.io/blinklabs-io/cardano-node run
170
+ ```
171
+
172
+ With dynamic block forging enabled, you can control block production without restarting the node:
173
+
174
+ - ** Enable block forging** : Ensure credential files are present and send SIGHUP
175
+ ``` bash
176
+ docker exec cardano-node pkill -SIGHUP cardano-node
177
+ ```
178
+
179
+ - ** Disable block forging** : Move/rename credential files and send SIGHUP
180
+ ``` bash
181
+ docker exec cardano-node mv /opt/cardano/config/keys/kes.skey /opt/cardano/config/keys/kes.skey.disabled
182
+ docker exec cardano-node pkill -SIGHUP cardano-node
183
+ ```
184
+
185
+ - ** Re-enable block forging** : Restore credential files and send SIGHUP
186
+ ``` bash
187
+ docker exec cardano-node mv /opt/cardano/config/keys/kes.skey.disabled /opt/cardano/config/keys/kes.skey
188
+ docker exec cardano-node pkill -SIGHUP cardano-node
189
+ ```
190
+
151
191
The above uses Docker's built in supervisor to restart a container which fails
152
192
for any reason. This will also cause the container to automatically restart
153
193
after a host reboot, so long as Docker is configured to start on boot. We
154
194
set variables to configure a block producer and pass the paths to the 3 keys
155
195
we need. Our node's persistent data and client communication socket are mapped
156
- to ` /src /cardano/node-db ` and ` /src /cardano/node-ipc ` on the host,
196
+ to ` /srv /cardano/node-db ` and ` /srv /cardano/node-ipc ` on the host,
157
197
respectively. This allows for running applications directly on the host which
158
- may need access to these. We also map ` /src /cardano/node-keys ` on the host to
198
+ may need access to these. We also map ` /srv /cardano/node-keys ` on the host to
159
199
a path within the container to support running as a block producer. Last, we
160
200
add mapping the host's port 12798 to the container 12798, which is the port for
161
201
exposing the node's metrics in Prometheus format, for monitoring.
@@ -224,7 +264,12 @@ and operational certificate.
224
264
` ${CARDANO_CONFIG_BASE}/keys/vrf.skey ` )
225
265
- ` CARDANO_SHELLEY_OPERATIONAL_CERTIFICATE `
226
266
- Stake pool identity certificate (default:
227
- ` ${CARDANO_CONFIG_BASE}/keys/node.cert `
267
+ ` ${CARDANO_CONFIG_BASE}/keys/node.cert ` )
268
+ - ` START_AS_NON_PRODUCING `
269
+ - Start block producer node in non-producing mode (default: ` false ` )
270
+ - When set to ` true ` , adds the ` --start-as-non-producing-node ` flag
271
+ - Only applies when ` CARDANO_BLOCK_PRODUCER=true `
272
+ - Enables dynamic block forging control via SIGHUP signals
228
273
229
274
#### Controlling Mithril snapshots
230
275
0 commit comments