Skip to content

Commit 76b6910

Browse files
committed
feat: mithril support on preview
Signed-off-by: Chris Gianelloni <[email protected]>
1 parent 62f8570 commit 76b6910

File tree

3 files changed

+19
-13
lines changed

3 files changed

+19
-13
lines changed

bin/run-network

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,21 @@ esac
1414

1515
# Mithril
1616
if ! test -e /data/db/protocolMagicId; then
17+
__base=https://raw.githubusercontent.com/input-output-hk/mithril/main/mithril-infra/configuration
1718
case ${NETWORK} in
18-
mainnet|preprod)
19-
__base=https://raw.githubusercontent.com/input-output-hk/mithril/main/mithril-infra/configuration
20-
__url=${__base}/release-${NETWORK}
21-
export GENESIS_VERIFICATION_KEY=$(curl ${__url}/genesis.vkey 2> /dev/null)
22-
export AGGREGATOR_ENDPOINT=https://aggregator.release-${NETWORK}.api.mithril.network/aggregator
23-
export SNAPSHOT_DIGEST=$(mithril-client snapshot list --json | jq -r '.[0].digest')
24-
mkdir -p /data
25-
cd /data
26-
echo "Starting: /usr/local/bin/mithril-client snapshot download ${SNAPSHOT_DIGEST}"
27-
mithril-client snapshot download ${SNAPSHOT_DIGEST}
28-
;;
29-
*) echo "Mithril not supported on ${NETWORK}... skipping" ;;
19+
mainnet|preprod) __path=release-${NETWORK} ;;
20+
preview) __path=pre-release-${NETWORK} ;;
21+
*) echo "Mithril not supported on ${NETWORK}... skipping"; __skip=true ;;
3022
esac
23+
if [[ ${__skip} != true ]]; then
24+
export GENESIS_VERIFICATION_KEY=$(curl ${__base}/${__path}/genesis.vkey 2> /dev/null)
25+
export AGGREGATOR_ENDPOINT=https://aggregator.${__path}.api.mithril.network/aggregator
26+
export SNAPSHOT_DIGEST=$(mithril-client snapshot list --json | jq -r '.[0].digest')
27+
mkdir -p /data
28+
cd /data
29+
echo "Starting: /usr/local/bin/mithril-client snapshot download ${SNAPSHOT_DIGEST}"
30+
mithril-client snapshot download ${SNAPSHOT_DIGEST}
31+
fi
3132
fi
3233

3334
echo "Starting: /usr/local/bin/cardano-node run"

bin/run-node

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,11 @@ CARDANO_RTS_OPTS=${CARDANO_RTS_OPTS:--N2 -A64m -I0 -qg -qb --disable-delayed-os-
4343
CARDANO_SOCKET_PATH=${CARDANO_SOCKET_PATH:-/opt/cardano/ipc/socket}
4444
CARDANO_TOPOLOGY=${CARDANO_TOPOLOGY:-${CARDANO_CONFIG_BASE}/${CARDANO_NETWORK}/topology.json}
4545
# mithril
46-
AGGREGATOR_ENDPOINT=${AGGREGATOR_ENDPOINT:-https://aggregator.release-${CARDANO_NETWORK}.api.mithril.network/aggregator}
46+
case ${CARDANO_NETWORK} in
47+
mainnet|preprod) __path=release-${CARDANO_NETWORK} ;;
48+
preview) __path=pre-release-${CARDANO_NETWORK} ;;
49+
esac
50+
AGGREGATOR_ENDPOINT=${AGGREGATOR_ENDPOINT:-https://aggregator.${__path}.api.mithril.network/aggregator}
4751
GENESIS_VERIFICATION_KEY_PATH=${GENESIS_VERIFICATION_KEY_PATH:-${CARDANO_CONFIG_BASE}/${CARDANO_NETWORK}/genesis.vkey}
4852
if [[ -z $GENESIS_VERIFICATION_KEY && -f $GENESIS_VERIFICATION_KEY_PATH ]]; then
4953
GENESIS_VERIFICATION_KEY=$(<${GENESIS_VERIFICATION_KEY_PATH})

config/preview/genesis.vkey

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
5b3132372c37332c3132342c3136312c362c3133372c3133312c3231332c3230372c3131372c3139382c38352c3137362c3139392c3136322c3234312c36382c3132332c3131392c3134352c31332c3233322c3234332c34392c3232392c322c3234392c3230352c3230352c33392c3233352c34345d

0 commit comments

Comments
 (0)