Skip to content

Instantly share code, notes, and snippets.

@getwildr
Last active October 1, 2022 03:32
Show Gist options
  • Save getwildr/c13e24a8924bba9fdf325f457c291293 to your computer and use it in GitHub Desktop.
Save getwildr/c13e24a8924bba9fdf325f457c291293 to your computer and use it in GitHub Desktop.

Create GUILD preview directory

$ cd ~/tmp; ./prereqs.sh -b alpha -t mith01 -n preview

Build mithril-client as per documentation

Mithril Client Node

CD into build dir, Edit restoreLatest.sh

#!/bin/bash

[[ -z $1 ]] || NAM=$1

# Cardano network
export NETWORK=preview

# Aggregator API endpoint URL
export AGGREGATOR_ENDPOINT=https://aggregator.api.mithril.network/aggregator

export GENESIS_VERIFICATION_KEY=$(wget -q -O - https://raw.githubusercontent.com/input-output-hk/mithril/main/TEST_ONLY_genesis.vkey)

# Digest of the latest produced snapshot for convenience of the demo
export SNAPSHOT_DIGEST=$(curl -s $AGGREGATOR_ENDPOINT/snapshots | jq -r '.[0].digest')

if [[ -z $NETWORK || -z $AGGREGATOR_ENDPOINT || -z $GENESIS_VERIFICATION_KEY || -z $SNAPSHOT_DIGEST ]]; then
  echo "Req Param Missing. Exiting" && return 1
else
  ./mithril-client download $SNAPSHOT_DIGEST
  ./mithril-client restore  $SNAPSHOT_DIGEST
fi

if [[ -n $NAM ]]; then
  TARGET="/opt/cardano/$NAM"
  [[ -d $TARGET ]] && cp -vr ./data/$NETWORK/$SNAPSHOT_DIGEST/db $TARGET/
fi
$ chmod +x restoreLatest.sh

Run script providing the previously used GUILD dir name

$ ./restoreLatest.sh mith01

Go run your node

$ cd /opt/cardano/mith01/scripts/
$ ./cnode.sh &

Confirm node is running with GUILD GLV

$ ./gLiveView.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment