Skip to content

Commit 2d3b463

Browse files
authored
Merge pull request #1640 from input-output-hk/damien/unused-network-param-in-client-cli
Remove unused network configuration parameter in mithril-client cli
2 parents 09eb684 + e9e2c6e commit 2d3b463

File tree

6 files changed

+124
-126
lines changed

6 files changed

+124
-126
lines changed

docs/website/root/manual/developer-docs/nodes/mithril-client.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ Run in release mode with a specific mode:
168168
Run in release mode with a custom configuration using environment variables:
169169

170170
```bash
171-
GENESIS_VERIFICATION_KEY=$(wget -q -O - **YOUR_GENESIS_VERIFICATION_KEY**) NETWORK=**YOUR_CARDANO_NETWORK** AGGREGATOR_ENDPOINT=**YOUR_AGGREGATOR_ENDPOINT** ./mithril-client
171+
GENESIS_VERIFICATION_KEY=$(wget -q -O - **YOUR_GENESIS_VERIFICATION_KEY**) AGGREGATOR_ENDPOINT=**YOUR_AGGREGATOR_ENDPOINT** ./mithril-client
172172
```
173173

174174
:::tip
@@ -207,7 +207,6 @@ To prepare the environment variables, retrieve the values from the above **Mithr
207207

208208
```bash
209209
export MITHRIL_IMAGE_ID=**YOUR_MITHRIL_IMAGE_ID**
210-
export NETWORK=**YOUR_CARDANO_NETWORK**
211210
export AGGREGATOR_ENDPOINT=**YOUR_AGGREGATOR_ENDPOINT**
212211
export GENESIS_VERIFICATION_KEY=$(wget -q -O - **YOUR_GENESIS_VERIFICATION_KEY**)
213212
export SNAPSHOT_DIGEST=latest
@@ -217,7 +216,6 @@ Here is an example configuration for the `release-preprod` network and the `late
217216

218217
```bash
219218
export MITHRIL_IMAGE_ID=latest
220-
export NETWORK=preprod
221219
export AGGREGATOR_ENDPOINT=https://aggregator.release-preprod.api.mithril.network/aggregator
222220
export GENESIS_VERIFICATION_KEY=$(wget -q -O - https://raw.githubusercontent.com/input-output-hk/mithril/main/mithril-infra/configuration/release-preprod/genesis.vkey)
223221
export SNAPSHOT_DIGEST=latest
@@ -227,7 +225,7 @@ Proceed by creating a shell function for the Mithril client:
227225

228226
```bash
229227
mithril_client () {
230-
docker run --rm -e NETWORK=$NETWORK -e GENESIS_VERIFICATION_KEY=$GENESIS_VERIFICATION_KEY -e AGGREGATOR_ENDPOINT=$AGGREGATOR_ENDPOINT --name='mithril-client' -v $(pwd):/app/data -u $(id -u) ghcr.io/input-output-hk/mithril-client:$MITHRIL_IMAGE_ID $@
228+
docker run --rm -e GENESIS_VERIFICATION_KEY=$GENESIS_VERIFICATION_KEY -e AGGREGATOR_ENDPOINT=$AGGREGATOR_ENDPOINT --name='mithril-client' -v $(pwd):/app/data -u $(id -u) ghcr.io/input-output-hk/mithril-client:$MITHRIL_IMAGE_ID $@
231229
}
232230
```
233231

@@ -336,7 +334,6 @@ Here is a list of the available parameters:
336334
| `verbose` | `--verbose` | `-v` | `VERBOSE` | Verbosity level | - | Parsed from the number of occurrences: `-v` for `Warning`, `-vv` for `Info`, `-vvv` for `Debug` and `-vvvv` for `Trace` | :heavy_check_mark: |
337335
| `unstable` | `--unstable` | - | - | Enable unstable commands | - | - | - |
338336
| `run_mode` | `--run-mode` | - | `RUN_MODE` | Runtime mode | `dev` | - | :heavy_check_mark: |
339-
| `network` | - | - | `NETWORK` | Cardano network | - | `testnet` or `mainnet` or `devnet` | :heavy_check_mark: |
340337
| `aggregator_endpoint` | `--aggregator-endpoint` | - | `AGGREGATOR_ENDPOINT` | Aggregator node endpoint | - | `https://aggregator.pre-release-preview.api.mithril.network/aggregator` | :heavy_check_mark: |
341338
| `genesis_verification_key` | - | - | `GENESIS_VERIFICATION_KEY` | Genesis verification key | - | - | :heavy_check_mark: |
342339
| `log_format_json` | `--log-format-json` | - | - | Enable JSON output for logs | - | - | - |

docs/website/root/manual/getting-started/bootstrap-cardano-node.md

Lines changed: 66 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ To check if the version of the Mithril signer binary is correct, use the followi
9999
You should see something like:
100100

