File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ #
3+ # This script advances the mock epoch by 1 or by the number of epochs
4+ # given as the first argument to this script.
5+
6+ set -eo pipefail
7+
8+ num_epochs=" ${1:- 1} "
9+
10+ OASIS_NODE_SOCKET=${OASIS_NODE_DATADIR} /net-runner/network/client-0/internal.sock
11+
12+ if [[ " ${BEACON_BACKEND:- mock} " != " mock" ]]; then
13+ echo " This command only works with the mock beacon backend."
14+ echo " Run the container with BEACON_BACKEND set to 'mock' to enable it."
15+ exit 1
16+ fi
17+
18+ # Wait for the Oasis Node to start.
19+ while [[ ! -S ${OASIS_NODE_SOCKET} ]]; do sleep 1; done
20+
21+ old_epoch=` ${OASIS_NODE_BINARY} control status -a unix:${OASIS_NODE_SOCKET} | jq ' .consensus.latest_epoch' `
22+ new_epoch=$(( old_epoch + num_epochs))
23+ ${OASIS_NODE_BINARY} debug control set-epoch --epoch ${new_epoch} -a unix:${OASIS_NODE_SOCKET}
24+
25+ echo " Epoch advanced from ${old_epoch} to ${new_epoch} ."
26+ exit 0
You can’t perform that action at this time.
0 commit comments