Cosmos Services

Home Cosmos Services
by BN140
RPC http://cosmos-rpc.tienthuattoan.ventures:26657
Snapshothttp://cosmos-snapshot.tienthuattoan.ventures/cosmos/

STATE SYNC SERVICE

wget https://github.com/cosmos/mainnet/raw/master/genesis/genesis.cosmoshub-4.json.gz
gzip -d genesis.cosmoshub-4.json.gz
mv genesis.cosmoshub-4.json $HOME/.gaia/config/genesis.json

#Set minimum gas price & peers
sed -i'' 's/minimum-gas-prices = ""/minimum-gas-prices = "0.0025uatom"/' $HOME/.gaia/config/app.toml

# Update pruning to save disk space
sed -i 's/pruning = "default"/pruning = "custom"/g' \
$HOME/.gaia/config/app.toml

sed -i 's/pruning-keep-recent = "0"/pruning-keep-recent = "100"/g' \
$HOME/.gaia/config/app.toml

sed -i 's/pruning-interval = "0"/pruning-interval = "10"/g' \
$HOME/.gaia/config/app.toml

# Disable indexing, if you don't need query transactions
sed -i 's/indexer = "kv"/indexer = "null"/g' \
$HOME/.gaia/config/config.toml

SNAP_RPC="http://cosmos-rpc.tienthuattoan.ventures:26657"

LATEST_HEIGHT=$(curl -s $SNAP_RPC/block | jq -r .result.block.header.height); \
BLOCK_HEIGHT=$((LATEST_HEIGHT - 2000)); \
TRUST_HASH=$(curl -s "$SNAP_RPC/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash)

sed -i.bak -E "s|^(enable[[:space:]]+=[[:space:]]+).*$|\1true| ; \
s|^(rpc_servers[[:space:]]+=[[:space:]]+).*$|\1\"$SNAP_RPC,$SNAP_RPC\"| ; \
s|^(trust_height[[:space:]]+=[[:space:]]+).*$|\1$BLOCK_HEIGHT| ; \
s|^(trust_hash[[:space:]]+=[[:space:]]+).*$|\1\"$TRUST_HASH\"| ; \
s|^(seeds[[:space:]]+=[[:space:]]+).*$|\1\"\"|" $HOME/.gaia/config/config.toml

#Add our RPC as a persistent peer
peers="[email protected]:26656" \
&& sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$peers\"/" $HOME/.gaia/config/config.toml 

sudo systemctl restart gaiad.service && sudo journalctl -u gaiad.service -f -o cat

SNAPSHOT SERVICE

sudo systemctl stop gaiad.service
gaiad unsafe-reset-all

cd "${HOME}"/.gaiad/data
snapshot=$(echo "cosmoshub-4_$(TZ=GMT date +'%Y-%m-%d').tar")
wget -O cosmos.tar http://cosmos-snapshot.tienthuattoan.ventures/cosmos/"${snapshot}"
tar xvf cosmos.tar
sudo systemctl restart gaiad.service && sudo journalctl -u gaiad.service -f -o cat

rm  cosmos.tar

Or direct download link.