101101
```bash
102-
mithril-client 0.2.0
102+
mithril-client 0.7.6
103103
```
104104

105105
:warning: Verify that the version displayed corresponds to the version specified in the content of the Release/Pre-release notes (refer to the **Build from** column in the 'Mithril networks' table above).
@@ -120,8 +120,10 @@ This program shows, downloads and verifies certified blockchain artifacts.
120120
Usage: mithril-client [OPTIONS] <COMMAND>
121121

122122
Commands:
123-
snapshot Snapshot commands
123+
snapshot Deprecated, use `cardano-db` instead
124+
cardano-db Cardano db management (alias: cdb)
124125
mithril-stake-distribution Mithril Stake Distribution management (alias: msd)
126+
cardano-transaction [unstable] Cardano transactions management (alias: ctx)
125127
help Print this message or the help of the given subcommand(s)
126128

127129
Options:
@@ -132,21 +134,25 @@ Options:
132134
--config-directory <CONFIG_DIRECTORY>
133135
Directory where configuration file is located [default: ./config]
134136
--aggregator-endpoint <AGGREGATOR_ENDPOINT>
135-
Override configuration aggregator endpoint URL
137+
Override configuration Aggregator endpoint URL [env: AGGREGATOR_ENDPOINT=]
138+
--log-format-json
139+
Enable JSON output for logs displayed according to verbosity level
140+
--log-output <LOG_OUTPUT>
141+
Redirect the logs to a file
142+
--unstable
143+
Enable unstable commands (such as Cardano Transactions)
136144
-h, --help
137145
Print help
138146
-V, --version
139147
Print version
140-
141-
142148
```
143149

144150
:::tip
145151

146152
To display results in JSON format for the `list` and `show` commands of the Mithril client, you can use the `--json` option:
147153

148154
```bash
149-
./mithril-client snapshot list --json
155+
./mithril-client cardano-db snapshot list --json
150156
```
151157

152158
:::
@@ -186,7 +192,7 @@ Then, create a shell function for the Mithril client:
186192

187193
```bash
188194
mithril_client () {
189-
docker run --rm -e NETWORK=$NETWORK -e GENESIS_VERIFICATION_KEY=$GENESIS_VERIFICATION_KEY -e AGGREGATOR_ENDPOINT=$AGGREGATOR_ENDPOINT --name='mithril-client' -v $(pwd):/app/data -u $(id -u) ghcr.io/input-output-hk/mithril-client:$MITHRIL_IMAGE_ID $@
195+
docker run --rm -e GENESIS_VERIFICATION_KEY=$GENESIS_VERIFICATION_KEY -e AGGREGATOR_ENDPOINT=$AGGREGATOR_ENDPOINT --name='mithril-client' -v $(pwd):/app/data -u $(id -u) ghcr.io/input-output-hk/mithril-client:$MITHRIL_IMAGE_ID $@
190196
}
191197
```
192198

@@ -197,7 +203,7 @@ You can now use the `mithril_client` function:
197203
mithril_client help
198204

199205
# 2- List snapshots
200-
mithril_client snapshot list
206+
mithril_client cardano-db snapshot list
201207
```
202208

203209
:::tip
@@ -206,48 +212,45 @@ In the following part of the document, you will need to replace the `./mithril-c
206212

207213
:::
208214

209-
## Bootstrap a Cardano node from a testnet Mithril snapshot
215+
## Bootstrap a Cardano node from a testnet Mithril Cardano DB snapshot
210216

211217
### Step 1: Prepare some useful variables
212218

213219
```bash
214-
# Cardano network
215-
export NETWORK=**YOUR_CARDANO_NETWORK**
216-
217220
# Aggregator API endpoint URL
218221
export AGGREGATOR_ENDPOINT=**YOUR_AGGREGATOR_ENDPOINT**
219222

220223
# Genesis verification key
221224
export GENESIS_VERIFICATION_KEY=$(wget -q -O - **YOUR_GENESIS_VERIFICATION_KEY**)
222225

