Skip to content

Commit

Permalink
Improve usability of snapshots saved by snapshotting node (#749)
Browse files Browse the repository at this point in the history
* Improve usability of snapshots saved by snapshotting node

* Remove workflow changeS

* Update snapshot.sh
  • Loading branch information
roy-dydx authored Nov 6, 2023
1 parent 79769b7 commit 65f7f8d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion protocol/testing/snapshotting/snapshot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}
Expand Down

0 comments on commit 65f7f8d

Please sign in to comment.