├── 2021-01-20_14-19.png ├── README.md ├── default.conf ├── instructions ├── Agoric.md ├── Akash.md ├── Archway.md ├── Desmos.md ├── Oasis.md ├── Osmosis.md ├── Sentinel.md ├── Sifchain.md └── Stargaze.md └── scripts ├── agoric_snapshot.sh ├── agoric_statesync.sh ├── akash_auto_update.sh ├── akash_snapshot.sh ├── akash_statesync.sh ├── desmos_snapshot.sh ├── oasis_snapshot.sh ├── osmosis_snapshot.sh ├── sentinel_snapshot.sh ├── sentinel_statesync.sh ├── sifchain_snapshot.sh ├── snapshot_kichain.sh └── stargaze_snapshot.sh /2021-01-20_14-19.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c29r3/cosmos-snapshots/0250a098a7ea13bb3edbd75736038b89c93eaa83/2021-01-20_14-19.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # cosmos-snapshots 2 | List of snapshots: 3 | https://snapshots.c29r3.xyz: 4 | - [Akash mainnet](https://github.com/c29r3/cosmos-snapshots/blob/main/instructions/Akash.md) | [MIRRORS](https://gist.githubusercontent.com/c29r3/1a8a951008b19aaa424d63d15cf528d8/raw/910b3ab34bcceb2b3e9bca0765a92461bafc53f8/akash-snapshot-mirrors) 5 | - [Sentinel mainnet](https://github.com/c29r3/cosmos-snapshots/blob/main/instructions/Sentinel.md) 6 | - [Desmos mainnet](https://github.com/c29r3/cosmos-snapshots/blob/main/instructions/Desmos.md) 7 | - [Stargaze mainnet](https://github.com/c29r3/cosmos-snapshots/blob/main/instructions/Stargaze.md) 8 | - [Agoric mainnet](https://github.com/c29r3/cosmos-snapshots/blob/main/instructions/Agoric.md) 9 | 10 | 11 | ## MIRRORS 12 | http://162.255.116.68/snapshots/ - privded by Min (Min#6706) 13 | https://snapshots.stakecraft.com/ - provided by Alex Novy 14 | 15 | http://snapshots.alexvalidator.com - Provided by [Bambarello](https://github.com/Bambarello) 16 | - [Oasis mainnet](https://github.com/Bambarello/cosmos-snapshots/blob/main/Oasis.md) 17 | - IXO (Mainnet) 18 | - Regen (Mainnet) 19 | - Stargaze (Mainnet) 20 | - Juno (Mainnet) 21 | - Axelar (Mainnet) 22 | - Sifchain (Betanet) 23 | - Desmos (Mainnet) 24 | - Evmos (Mainnet) 25 | - Gravity Bridge (Mainnet) 26 | - Omniflix (Mainnet) 27 | - Umee (Mainnet) 28 | - Cosmos (Mainnet) 29 | - Kichain (Mainnet) 30 | 31 | https://services.staketab.com/ - provided by [Staketab](https://github.com/Staketab) 32 | - Axelar 33 | - Axelar testnet 1 34 | - Axelar testnet 2 35 | - Cosmos 36 | - Desmos 37 | - Evmos 38 | - Gravity bridge 39 | - Omniflix 40 | - Osmosis 41 | - Sifchain 42 | - Stargaze 43 | - Umee 44 | 45 | https://snapshots.stake2.me/ - provided by [Danil Ushakov](https://github.com/k0kk0k) 46 | - Agoric 47 | - Akash 48 | - Certik 49 | - Gravity bridge 50 | - IXO 51 | - Osmosis 52 | - Sifchain 53 | - Stargaze 54 | 55 | 56 | https://snapshot.notional.ventures/ - provided by [Notional](https://github.com/notional-labs) 57 | - Cosmoshub 58 | - Osmosis 59 | - Juno 60 | - Starname 61 | - Regen 62 | - Akash 63 | - Sentinel 64 | - E-money 65 | - Terra 66 | - Ixo 67 | - Sifchain 68 | - Likecoin 69 | - Kichain 70 | - Cyber 71 | - Cheqd 72 | - Stargaze 73 | - Band 74 | - Chihuahua 75 | - Kava 76 | - Bitcanna 77 | - Konstellation 78 | - Omniflixhub 79 | - Vidulum 80 | - Provenance 81 | - Dig 82 | - Gravity bridge 83 | - Comdex 84 | - Cerberus 85 | - Bitsong 86 | - AssetMantle 87 | - FetchAI 88 | 89 | ## Run your own backup server with snapshots 90 | Install requirements 91 | ```bash 92 | sudo apt update && \ 93 | sudo apt install curl git docker.io -y 94 | ``` 95 | 96 | Clone github repo 97 | `git clone https://github.com/c29r3/cosmos-snapshots.git && cd cosmos-snapshots` 98 | 99 | Create folder for snapshots 100 | `mkdir $HOME/snapshots/` 101 | 102 | Start Nginx via docker 103 | ```bash 104 | cd $HOME; \ 105 | docker run --name snapshots \ 106 | --restart always \ 107 | -v $(pwd)/default.conf:/etc/nginx/conf.d/default.conf \ 108 | -v $(pwd)/snapshots/:/root/ \ 109 | -p 80:80 \ 110 | -d nginx 111 | ``` 112 | 113 | Fill in the variables in the file `akash_snapshot.sh` 114 | ``` 115 | CHAIN_ID="akashnet-2" 116 | SNAP_PATH="$HOME/snapshots/akash" 117 | LOG_PATH="$HOME/snapshots/akash_log.txt" 118 | DATA_PATH="$HOME/.akash/data/" 119 | SERVICE_NAME="akash.service" 120 | ``` 121 | Create new snapshot 122 | `./akash_snapshot.sh` 123 | 124 | Check snapshot 125 | ```bash 126 | MY_IP=$(curl -s 2ip.ru); \ 127 | curl -s http://${MY_IP} 128 | ``` 129 | 130 | ## Automation 131 | You can add script to the cron 132 | ```cron 133 | # start every day at 00:00 134 | 0 0 * * * /bin/bash -c '/root/akash_snapshot.sh' 135 | ``` 136 | -------------------------------------------------------------------------------- /default.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80; 3 | client_max_body_size 5G; 4 | proxy_max_temp_file_size 0; 5 | root /root; 6 | autoindex on; 7 | } 8 | -------------------------------------------------------------------------------- /instructions/Agoric.md: -------------------------------------------------------------------------------- 1 | ## Download latest snapshot (using the example of Osmosis) 2 | Stop Agoric service 3 | `sudo systemctl stop agoricd.service` 4 | 5 | Remove old data in directory `~/.agoric/data` 6 | ``` 7 | rm -rf ~/.agoric/data; \ 8 | mkdir -p ~/.agoric/data; \ 9 | cd ~/.agoric/data 10 | ``` 11 | 12 | Download snapshot 13 | ```bash 14 | SNAP_NAME=$(curl -s https://snapshots.c29r3.xyz/agoric/ | egrep -o ">agoric-3.*tar" | tr -d ">"); \ 15 | wget -O - https://snapshots.c29r3.xyz/agoric/${SNAP_NAME} | tar xf - 16 | ``` 17 | ![alt text](https://github.com/c29r3/cosmos-snapshots/blob/main/2021-01-20_14-19.png?raw=true) 18 | 19 | Start service and check logs 20 | ``` 21 | sudo systemctl start agoricd.service; \ 22 | sudo journalctl -u agoricd.service -f --no-hostname 23 | ``` 24 | -------------------------------------------------------------------------------- /instructions/Akash.md: -------------------------------------------------------------------------------- 1 | ## Download latest snapshot (using the example of Akash) 2 | Stop Akash service 3 | `systemctl stop akash.service` 4 | 5 | Remove old data in directory `~/.akash/data` 6 | ``` 7 | rm -rf ~/.akash/data; \ 8 | mkdir -p ~/.akash/data; \ 9 | cd ~/.akash/data 10 | ``` 11 | 12 | Download snapshot 13 | ```bash 14 | SNAP_NAME=$(curl -s https://snapshots.c29r3.xyz/akash/ | egrep -o ">akashnet-2.*tar" | tr -d ">"); \ 15 | wget -O - https://snapshots.c29r3.xyz/${SNAP_NAME} | tar xf - 16 | ``` 17 | ![alt text](https://github.com/c29r3/cosmos-snapshots/blob/main/2021-01-20_14-19.png?raw=true) 18 | 19 | Start service and check logs 20 | ``` 21 | systemctl start akash.service; \ 22 | journalctl -u akash.service -f --no-hostname 23 | ``` 24 | 25 | One line command 26 | ``` 27 | sudo systemctl stop akash.service; \ 28 | rm -rf ~/.akash/data; \ 29 | mkdir -p ~/.akash/data; \ 30 | cd ~/.akash/data; \ 31 | SNAP_NAME=$(curl -s https://snapshots.c29r3.xyz/akash/ | egrep -o ">akashnet-2.*tar" | tr -d ">"); \ 32 | wget -O - https://snapshots.c29r3.xyz/akash/${SNAP_NAME} | tar xf -; \ 33 | sudo systemctl start akash.service; \ 34 | sudo journalctl -u akash.service -f --no-hostname 35 | ``` 36 | -------------------------------------------------------------------------------- /instructions/Archway.md: -------------------------------------------------------------------------------- 1 | ## Download latest snapshot (using the example of Akash) 2 | Stop Akash service 3 | `systemctl stop archway.service` 4 | 5 | Remove old data in directory `~/.archway/data` 6 | ``` 7 | rm -rf ~/.archway/data; \ 8 | mkdir -p ~/.archway/data; \ 9 | cd ~/.archway/data 10 | ``` 11 | 12 | Download snapshot 13 | ```bash 14 | SNAP_NAME=$(curl -s https://snapshots.c29r3.xyz/archway/ | egrep -o ">augusta-1.*tar" | tr -d ">"); \ 15 | wget -O - https://snapshots.c29r3.xyz/archway/${SNAP_NAME} | tar xf - 16 | ``` 17 | ![alt text](https://github.com/c29r3/cosmos-snapshots/blob/main/2021-01-20_14-19.png?raw=true) 18 | 19 | Start service and check logs 20 | ``` 21 | systemctl start archway.service; \ 22 | journalctl -u archway.service -f --no-hostname 23 | ``` 24 | -------------------------------------------------------------------------------- /instructions/Desmos.md: -------------------------------------------------------------------------------- 1 | ## Download latest snapshot (using the example of Desmos) 2 | Stop Desmos service 3 | `systemctl stop desmos.service` 4 | 5 | Remove old data in directory `~/.desmos/data` 6 | ``` 7 | rm -rf ~/.desmos/data; \ 8 | mkdir -p ~/.desmos/data; \ 9 | cd ~/.desmos/data 10 | ``` 11 | 12 | Download snapshot 13 | ```bash 14 | SNAP_NAME=$(curl -s https://snapshots.c29r3.xyz/desmos/ | egrep -o ">desmos.*tar" | tr -d ">"); \ 15 | wget -O - https://snapshots.c29r3.xyz/desmos/${SNAP_NAME} | tar xf - 16 | ``` 17 | ![alt text](https://github.com/c29r3/cosmos-snapshots/blob/main/2021-01-20_14-19.png?raw=true) 18 | 19 | Start service and check logs 20 | ``` 21 | systemctl start desmos.service; \ 22 | journalctl -u desmos.service -f --no-hostname 23 | ``` 24 | -------------------------------------------------------------------------------- /instructions/Oasis.md: -------------------------------------------------------------------------------- 1 | ## Download latest snapshot (using the example of Oasis) 2 | Stop Oasis service 3 | `systemctl stop oasis.service` 4 | 5 | Remove `abci-state` and `data` in directory `.../serverdir/node/tendermint/` and remove `/serverdir/node/persistent-store.badger.db` 6 | 7 | Go to `.../serverdir/node/tendermint/` 8 | 9 | Download and immediately unpack snapshot 10 | ```bash 11 | SNAP_NAME=$(curl -s http://snapshots.alexvalidator.com/oasis/ | egrep -o ">oasis.*tar" | tr -d ">"); \ 12 | wget -O - http://snapshots.alexvalidator.com/oasis/${SNAP_NAME} | tar xf - 13 | ``` 14 | Start service and check logs 15 | ``` 16 | systemctl start oasis.service; \ 17 | journalctl -u oasis.service -f --no-hostname 18 | ``` 19 | -------------------------------------------------------------------------------- /instructions/Osmosis.md: -------------------------------------------------------------------------------- 1 | ## Download latest snapshot (using the example of Osmosis) 2 | Stop Osmosis service 3 | `systemctl stop osmosis.service` 4 | 5 | Remove old data in directory `~/.osmosisd/data` 6 | ``` 7 | rm -rf ~/.osmosisd/data; \ 8 | mkdir -p ~/.osmosisd/data; \ 9 | cd ~/.osmosisd/data 10 | ``` 11 | 12 | Download snapshot 13 | ```bash 14 | SNAP_NAME=$(curl -s https://snapshots.c29r3.xyz/osmosis/ | egrep -o ">osmosis.*tar" | tr -d ">"); \ 15 | wget -O - https://snapshots.c29r3.xyz/osmosis/${SNAP_NAME} | tar xf - 16 | ``` 17 | ![alt text](https://github.com/c29r3/cosmos-snapshots/blob/main/2021-01-20_14-19.png?raw=true) 18 | 19 | Start service and check logs 20 | ``` 21 | systemctl start osmosis.service; \ 22 | journalctl -u osmosis.service -f --no-hostname 23 | ``` 24 | -------------------------------------------------------------------------------- /instructions/Sentinel.md: -------------------------------------------------------------------------------- 1 | ## Install Aria2 2 | ## https://aria2.github.io/ 3 | 4 | sudo apt-get install wget -y 5 | 6 | ## Download latest snapshot (using the example of Sentinel) 7 | Stop Sentinel service 8 | `systemctl stop sentinel.service` 9 | 10 | Remove old data in directory `~/.sentinelhub/data/` 11 | ``` 12 | rm -rf ~/.sentinelhub/data/; \ 13 | mkdir -p ~/.sentinelhub/data/; \ 14 | cd ~/.sentinelhub/data/ 15 | ``` 16 | 17 | Download snapshot 18 | ```bash 19 | SNAP_NAME=$(curl -s https://snapshots.c29r3.xyz/sentinel/ | egrep -o ">sentinelhub-2.*tar" | tr -d ">"); \ 20 | wget -O - https://snapshots.c29r3.xyz/sentinel/${SNAP_NAME} | tar xf - 21 | ``` 22 | ![alt text](https://github.com/c29r3/cosmos-snapshots/blob/main/2021-01-20_14-19.png?raw=true) 23 | 24 | Start service and check logs 25 | ``` 26 | systemctl start sentinel.service; \ 27 | journalctl -u sentinel.service -f --no-hostname 28 | ``` 29 | -------------------------------------------------------------------------------- /instructions/Sifchain.md: -------------------------------------------------------------------------------- 1 | ## Download latest snapshot (using the example of Sifchain) 2 | Stop Sifchain service 3 | `systemctl stop sifchain.service` 4 | 5 | Remove old data in directory `~/.sifnoded/data` 6 | ``` 7 | rm -rf ~/.sifnoded/data; \ 8 | mkdir -p ~/.sifnoded/data; \ 9 | cd ~/.sifnoded/data 10 | ``` 11 | 12 | Download snapshot 13 | ```bash 14 | SNAP_NAME=$(curl -s https://snapshots.c29r3.xyz/sifchain/ | egrep -o ">sifchain.*tar" | tail -n 1 | tr -d '>'); \ 15 | wget -O - https://snapshots.c29r3.xyz/sifchain/${SNAP_NAME} | tar xf - 16 | ``` 17 | ![alt text](https://github.com/c29r3/cosmos-snapshots/blob/main/2021-01-20_14-19.png?raw=true) 18 | 19 | Start service and check logs 20 | ``` 21 | systemctl start sifchain.service; \ 22 | journalctl -u sifchain.service -f --no-hostname 23 | ``` 24 | -------------------------------------------------------------------------------- /instructions/Stargaze.md: -------------------------------------------------------------------------------- 1 | ## Download latest snapshot (using the example of Osmosis) 2 | Stop Stargaze service 3 | `systemctl stop stargaze.service` 4 | 5 | Remove old data in directory `~/.starsd/data` 6 | ``` 7 | rm -rf ~/.starsd/data; \ 8 | mkdir -p ~/.starsd/data; \ 9 | cd ~/.starsd/data 10 | ``` 11 | 12 | Download snapshot 13 | ```bash 14 | SNAP_NAME=$(curl -s https://snapshots.c29r3.xyz/stargaze/ | egrep -o ">stargaze.*tar" | tr -d ">"); \ 15 | wget -O - https://snapshots.c29r3.xyz/stargaze/${SNAP_NAME} | tar xf - 16 | ``` 17 | ![alt text](https://github.com/c29r3/cosmos-snapshots/blob/main/2021-01-20_14-19.png?raw=true) 18 | 19 | Start service and check logs 20 | ``` 21 | systemctl start stargaze.service; \ 22 | journalctl -u stargaze.service -f --no-hostname 23 | ``` 24 | -------------------------------------------------------------------------------- /scripts/agoric_snapshot.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | CHAIN_ID="agoric-3" 3 | SNAP_PATH="/root/snapshots/agoric" 4 | LOG_PATH="/root/snapshots/agoric/agoric_log.txt" 5 | DATA_PATH="/root/.agoric/data/" 6 | SERVICE_NAME="agoricd.service" 7 | RPC_ADDRESS="http://localhost:22657" 8 | SNAP_NAME=$(echo "${CHAIN_ID}_$(date '+%Y-%m-%d').tar") 9 | OLD_SNAP=$(ls ${SNAP_PATH} | egrep -o "${CHAIN_ID}.*tar") 10 | 11 | 12 | now_date() { 13 | echo -n $(TZ=":Europe/Moscow" date '+%Y-%m-%d_%H:%M:%S') 14 | } 15 | 16 | 17 | log_this() { 18 | YEL='\033[1;33m' # yellow 19 | NC='\033[0m' # No Color 20 | local logging="$@" 21 | printf "|$(now_date)| $logging\n" | tee -a ${LOG_PATH} 22 | } 23 | 24 | LAST_BLOCK_HEIGHT=$(curl -s ${RPC_ADDRESS}/status | jq -r .result.sync_info.latest_block_height) 25 | log_this "LAST_BLOCK_HEIGHT ${LAST_BLOCK_HEIGHT}" 26 | 27 | log_this "Stopping ${SERVICE_NAME}" 28 | systemctl stop ${SERVICE_NAME}; echo $? >> ${LOG_PATH} 29 | 30 | log_this "Creating new snapshot" 31 | time tar cf ${HOME}/${SNAP_NAME} -C ${DATA_PATH} . &>>${LOG_PATH} 32 | 33 | log_this "Starting ${SERVICE_NAME}" 34 | systemctl start ${SERVICE_NAME}; echo $? >> ${LOG_PATH} 35 | 36 | log_this "Removing old snapshot(s):" 37 | cd ${SNAP_PATH} 38 | rm -fv ${OLD_SNAP} &>>${LOG_PATH} 39 | 40 | log_this "Moving new snapshot to ${SNAP_PATH}" 41 | mv ${HOME}/${CHAIN_ID}*tar ${SNAP_PATH} &>>${LOG_PATH} 42 | 43 | 44 | du -hs ${SNAP_PATH} | tee -a ${LOG_PATH} 45 | 46 | log_this "Done\n---------------------------\n" 47 | -------------------------------------------------------------------------------- /scripts/agoric_statesync.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | SERVICE_NAME="agoricd" 4 | 5 | ### 6 | # agoric statesync cron job 7 | # 0 5 * * 1 /bin/bash -c '/home/user/agoric_statesync.sh' 8 | ### 9 | 10 | SNAP_RPC="https://agoric-rpc.polkachu.com:443" 11 | #SNAP_RPC="http://46.166.143.91:26657" 12 | #SNAP_RPC="http://116.202.114.4:26657" 13 | 14 | LATEST_HEIGHT=$(curl -s $SNAP_RPC/block | jq -r .result.block.header.height); \ 15 | BLOCK_HEIGHT=$((LATEST_HEIGHT - 2000)); \ 16 | TRUST_HASH=$(curl -s "$SNAP_RPC/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash) 17 | 18 | sed -i.bak -E "s|^(enable[[:space:]]+=[[:space:]]+).*$|\1true| ; \ 19 | s|^(rpc_servers[[:space:]]+=[[:space:]]+).*$|\1\"$SNAP_RPC,$SNAP_RPC\"| ; \ 20 | s|^(trust_height[[:space:]]+=[[:space:]]+).*$|\1$BLOCK_HEIGHT| ; \ 21 | s|^(trust_hash[[:space:]]+=[[:space:]]+).*$|\1\"$TRUST_HASH\"|" $HOME/.agoric/config/config.toml 22 | 23 | sudo systemctl stop ${SERVICE_NAME} 24 | 25 | agd tendermint unsafe-reset-all 26 | 27 | echo Restart 28 | sudo systemctl restart ${SERVICE_NAME} 29 | # sudo journalctl -u ${SERVICE_NAME} -f --no-hostname | grep statesync 30 | -------------------------------------------------------------------------------- /scripts/akash_auto_update.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | SERVICE_NAME="akash.service" 4 | BIN_NAME="akash" 5 | BIN_PATH="$HOME/go/bin/" 6 | 7 | 8 | check_for_update(){ 9 | CHECK_UPD=$(sudo journalctl -u ${SERVICE_NAME} --since "30 seconds ago" | egrep "UPGRADE" | head -n 1 | egrep -o "https://.*\.json") 10 | echo $CHECK_UPD 11 | } 12 | 13 | 14 | while true; 15 | do 16 | echo "Checking logs" 17 | RES=$(check_for_update) 18 | if [[ $RES == *"https://"* ]] 19 | then 20 | RES=$(curl -s ${RES} | jq -r '.binaries."linux/amd64"') 21 | echo -e "UPDATE LINK: $RES" 22 | 23 | cd /tmp 24 | wget -q ${RES} 25 | unzip *zip 26 | chmod u+x $BIN_NAME 27 | SHASUM_OLD=$(shasum ${BIN_PATH}${BIN_NAME} | cut -d " " -f1) 28 | SHASUM_NEW=$(shasum ${BIN_NAME} | cut -d " " -f1) 29 | echo -e "OLD: $SHASUM_OLD\nNEW: $SHASUM_NEW" 30 | 31 | if [[ $SHASUM_OLD != $SHASUM_NEW ]] 32 | then 33 | echo "Replacing bin file" 34 | rm -f ${BIN_PATH}${BIN_NAME} 35 | mv ${BIN_NAME} ${BIN_PATH} 36 | echo "Restarting service" 37 | sudo systemctl restart ${SERVICE_NAME} 38 | else 39 | echo "Binary files are same" 40 | rm -f ${BIN_NAME} 41 | sleep 60 42 | fi 43 | rm -f /tmp/${BIN_NAME}*zip* 44 | fi 45 | sleep 10 46 | done 47 | -------------------------------------------------------------------------------- /scripts/akash_snapshot.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | CHAIN_ID="akashnet-2" 3 | SNAP_PATH="$HOME/snapshots/akash" 4 | LOG_PATH="$HOME/snapshots/akash/akash_log.txt" 5 | DATA_PATH="$HOME/.akash/data/" 6 | SERVICE_NAME="akash.service" 7 | RPC_ADDRESS="http://localhost:28957" 8 | SNAP_NAME=$(echo "${CHAIN_ID}_$(date '+%Y-%m-%d').tar") 9 | OLD_SNAP=$(ls ${SNAP_PATH} | egrep -o "${CHAIN_ID}.*tar") 10 | 11 | 12 | now_date() { 13 | echo -n $(TZ=":Europe/Moscow" date '+%Y-%m-%d_%H:%M:%S') 14 | } 15 | 16 | 17 | log_this() { 18 | YEL='\033[1;33m' # yellow 19 | NC='\033[0m' # No Color 20 | local logging="$@" 21 | printf "|$(now_date)| $logging\n" | tee -a ${LOG_PATH} 22 | } 23 | 24 | LAST_BLOCK_HEIGHT=$(curl -s ${RPC_ADDRESS}/status | jq -r .result.sync_info.latest_block_height) 25 | log_this "LAST_BLOCK_HEIGHT ${LAST_BLOCK_HEIGHT}" 26 | 27 | log_this "Stopping ${SERVICE_NAME}" 28 | systemctl stop ${SERVICE_NAME}; echo $? >> ${LOG_PATH} 29 | 30 | log_this "Creating new snapshot" 31 | time tar cf ${HOME}/${SNAP_NAME} -C ${DATA_PATH} . &>>${LOG_PATH} 32 | 33 | log_this "Starting ${SERVICE_NAME}" 34 | systemctl start ${SERVICE_NAME}; echo $? >> ${LOG_PATH} 35 | 36 | log_this "Removing old snapshot(s):" 37 | cd ${SNAP_PATH} 38 | rm -fv ${OLD_SNAP} &>>${LOG_PATH} 39 | 40 | log_this "Moving new snapshot to ${SNAP_PATH}" 41 | mv ${HOME}/${CHAIN_ID}*tar ${SNAP_PATH} &>>${LOG_PATH} 42 | 43 | 44 | du -hs ${SNAP_PATH} | tee -a ${LOG_PATH} 45 | 46 | log_this "Done\n---------------------------\n" 47 | -------------------------------------------------------------------------------- /scripts/akash_statesync.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ### 4 | # https://rpc.akashnet.net:443 5 | # https://rpc.akash.forbole.com:443 6 | # https://rpc-akash.ecostake.com:443 7 | # https://akash-rpc.polkachu.com:443 8 | # https://rpc-akash-ia.notional.ventures:443 9 | # http://node.d3akash.cloud:26657 10 | # http://akash.c29r3.xyz:80/rpc 11 | ### 12 | 13 | ### 14 | # akash statesync cron job 15 | # 0 5 * * 1 /bin/bash -c '/home/user/akash_statesync.sh' 16 | ### 17 | 18 | BINARY_NAME="akash" 19 | SERVICE_FILE_NAME="akash.service" 20 | PROJECT_PATH="$HOME/.akash" 21 | SNAP_RPC="https://akash-rpc.polkachu.com:443" 22 | 23 | sudo systemctl stop ${SERVICE_FILE_NAME} 24 | 25 | LATEST_HEIGHT=$(curl -s $SNAP_RPC/block | jq -r .result.block.header.height); \ 26 | BLOCK_HEIGHT=$((LATEST_HEIGHT - 2000)); \ 27 | TRUST_HASH=$(curl -s "$SNAP_RPC/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash) 28 | 29 | sed -i.bak -E "s|^(enable[[:space:]]+=[[:space:]]+).*$|\1true| ; \ 30 | s|^(rpc_servers[[:space:]]+=[[:space:]]+).*$|\1\"$SNAP_RPC,$SNAP_RPC\"| ; \ 31 | s|^(trust_height[[:space:]]+=[[:space:]]+).*$|\1$BLOCK_HEIGHT| ; \ 32 | s|^(trust_hash[[:space:]]+=[[:space:]]+).*$|\1\"$TRUST_HASH\"|" ${PROJECT_PATH}/config/config.toml 33 | 34 | sudo systemctl stop ${SERVICE_FILE_NAME} 35 | 36 | ${BINARY_NAME} tendermint unsafe-reset-all --home ${PROJECT_PATH} --keep-addr-book 37 | 38 | echo Restart 39 | sudo systemctl restart ${SERVICE_FILE_NAME} 40 | sudo journalctl -u ${SERVICE_FILE_NAME} -f --no-hostname | grep statesync 41 | -------------------------------------------------------------------------------- /scripts/desmos_snapshot.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | CHAIN_ID="desmos-mainnet" 3 | SNAP_PATH="$HOME/snapshots/desmos" 4 | LOG_PATH="$HOME/snapshots/desmos/desmos_log.txt" 5 | DATA_PATH="$HOME/.desmos/data/" 6 | SERVICE_NAME="desmos.service" 7 | RPC_ADDRESS="http://135.181.60.250:26557" 8 | SNAP_NAME=$(echo "${CHAIN_ID}_$(date '+%Y-%m-%d').tar") 9 | OLD_SNAP=$(ls ${SNAP_PATH} | egrep -o "${CHAIN_ID}.*tar") 10 | 11 | 12 | now_date() { 13 | echo -n $(TZ=":Europe/Moscow" date '+%Y-%m-%d_%H:%M:%S') 14 | } 15 | 16 | 17 | log_this() { 18 | YEL='\033[1;33m' # yellow 19 | NC='\033[0m' # No Color 20 | local logging="$@" 21 | printf "|$(now_date)| $logging\n" | tee -a ${LOG_PATH} 22 | } 23 | 24 | LAST_BLOCK_HEIGHT=$(curl -s ${RPC_ADDRESS}/status | jq -r .result.sync_info.latest_block_height) 25 | log_this "LAST_BLOCK_HEIGHT ${LAST_BLOCK_HEIGHT}" 26 | 27 | log_this "Stopping ${SERVICE_NAME}" 28 | systemctl stop ${SERVICE_NAME}; echo $? >> ${LOG_PATH} 29 | 30 | log_this "Creating new snapshot" 31 | time tar cf ${HOME}/${SNAP_NAME} -C ${DATA_PATH} . &>>${LOG_PATH} 32 | 33 | log_this "Starting ${SERVICE_NAME}" 34 | systemctl start ${SERVICE_NAME}; echo $? >> ${LOG_PATH} 35 | 36 | log_this "Removing old snapshot(s):" 37 | cd ${SNAP_PATH} 38 | rm -fv ${OLD_SNAP} &>>${LOG_PATH} 39 | 40 | log_this "Moving new snapshot to ${SNAP_PATH}" 41 | mv ${HOME}/${CHAIN_ID}*tar ${SNAP_PATH} &>>${LOG_PATH} 42 | 43 | 44 | du -hs ${SNAP_PATH} | tee -a ${LOG_PATH} 45 | 46 | log_this "Done\n---------------------------\n" 47 | -------------------------------------------------------------------------------- /scripts/oasis_snapshot.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | CHAIN_ID="oasis-2" 3 | SNAP_PATH="$HOME/snapshots/oasis" 4 | LOG_PATH="$HOME/snapshots/oasis/oasis_log.txt" 5 | DATA_PATH="/home/oasismain/oasis/serverdir/node/tendermint/" 6 | SERVICE_NAME="oasis.service" 7 | #RPC_ADDRESS="http://XXX:36557" 8 | SNAP_NAME=$(echo "${CHAIN_ID}_$(date '+%Y-%m-%d').tar") 9 | OLD_SNAP=$(ls ${SNAP_PATH} | egrep -o "${CHAIN_ID}.*tar") 10 | 11 | 12 | now_date() { 13 | echo -n $(TZ=":Europe/Berlin" date '+%Y-%m-%d_%H:%M:%S') 14 | } 15 | 16 | 17 | log_this() { 18 | YEL='\033[1;33m' # yellow 19 | NC='\033[0m' # No Color 20 | local logging="$@" 21 | printf "|$(now_date)| $logging\n" | tee -a ${LOG_PATH} 22 | } 23 | 24 | #LAST_BLOCK_HEIGHT=$(curl -s ${RPC_ADDRESS}/status | jq -r .result.sync_info.latest_block_height) 25 | #log_this "LAST_BLOCK_HEIGHT ${LAST_BLOCK_HEIGHT}" 26 | 27 | log_this "Stopping ${SERVICE_NAME}" 28 | systemctl stop ${SERVICE_NAME}; echo $? >> ${LOG_PATH} 29 | 30 | log_this "Creating new snapshot" 31 | time tar czf ${HOME}/${SNAP_NAME} -C ${DATA_PATH} --exclude=oasis_priv_validator.json . &>>${LOG_PATH} 32 | 33 | log_this "Starting ${SERVICE_NAME}" 34 | systemctl start ${SERVICE_NAME}; echo $? >> ${LOG_PATH} 35 | 36 | log_this "Removing old snapshot(s):" 37 | cd ${SNAP_PATH} 38 | rm -fv ${OLD_SNAP} &>>${LOG_PATH} 39 | 40 | log_this "Moving new snapshot to ${SNAP_PATH}" 41 | mv ${HOME}/${CHAIN_ID}*tar ${SNAP_PATH} &>>${LOG_PATH} 42 | 43 | du -hs ${SNAP_PATH} | tee -a ${LOG_PATH} 44 | 45 | log_this "Done\n---------------------------\n" 46 | -------------------------------------------------------------------------------- /scripts/osmosis_snapshot.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | CHAIN_ID="osmosis-1" 3 | SNAP_PATH="$HOME/snapshots/osmosis" 4 | LOG_PATH="$HOME/snapshots/osmosis/osmosis_log.txt" 5 | DATA_PATH="$HOME/.osmosisd/data/" 6 | SERVICE_NAME="osmosis.service" 7 | RPC_ADDRESS="http://135.181.60.250:36557" 8 | SNAP_NAME=$(echo "${CHAIN_ID}_$(date '+%Y-%m-%d').tar") 9 | OLD_SNAP=$(ls ${SNAP_PATH} | egrep -o "${CHAIN_ID}.*tar") 10 | 11 | 12 | now_date() { 13 | echo -n $(TZ=":Europe/Moscow" date '+%Y-%m-%d_%H:%M:%S') 14 | } 15 | 16 | 17 | log_this() { 18 | YEL='\033[1;33m' # yellow 19 | NC='\033[0m' # No Color 20 | local logging="$@" 21 | printf "|$(now_date)| $logging\n" | tee -a ${LOG_PATH} 22 | } 23 | 24 | LAST_BLOCK_HEIGHT=$(curl -s ${RPC_ADDRESS}/status | jq -r .result.sync_info.latest_block_height) 25 | log_this "LAST_BLOCK_HEIGHT ${LAST_BLOCK_HEIGHT}" 26 | 27 | log_this "Stopping ${SERVICE_NAME}" 28 | systemctl stop ${SERVICE_NAME}; echo $? >> ${LOG_PATH} 29 | 30 | log_this "Creating new snapshot" 31 | time tar cf ${HOME}/${SNAP_NAME} -C ${DATA_PATH} . &>>${LOG_PATH} 32 | 33 | log_this "Starting ${SERVICE_NAME}" 34 | systemctl start ${SERVICE_NAME}; echo $? >> ${LOG_PATH} 35 | 36 | log_this "Removing old snapshot(s):" 37 | cd ${SNAP_PATH} 38 | rm -fv ${OLD_SNAP} &>>${LOG_PATH} 39 | 40 | log_this "Moving new snapshot to ${SNAP_PATH}" 41 | mv ${HOME}/${CHAIN_ID}*tar ${SNAP_PATH} &>>${LOG_PATH} 42 | 43 | 44 | du -hs ${SNAP_PATH} | tee -a ${LOG_PATH} 45 | 46 | log_this "Done\n---------------------------\n" 47 | -------------------------------------------------------------------------------- /scripts/sentinel_snapshot.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | CHAIN_ID="sentinelhub-2" 3 | SNAP_PATH="$HOME/snapshots/sentinel" 4 | LOG_PATH="$HOME/snapshots/sentinel/sentinel_log.txt" 5 | DATA_PATH="$HOME/.sentinelhub/data/" 6 | SERVICE_NAME="sentinel.service" 7 | RPC_ADDRESS="http://localhost:29657" 8 | SNAP_NAME=$(echo "${CHAIN_ID}_$(date '+%Y-%m-%d').tar") 9 | OLD_SNAP=$(ls ${SNAP_PATH} | egrep -o "${CHAIN_ID}.*tar") 10 | 11 | 12 | now_date() { 13 | echo -n $(TZ=":Europe/Moscow" date '+%Y-%m-%d_%H:%M:%S') 14 | } 15 | 16 | 17 | log_this() { 18 | YEL='\033[1;33m' # yellow 19 | NC='\033[0m' # No Color 20 | local logging="$@" 21 | printf "|$(now_date)| $logging\n" | tee -a ${LOG_PATH} 22 | } 23 | 24 | LAST_BLOCK_HEIGHT=$(curl -s ${RPC_ADDRESS}/status | jq -r .result.sync_info.latest_block_height) 25 | log_this "LAST_BLOCK_HEIGHT ${LAST_BLOCK_HEIGHT}" 26 | 27 | log_this "Stopping ${SERVICE_NAME}" 28 | systemctl stop ${SERVICE_NAME}; echo $? >> ${LOG_PATH} 29 | 30 | log_this "Creating new snapshot" 31 | time tar cf ${HOME}/${SNAP_NAME} -C ${DATA_PATH} . &>>${LOG_PATH} 32 | 33 | log_this "Starting ${SERVICE_NAME}" 34 | systemctl start ${SERVICE_NAME}; echo $? >> ${LOG_PATH} 35 | 36 | log_this "Removing old snapshot(s):" 37 | cd ${SNAP_PATH} 38 | rm -fv ${OLD_SNAP} &>>${LOG_PATH} 39 | 40 | log_this "Moving new snapshot to ${SNAP_PATH}" 41 | mv ${HOME}/${CHAIN_ID}*tar ${SNAP_PATH} &>>${LOG_PATH} 42 | 43 | 44 | du -hs ${SNAP_PATH} | tee -a ${LOG_PATH} 45 | 46 | log_this "Done\n---------------------------\n" 47 | -------------------------------------------------------------------------------- /scripts/sentinel_statesync.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ### 4 | # sentinel statesync cron job 5 | # 0 5 * * 1 /bin/bash -c '/home/user/sentinel_statesync.sh' 6 | ### 7 | 8 | SERVICE_NAME="sentinel" 9 | 10 | sudo systemctl stop ${SERVICE_NAME} 11 | 12 | SNAP_RPC="https://rpc.sentinel.co:443" 13 | 14 | LATEST_HEIGHT=$(curl -s $SNAP_RPC/block | jq -r .result.block.header.height); \ 15 | BLOCK_HEIGHT=$((LATEST_HEIGHT - 2000)); \ 16 | TRUST_HASH=$(curl -s "$SNAP_RPC/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash) 17 | 18 | sed -i.bak -E "s|^(enable[[:space:]]+=[[:space:]]+).*$|\1true| ; \ 19 | s|^(rpc_servers[[:space:]]+=[[:space:]]+).*$|\1\"$SNAP_RPC,$SNAP_RPC\"| ; \ 20 | s|^(trust_height[[:space:]]+=[[:space:]]+).*$|\1$BLOCK_HEIGHT| ; \ 21 | s|^(trust_hash[[:space:]]+=[[:space:]]+).*$|\1\"$TRUST_HASH\"|" $HOME/.sentinelhub/config/config.toml 22 | 23 | sudo systemctl stop ${SERVICE_NAME} 24 | 25 | sentinelhub tendermint unsafe-reset-all --home $HOME/.sentinelhub --keep-addr-book 26 | 27 | echo Restart 28 | sudo systemctl restart ${SERVICE_NAME} 29 | # sudo journalctl -u ${SERVICE_NAME} -f --no-hostname | grep statesync 30 | -------------------------------------------------------------------------------- /scripts/sifchain_snapshot.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | CHAIN_ID="sifchain" 3 | SNAP_PATH="$HOME/snapshots/sifchain" 4 | LOG_PATH="$HOME/snapshots/sifchain/sifchain_log.txt" 5 | DATA_PATH="$HOME/.sifnoded/data/" 6 | SERVICE_NAME="sifchain.service" 7 | RPC_ADDRESS="http://localhost:27657" 8 | SNAP_NAME=$(echo "${CHAIN_ID}_$(date '+%Y-%m-%d').tar") 9 | OLD_SNAP=$(ls ${SNAP_PATH} | egrep -o "${CHAIN_ID}.*tar") 10 | 11 | 12 | now_date() { 13 | echo -n $(TZ=":Europe/Moscow" date '+%Y-%m-%d_%H:%M:%S') 14 | } 15 | 16 | 17 | log_this() { 18 | YEL='\033[1;33m' # yellow 19 | NC='\033[0m' # No Color 20 | local logging="$@" 21 | printf "|$(now_date)| $logging\n" | tee -a ${LOG_PATH} 22 | } 23 | 24 | LAST_BLOCK_HEIGHT=$(curl -s ${RPC_ADDRESS}/status | jq -r .result.sync_info.latest_block_height) 25 | log_this "LAST_BLOCK_HEIGHT ${LAST_BLOCK_HEIGHT}" 26 | 27 | log_this "Stopping ${SERVICE_NAME}" 28 | systemctl stop ${SERVICE_NAME}; echo $? >> ${LOG_PATH} 29 | 30 | log_this "Creating new snapshot" 31 | time tar cf ${HOME}/${SNAP_NAME} -C ${DATA_PATH} . &>>${LOG_PATH} 32 | 33 | log_this "Starting ${SERVICE_NAME}" 34 | systemctl start ${SERVICE_NAME}; echo $? >> ${LOG_PATH} 35 | 36 | log_this "Removing old snapshot(s):" 37 | cd ${SNAP_PATH} 38 | rm -fv ${OLD_SNAP} &>>${LOG_PATH} 39 | 40 | log_this "Moving new snapshot to ${SNAP_PATH}" 41 | mv ${HOME}/${CHAIN_ID}*tar ${SNAP_PATH} &>>${LOG_PATH} 42 | 43 | 44 | du -hs ${SNAP_PATH} | tee -a ${LOG_PATH} 45 | 46 | log_this "Done\n---------------------------\n" 47 | -------------------------------------------------------------------------------- /scripts/snapshot_kichain.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | CHAIN_ID="kichain-2" 3 | SNAP_PATH="$HOME/nginx/cosmos-snapshots/kichain/" 4 | LOG_PATH="$HOME/nginx/cosmos-snapshots/kichain/kichain_log.txt" 5 | DATA_PATH="/srv/ki/kid/data/" 6 | SERVICE_NAME="ki-validator.service" 7 | RPC_ADDRESS="http://127.0.0.1:26657" 8 | SNAP_NAME=$(echo "${CHAIN_ID}_$(date '+%Y-%m-%d').tar") 9 | OLD_SNAP=$(ls ${SNAP_PATH} | egrep -o "${CHAIN_ID}.*tar") 10 | 11 | 12 | now_date() { 13 | echo -n $(date +%F-%H-%M-%S) 14 | } 15 | 16 | log_this() { 17 | local logging="$@" 18 | printf "|$(now_date)| $logging\n" | sudo tee -a ${LOG_PATH} 19 | } 20 | 21 | LAST_BLOCK_HEIGHT=$(curl -s ${RPC_ADDRESS}/status | jq -r .result.sync_info.latest_block_height) 22 | sudo touch ${LOG_PATH} 23 | sudo chmod 777 ${LOG_PATH} 24 | log_this "LAST_BLOCK_HEIGHT ${LAST_BLOCK_HEIGHT}" 25 | 26 | log_this "Stopping ${SERVICE_NAME}" 27 | sudo systemctl stop ${SERVICE_NAME}; echo $? >> ${LOG_PATH} 28 | 29 | log_this "Creating new snapshot" 30 | time sudo tar cf ${HOME}/${SNAP_NAME} -C ${DATA_PATH} . &>>${LOG_PATH} 31 | 32 | log_this "Starting ${SERVICE_NAME}" 33 | sudo systemctl start ${SERVICE_NAME}; echo $? >> ${LOG_PATH} 34 | 35 | log_this "Removing old snapshot(s):" 36 | cd ${SNAP_PATH} 37 | sudo rm -fv ${OLD_SNAP} &>>${LOG_PATH} 38 | 39 | log_this "Moving new snapshot to ${SNAP_PATH}" 40 | sudo mv ${HOME}/${CHAIN_ID}*tar ${SNAP_PATH} &>>${LOG_PATH} 41 | 42 | du -hs ${SNAP_PATH} | sudo tee -a ${LOG_PATH} 43 | 44 | log_this "Done\n---------------------------\n" 45 | -------------------------------------------------------------------------------- /scripts/stargaze_snapshot.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | CHAIN_ID="stargaze-1" 3 | SNAP_PATH="$HOME/snapshots/stargaze" 4 | LOG_PATH="$HOME/snapshots/stargaze/stargaze_log.txt" 5 | DATA_PATH="$HOME/.starsd/data/" 6 | SERVICE_NAME="starsd.service" 7 | RPC_ADDRESS="https://stargaze.c29r3.xyz/rpc" 8 | SNAP_NAME=$(echo "${CHAIN_ID}_$(date '+%Y-%m-%d').tar") 9 | WASM_NAME="stargaze_wasm.tar" 10 | OLD_SNAP=$(ls ${SNAP_PATH} | egrep -o "${CHAIN_ID}.*tar") 11 | OLD_WASM=$(ls ${SNAP_PATH} | egrep -o "wasm.*tar") 12 | 13 | 14 | now_date() { 15 | echo -n $(TZ=":Europe/Moscow" date '+%Y-%m-%d_%H:%M:%S') 16 | } 17 | 18 | 19 | log_this() { 20 | YEL='\033[1;33m' # yellow 21 | NC='\033[0m' # No Color 22 | local logging="$@" 23 | printf "|$(now_date)| $logging\n" | tee -a ${LOG_PATH} 24 | } 25 | 26 | LAST_BLOCK_HEIGHT=$(curl -s ${RPC_ADDRESS}/status | jq -r .result.sync_info.latest_block_height) 27 | log_this "LAST_BLOCK_HEIGHT ${LAST_BLOCK_HEIGHT}" 28 | 29 | log_this "Stopping ${SERVICE_NAME}" 30 | systemctl stop ${SERVICE_NAME}; echo $? >> ${LOG_PATH} 31 | 32 | log_this "Creating new snapshot" 33 | time tar cf ${HOME}/${SNAP_NAME} -C ${DATA_PATH} . &>>${LOG_PATH} 34 | 35 | log_this "Creating new WASM snapshot" 36 | time tar cf ${HOME}/${WASM_NAME} -C $HOME/.starsd/wasm . &>>${LOG_PATH} 37 | 38 | log_this "Starting ${SERVICE_NAME}" 39 | systemctl start ${SERVICE_NAME}; echo $? >> ${LOG_PATH} 40 | 41 | log_this "Removing old snapshot(s):" 42 | cd ${SNAP_PATH} 43 | rm -fv ${OLD_SNAP} &>>${LOG_PATH} 44 | rm -fv ${OLD_WASM} &>>${LOG_PATH} 45 | 46 | log_this "Moving new snapshot to ${SNAP_PATH}" 47 | mv ${HOME}/${CHAIN_ID}*tar ${SNAP_PATH} &>>${LOG_PATH} 48 | mv ${HOME}/${WASM_NAME} ${SNAP_PATH} &>>${LOG_PATH} 49 | 50 | 51 | du -hs ${SNAP_PATH} | tee -a ${LOG_PATH} 52 | 53 | log_this "Done\n---------------------------\n" 54 | --------------------------------------------------------------------------------