223-
# Digest of the latest produced snapshot for convenience of the demo
226+
# Digest of the latest produced cardano db snapshot for convenience of the demo
224227
# You can also modify this variable and set it to the value of the digest of a snapshot that you can retrieve at step 2
225228
export SNAPSHOT_DIGEST=latest
226229
```
227230

228-
### Step 2: Select a snapshot
231+
### Step 2: Select a Cardano DB snapshot
229232

230-
List the available snapshots with which you can bootstrap a Cardano node:
233+
List the available cardano db snapshots with which you can bootstrap a Cardano node:
231234

232235
```bash
233-
./mithril-client snapshot list
236+
./mithril-client cardano-db snapshot list
234237
```
235238

236239
You will see a list of snapshots:
237240

238241
```bash
239-
+-------+-----------+------------------------------------------------------------------+------------+-----------+--------------------------------+
240-
| Epoch | Immutable | Digest | Size | Locations | Created |
241-
+-------+-----------+------------------------------------------------------------------+------------+-----------+--------------------------------+
242-
| 72 | 1379 | a305aa11b0e2ccf737d4f5def8b0a9f2245eded2b4ec4be876f7bd64deddcbbf | 1259745182 | 1 | 2023-05-31T14:02:40.150189810Z |
243-
+-------+-----------+------------------------------------------------------------------+------------+-----------+--------------------------------+
244-
| 72 | 1378 | 5c2214b0b3a00cccacc96b65f9741d4e818df0bc092bee30986e4d554396c6fd | 1258142105 | 1 | 2023-05-31T07:48:08.357263836Z |
245-
+-------+-----------+------------------------------------------------------------------+------------+-----------+--------------------------------+
246-
| 72 | 1377 | 7cea14e5742387ca770a74f3e3cfdd93fc38573e2babbf05df292888a528ab15 | 1256695921 | 1 | 2023-05-31T01:56:38.178640636Z |
247-
+-------+-----------+------------------------------------------------------------------+------------+-----------+--------------------------------+
248-
| 72 | 1376 | 4cb153b55f6cadf47bc48cc3112c16a037ee49416820190dc9e121d4aa49369f | 1255258102 | 1 | 2023-05-30T20:11:54.620669432Z |
249-
+-------+-----------+------------------------------------------------------------------+------------+-----------+--------------------------------+
250-
| | | | | | |
242+
+-------+-----------+---------+------------------------------------------------------------------+------------+-----------+-----------------------------------+
243+
| Epoch | Immutable | Network | Digest | Size | Locations | Created |
244+
+-------+-----------+---------+------------------------------------------------------------------+------------+-----------+-----------------------------------+
245+
| 539 | 10787 | preview | db5f50a060d4b813125c4263b700ecc96e5d8c8710f0430e5c80d2f0fa79b667 | 2323485648 | 1 | 2024-04-16 12:56:22.170174972 UTC |
246+
+-------+-----------+---------+------------------------------------------------------------------+------------+-----------+-----------------------------------+
247+
| 539 | 10786 | preview | 6af5dac31e7697c4481426712742f4d6391aea0a5b1df145e08e9eaa105af4a5 | 2323875790 | 1 | 2024-04-16 11:44:25.583804349 UTC |
248+
+-------+-----------+---------+------------------------------------------------------------------+------------+-----------+-----------------------------------+
249+
| 539 | 10785 | preview | 39770647f027a214ac955668dffe4d6d51b9cf67798041de1b003b21ef2208da | 2323295044 | 1 | 2024-04-16 10:31:26.056746652 UTC |
250+
+-------+-----------+---------+------------------------------------------------------------------+------------+-----------+-----------------------------------+
251+
| 539 | 10784 | preview | 9ce64187cb6af25266563e039e8d15962d281482979df94e3ac5c5ca6a914eea | 2323079205 | 1 | 2024-04-16 09:08:14.605224999 UTC |
252+
+-------+-----------+---------+------------------------------------------------------------------+------------+-----------+-----------------------------------+
253+
| | | | | | | |
251254
252255
```
253256

@@ -257,63 +260,70 @@ If you restore a Cardano node with a version not included in the advertised rang
257260

258261
:::
259262

260-
### Step 3: Show snapshot details
263+
### Step 3: Show Cardano DB snapshot details
261264

262265
To get more details from a specific snapshot (optional), run:
263266

264267
```bash
265-
./mithril-client snapshot show $SNAPSHOT_DIGEST
268+
./mithril-client cardano-db snapshot show $SNAPSHOT_DIGEST
266269
```
267270

268271
You will see more information about the snapshot:
269272

270273
```bash
271-
+-----------------------+-------------------------------------------------------------------------------------------------------------------------------+
272-
| Info | Value |
273-
+-----------------------+-------------------------------------------------------------------------------------------------------------------------------+
274-
| Epoch | 72 |
275-
+-----------------------+-------------------------------------------------------------------------------------------------------------------------------+
276-
| Immutable File Number | 1379 |
277-
+-----------------------+-------------------------------------------------------------------------------------------------------------------------------+
278-
| Digest | a305aa11b0e2ccf737d4f5def8b0a9f2245eded2b4ec4be876f7bd64deddcbbf |
279-
+-----------------------+-------------------------------------------------------------------------------------------------------------------------------+
280-
| Size | 1259745182 |
281-
+-----------------------+-------------------------------------------------------------------------------------------------------------------------------+
282-
| Location 1 | https://storage.googleapis.com/mithril-release-preprod-…aa11b0e2ccf737d4f5def8b0a9f2245eded2b4ec4be876f7bd64deddcbbf.tar.gz |
283-
+-----------------------+-------------------------------------------------------------------------------------------------------------------------------+
284-
| Cardano node version | 8.7.3 |
285-
+-----------------------+-------------------------------------------------------------------------------------------------------------------------------+
286-
| Created | 2023-05-31T14:02:40.150189810Z |
287-
+-----------------------+-------------------------------------------------------------------------------------------------------------------------------+
274+
+-----------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
275+
| Epoch | 539 |
276+
+-----------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
277+
| Immutable File Number | 10787 |
278+
+-----------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
279+
| Network | preview |
280+
+-----------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
281+
| Digest | db5f50a060d4b813125c4263b700ecc96e5d8c8710f0430e5c80d2f0fa79b667 |
282+
+-----------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
283+
| Size | 2323485648 |
284+
+-----------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
285+
| Cardano node version | 8.9.0 |
286+
+-----------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
287+
| Location | https://storage.googleapis.com/cdn.aggregator.testing-preview.api.mithril.network/preview-e539-i10787.db5f50a060d4b813125c4263b700ecc96e5d8c8710f0430e5c80d2f0fa79b667.tar.zst |
288+
+-----------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
289+
| Created | 2024-04-16 12:56:22.170174972 UTC |
290+
+-----------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
291+
| Compression Algorithm | Zstandard |
292+
+-----------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
288293
```
289294

290-
### Step 4: Download the selected snapshot
295+
### Step 4: Download the selected Cardano DB snapshot
291296

292297
To download the selected snapshot from the remote location to your remote location, run:
293298

294299
```bash
295-
./mithril-client snapshot download $SNAPSHOT_DIGEST
300+
./mithril-client cardano-db download $SNAPSHOT_DIGEST
296301
```
297302

298303

299304
You will see that the selected snapshot archive has been downloaded locally, unpacked, and that the associated certificate is valid:
300305

301306
```bash
302-
Unpacking snapshot...
303-
Unpack success cd587611b5ff2445c714bef083d9455ed3e42e9304ae0ad38b02432d03f9b068
304-
to /home/mithril/data/testnet/cd587611b5ff2445c714bef083d9455ed3e42e9304ae0ad38b02432d03f9b068/db
307+
1/5 - Checking local disk info…
308+
2/5 - Fetching the certificate and verifying the certificate chain…
309+
3/5 - Downloading and unpacking the cardano db
310+
4/5 - Computing the cardano db message
311+
5/5 - Verifying the cardano db signature…
312+
Cardano db 'db5f50a060d4b813125c4263b700ecc96e5d8c8710f0430e5c80d2f0fa79b667' has been unpacked and successfully checked against Mithril multi-signature contained in the certificate.
313+
314+
Files in the directory '/home/mithril/data/testnet/db5f50a060d4b813125c4263b700ecc96e5d8c8710f0430e5c80d2f0fa79b667/db' can be used to run a Cardano node with version >= 8.9.0.
305315

