Skip to content

Commit 2dea4f4

Browse files
authored
Merge pull request #842 from input-output-hk/jpraynaud/update-current-documentation-2023-03-31
Update current documentation
2 parents aa074ac + d3433ef commit 2dea4f4

File tree

3 files changed

+172
-9
lines changed

3 files changed

+172
-9
lines changed

docs/versioned_docs/version-maintained/manual/developer-docs/nodes/mithril-aggregator.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,81 @@ Run 'serve' command in release with a custom configuration via env vars
161161
GENESIS_VERIFICATION_KEY=$(wget -q -O - **YOUR_GENESIS_VERIFICATION_KEY**) RUN_INTERVAL=60000 NETWORK=**YOUR_CARDANO_NETWORK** ./mithril-aggregator serve
162162
```
163163

164+
## Release build and run binary 'genesis' command
165+
166+
Build in release with default configuration
167+
168+
```bash
169+
make build
170+
```
171+
172+
Display the help menu
173+
174+
```bash
175+
./mithril-aggregator genesis --help
176+
```
177+
178+
You should see
179+
180+
```bash
181+
mithril-aggregator-genesis
182+
Aggregator runs in Genesis tools mode
183+
USAGE:
184+
mithril-aggregator genesis <SUBCOMMAND>
185+
OPTIONS:
186+
-h, --help Print help information
187+
SUBCOMMANDS:
188+
bootstrap Bootstrap a genesis certificate Test only usage
189+
export Export payload to sign with genesis secret key
190+
help Print this message or the help of the given subcommand(s)
191+
import Import payload signed with genesis secret key and create & import a genesis certificate
192+
```
193+
194+
Run 'genesis bootstrap' command in release with default configuration, **only in test mode**.
195+
This allows the Mithril Aggregator node to bootstrap a `Genesis Certificate`. After this operation, the Mithril Aggregator will be able to produce new snapshots and certificates.
196+
197+
```bash
198+
./mithril-aggregator genesis bootstrap
199+
```
200+
201+
Or with a specific `Genesis Secret Key`, **only in test mode**.
202+
203+
```bash
204+
./mithril-aggregator genesis bootstrap --genesis-secret-key **YOUR_SECRET_KEY*
205+
```
206+
207+
Run 'genesis export' command in release with default configuration.
208+
This allows the Mithril Aggregator node to export the `Genesis Payload` that needs to be signed (and later reimported) of the `Genesis Certificate`. The signature of the `Genesis Payload` must be done manually with the owner of the `Genesis Secret Key`.
209+
210+
```bash
211+
./mithril-aggregator genesis export
212+
```
213+
214+
Or with a custom export path (to override the default value `./mithril-genesis-payload.txt`)
215+
216+
```bash
217+
./mithril-aggregator genesis export --target-path **YOUR_TARGET_PATH**
218+
```
219+
220+
Run 'genesis import' command in release with default configuration.
221+
This allows the Mithril Aggregator node to import the signed payload of the `Genesis Certificate` and create it in the store. After this operation, the Mithril Aggregator will be able to produce new snapshots and certificates.
222+
223+
```bash
224+
./mithril-aggregator genesis import
225+
```
226+
227+
Or with a custom export path (to override the default value `./mithril-genesis-signed-payload.txt`)
228+
229+
```bash
230+
./mithril-aggregator genesis import --signed-payload-path **YOUR_SIGNED_PAYLOAD_PATH**
231+
```
232+
233+
Run 'genesis import' command in release with a custom configuration via env vars
234+
235+
```bash
236+
GENESIS_VERIFICATION_KEY=$(wget -q -O - **YOUR_GENESIS_VERIFICATION_KEY**) RUN_INTERVAL=60000 NETWORK=**YOUR_CARDANO_NETWORK** ./mithril-aggregator genesis import
237+
```
238+
164239
## Release build and run binary 'era' command
165240

166241
Build in release with default configuration

docs/versioned_docs/version-maintained/manual/developer-docs/nodes/mithril-client.md

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,57 @@ If you want to dig deeper, you can get access to several level of logs from the
187187

188188
<CompiledBinaries />
189189

190-
## Build and run Docker container
190+
## Run Docker container
191+
192+
### Registry Image
193+
194+
The list of available images on the registry is listed [here](https://github.com/input-output-hk/mithril/pkgs/container/mithril-client)
195+
196+
Prepare environment variables (values can be retrieved on the above **Mithril Networks** table)
197+
198+
```bash
199+
export MITHRIL_IMAGE_ID=**YOUR_MITHRIL_IMAGE_ID**
200+
export NETWORK=**YOUR_CARDANO_NETWORK**
201+
export AGGREGATOR_ENDPOINT=**YOUR_AGGREGATOR_ENDPOINT**
202+
export GENESIS_VERIFICATION_KEY=$(wget -q -O - **YOUR_GENESIS_VERIFICATION_KEY**)
203+
export SNAPSHOT_DIGEST=$(curl -s $AGGREGATOR_ENDPOINT/snapshots | jq -r '.[0].digest')
204+
```
205+
206+
Here is an example configuration for the `release-preprod` network and the `latest` stable Docker image
207+
208+
```bash
209+
export MITHRIL_IMAGE_ID=latest
210+
export NETWORK=preprod
211+
export AGGREGATOR_ENDPOINT=https://aggregator.release-preprod.api.mithril.network/aggregator
212+
export GENESIS_VERIFICATION_KEY=$(wget -q -O - https://raw.githubusercontent.com/input-output-hk/mithril/main/mithril-infra/configuration/release-preprod/genesis.vkey)
213+
export SNAPSHOT_DIGEST=$(curl -s $AGGREGATOR_ENDPOINT/snapshots | jq -r '.[0].digest')
214+
```
215+
216+
Then create a shell function for the Mithril Client
217+
218+
```bash
219+
mithril_client () {
220+
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 $@
221+
}
222+
```
223+
224+
Now you can use the `mithril_client` function:
225+
226+
```bash
227+
# 1- Help
228+
mithril_client help
229+
230+
# 2- List snapshots
231+
mithril_client list
232+
233+
# 3- Download latest snapshot
234+
mithril_client download $SNAPSHOT_DIGEST
235+
236+
# 4- Restore latest snapshot
237+
mithril_client restore $SNAPSHOT_DIGEST
238+
```
239+
240+
### Local Image
191241

192242
Build a local Docker image
193243

docs/versioned_docs/version-maintained/manual/getting-started/bootstrap-cardano-node.md

Lines changed: 46 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -158,31 +158,69 @@ If you want to dig deeper, you can get access to several level of logs from the
158158

159159
<CompiledBinaries />
160160

161+
## Run Docker container
162+
163+
The list of available images on the registry is listed [here](https://github.com/input-output-hk/mithril/pkgs/container/mithril-client)
164+
165+
Prepare an environment variable with the selected Docker image
166+
167+
```bash
168+
export MITHRIL_IMAGE_ID=**YOUR_MITHRIL_IMAGE_ID**
169+
```
170+
171+
Here is an example configuration for the `latest` stable Docker image
172+
173+
```bash
174+
export MITHRIL_IMAGE_ID=latest
175+
```
176+
177+
Then create a shell function for the Mithril Client:
178+
```bash
179+
mithril_client () {
180+
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 $@
181+
}
182+
```
183+
184+
Now you can use the `mithril_client` function:
185+
```bash
186+
# 1- Help
187+
mithril_client help
188+
189+
# 2- List snapshots
190+
mithril_client list
191+
```
192+
193+
:::tip
194+
195+
In the following part of the document, you will need to replace the `./mithril-client` commands with `mithril_client` in order to use the above shell function.
196+
197+
:::
198+
161199
## Bootstrap a Cardano node from a testnet Mithril snapshot
162200

163201
### Step 1: Prepare some useful variables
164202

165203
```bash
166204
# Cardano network
167-
NETWORK=**YOUR_CARDANO_NETWORK**
205+
export NETWORK=**YOUR_CARDANO_NETWORK**
168206

169207
# Aggregator API endpoint URL
170-
AGGREGATOR_ENDPOINT=**YOUR_AGGREGATOR_ENDPOINT**
208+
export AGGREGATOR_ENDPOINT=**YOUR_AGGREGATOR_ENDPOINT**
171209

172210
# Genesis verification key
173-
GENESIS_VERIFICATION_KEY=$(wget -q -O - **YOUR_GENESIS_VERIFICATION_KEY**)
211+
export GENESIS_VERIFICATION_KEY=$(wget -q -O - **YOUR_GENESIS_VERIFICATION_KEY**)
174212

175213
# Digest of the latest produced snapshot for convenience of the demo
176214
# 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
177-
SNAPSHOT_DIGEST=$(curl -s $AGGREGATOR_ENDPOINT/snapshots | jq -r '.[0].digest')
215+
export SNAPSHOT_DIGEST=$(curl -s $AGGREGATOR_ENDPOINT/snapshots | jq -r '.[0].digest')
178216
```
179217

180218
### Step 2: Select A Snapshot
181219

182220
List the available snapshots with which you can bootstrap a Cardano node
183221

184222
```bash
185-
GENESIS_VERIFICATION_KEY=$GENESIS_VERIFICATION_KEY NETWORK=$NETWORK AGGREGATOR_ENDPOINT=$AGGREGATOR_ENDPOINT ./mithril-client list
223+
./mithril-client list
186224
```
187225

188226
You will see a list of snapshots
@@ -208,7 +246,7 @@ You will see a list of snapshots
208246
Get some more details from a specific snapshot (Optional)
209247

210248
```bash
211-
GENESIS_VERIFICATION_KEY=$GENESIS_VERIFICATION_KEY NETWORK=$NETWORK AGGREGATOR_ENDPOINT=$AGGREGATOR_ENDPOINT ./mithril-client show $SNAPSHOT_DIGEST
249+
./mithril-client show $SNAPSHOT_DIGEST
212250
```
213251

214252
You will see more information about a snapshot
@@ -233,7 +271,7 @@ You will see more information about a snapshot
233271
Download the selected snapshot from the remote location to your remote location
234272

235273
```bash
236-
GENESIS_VERIFICATION_KEY=$GENESIS_VERIFICATION_KEY NETWORK=$NETWORK AGGREGATOR_ENDPOINT=$AGGREGATOR_ENDPOINT ./mithril-client download $SNAPSHOT_DIGEST
274+
./mithril-client download $SNAPSHOT_DIGEST
237275
```
238276

239277
You will see that the selected snapshot archive has been downloaded locally
@@ -249,7 +287,7 @@ to /home/mithril/data/testnet/cd587611b5ff2445c714bef083d9455ed3e42e9304ae0ad38b
249287
Verify the Certificate of the snapshot and unpack its content in order to feed the Cardano node database
250288

251289
```bash
252-
GENESIS_VERIFICATION_KEY=$GENESIS_VERIFICATION_KEY NETWORK=$NETWORK AGGREGATOR_ENDPOINT=$AGGREGATOR_ENDPOINT ./mithril-client restore $SNAPSHOT_DIGEST
290+
./mithril-client restore $SNAPSHOT_DIGEST
253291
```
254292

255293
You will see that the snapshot archive is unpacked and that the associated certificate is valid

0 commit comments

Comments
 (0)