Skip to content

Commit

Permalink
Merge pull request #473 from oasisprotocol/peternose/fix/docker-speed…
Browse files Browse the repository at this point in the history
…-up-km-startup

fix: sapphire-dev: Speed up key manager initialization
  • Loading branch information
peternose authored Nov 15, 2023
2 parents 2262af5 + 99679c7 commit d9bd561
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions docker/common/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,15 @@ if [[ ${BEACON_BACKEND} == 'mock' ]]; then
echo -n .
${OASIS_NODE} debug control set-epoch --epoch 1 -a unix:${OASIS_NODE_SOCKET}

echo -n .
${OASIS_NODE} debug control set-epoch --epoch 2 -a unix:${OASIS_NODE_SOCKET}

# Transition to the final epoch when the KM generates ephemeral secret.
if [[ ${PARATIME_NAME} == 'sapphire' ]]; then
while (${OASIS_NODE} control status -a unix:${OASIS_KM_SOCKET} | jq -e ".keymanager.worker.ephemeral_secrets.last_generated_epoch!=3" >/dev/null); do
while (${OASIS_NODE} control status -a unix:${OASIS_KM_SOCKET} | jq -e ".keymanager.worker.ephemeral_secrets.last_generated_epoch!=2" >/dev/null); do
sleep 0.5
done
echo -n .
${OASIS_NODE} debug control set-epoch --epoch 3 -a unix:${OASIS_NODE_SOCKET}
fi

echo -n .
${OASIS_NODE} debug control set-epoch --epoch 2 -a unix:${OASIS_NODE_SOCKET}
else
${OASIS_NODE} debug control wait-ready -a unix:${OASIS_NODE_SOCKET}
fi
Expand Down

0 comments on commit d9bd561

Please sign in to comment.