From 65f7f8d89148bd985d98dec4099b4f04e76ed6f2 Mon Sep 17 00:00:00 2001 From: roy-dydx <133032749+roy-dydx@users.noreply.github.com> Date: Mon, 6 Nov 2023 10:57:28 -0500 Subject: [PATCH] Improve usability of snapshots saved by snapshotting node (#749) * Improve usability of snapshots saved by snapshotting node * Remove workflow changeS * Update snapshot.sh --- protocol/testing/snapshotting/snapshot.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/protocol/testing/snapshotting/snapshot.sh b/protocol/testing/snapshotting/snapshot.sh index f7223f4769..7f7e851d5d 100755 --- a/protocol/testing/snapshotting/snapshot.sh +++ b/protocol/testing/snapshotting/snapshot.sh @@ -87,6 +87,9 @@ sleep 10 dydxprotocold init --chain-id=${CHAIN_ID} --home /dydxprotocol/chain/local_node local_node curl -X GET ${genesis_file_rpc_address}/genesis | jq '.result.genesis' > /dydxprotocol/chain/local_node/config/genesis.json +# Set pruning to prune all but the last two states. Prevents snapshots from getting too big. +sed -i 's/pruning = "default"/pruning = "everything"/' /dydxprotocol/chain/local_node/config/app.toml + setup_cosmovisor # TODO: add metrics around snapshot upload latency/frequency/success rate @@ -99,7 +102,7 @@ while true; do kill -TERM $(pidof cosmovisor) log_this "Creating new snapshot" - SNAP_NAME=$(echo "${CHAIN_ID}_$(date '+%Y-%m-%d-%M-%H').tar.gz") + SNAP_NAME=$(echo "${CHAIN_ID}_$(date '+%Y-%m-%d-%H-%M').tar.gz") tar cvzf ${SNAP_PATH}/${SNAP_NAME} ${DATA_PATH} aws s3 cp ${SNAP_PATH}/${SNAP_NAME} s3://${s3_snapshot_bucket}/ --region ap-northeast-1 --debug || true rm -rf ${SNAP_PATH}/${SNAP_NAME}