Cosmos Services

Home Cosmos Services
by BN140
RPC https://cosmos-rpc.tienthuattoan.ventures
APIhttps://cosmos-api.tienthuattoan.ventures
Snapshothttps://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="https://cosmos-rpc.tienthuattoan.ventures:443"

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="d4c025becf7902a8ab8769c29f9a27d297bd6efd@cosmos-rpc.tienthuattoan.ventures: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 https://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.