306-
Restore a Cardano node:
316+
If you are using Cardano Docker image, you can restore a Cardano Node with:
307317

308-
docker run -v cardano-node-ipc:/ipc -v cardano-node-data:/data --mount type=bind,source="/home/mithril/data/testnet/cd587611b5ff2445c714bef083d9455ed3e42e9304ae0ad38b02432d03f9b068/db",target=/data/db/ -e NETWORK=testnet inputoutput/cardano-node
318+
docker run -v cardano-node-ipc:/ipc -v cardano-node-data:/data --mount type=bind,source="/home/mithril/data/testnet/db5f50a060d4b813125c4263b700ecc96e5d8c8710f0430e5c80d2f0fa79b667/db",target=/data/db/ -e NETWORK=preview ghcr.io/intersectmbo/cardano-node:8.9.0
309319
```
310320

311-
### Step 5: Launch a Cardano node from the restored snapshot
321+
### Step 5: Launch a Cardano node from the restored Cardano DB snapshot
312322

313323
Launch an empty Cardano node and make it live in minutes!
314324

315325
```bash
316-
docker run -v cardano-node-ipc:/ipc -v cardano-node-data:/data --mount type=bind,source="$(pwd)/data/testnet/$SNAPSHOT_DIGEST/db",target=/data/db/ -e NETWORK=**YOUR_CARDANO_NETWORK** inputoutput/cardano-node
326+
docker run -v cardano-node-ipc:/ipc -v cardano-node-data:/data --mount type=bind,source="$(pwd)/data/testnet/$SNAPSHOT_DIGEST/db",target=/data/db/ -e NETWORK=testnet inputoutput/cardano-node
317327
```
318328

319329
You will see the node start by validating the files ingested from the snapshot archive:

0 commit comments

Comments
 (0)