Skip to content

Commit

Permalink
change snapshot can mount
Browse files Browse the repository at this point in the history
  • Loading branch information
Hcreak committed Aug 4, 2023
1 parent e51e17c commit d4517d2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion rocksdb-exporter/docker_rocksdb-exporter.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
docker run -v /data:/rocksdb-exporter/data \
-e LATEST_URL=https://prod-forge-us-west-2-chain-data-backup.s3.us-west-2.amazonaws.com/latest \
-v /tmp/snapshot:/rocksdb-exporter/snapshot \
-e LATEST_URL=https://prod-testnet-us-west-2-chain-data-backup.s3.us-west-2.amazonaws.com/latest \
-e REDIS_HOST=35.93.22.13 -e REDIS_PORT=9999 \
--rm ghcr.io/findoranetwork/enterprise-web3:rocksdb-exporter-latest

4 changes: 2 additions & 2 deletions rocksdb-exporter/run_rocksdb_exporter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ fi
CHAINDATA_URL=$(cut -d , -f 1 "${ROOT_DIR}/latest")
rm ${ROOT_DIR}/latest -f

if ! wget -O "${ROOT_DIR}/snapshot.tar.gz" "${CHAINDATA_URL}"; then
if ! wget -O "${ROOT_DIR}/snapshot/snapshot.tar.gz" "${CHAINDATA_URL}"; then
echo "download latest failed, exit shell script"
exit -1
fi

rm -rvf ${ROOT_DIR}/data/tendermint/mainnet/node0/data
rm -rvf ${ROOT_DIR}/data/ledger

tar -xvf ${ROOT_DIR}/snapshot.tar.gz -C ${ROOT_DIR}
tar -xvf ${ROOT_DIR}/snapshot/snapshot.tar.gz -C ${ROOT_DIR}

cat ${ROOT_DIR}/versioned-kv.lua | redis-cli -h ${REDIS_HOST} -p ${REDIS_PORT} -x FUNCTION LOAD REPLACE
sed -i "s#127.0.0.1#${REDIS_HOST}#g" ${ROOT_DIR}/rocksdb-exporter-config.toml
Expand Down

0 comments on commit d4517d2

Please sign in to comment.