StakeAngle Services
  • StakeAngle Services
  • MAINNETS
    • Agoric
      • ⚒️Installation
      • 💡State Sync
      • 💻Useful Commands
      • ⚙️RPC / API / gRPC
      • 🛰️IBC relayers
    • Althea
      • ⚒️Installation
      • 💡State Sync
      • ⚙️RPC / API / gRPC
      • 💻Useful Commands
    • AssetMantle
      • ⚒️Installation
      • 💡State Sync
      • 💻Useful Commands
      • ⚙️RPC / API / gRPC
      • 🛰️IBC relayers
    • Aura Network
      • ⚒️Installation
      • 💡State Sync
      • 💻Useful Commands
      • ⚙️RPC / API / gRPC
    • Chain4Energy
      • ⚒️Installation
      • 💻Useful Commands
    • Desmos
      • ⚒️Installation
      • 💡State Sync
      • 💻Useful Commands
      • ⚙️RPC / API / gRPC
    • FirmaChain
      • ⚒️Installation
      • 💡State Sync
      • 💻Useful Commands
      • ⚙️RPC / API / gRPC
    • Gitopia
      • ⚒️Installation
      • 💡State Sync
      • 💻Useful Commands
      • ⚙️RPC / API / gRPC
    • Gravity Bridge
      • ⚒️Installation
      • 💡State Sync
      • 💻Useful Commands
      • ⚙️RPC / API / gRPC
      • 🛰️IBC relayers
    • Humans
      • ⚒️Installation
      • 💡State Sync
      • 💻Useful Commands
      • ⚙️RPC / API / gRPC
      • 🛰️IBC relayers
    • LikeCoin
      • ⚒️Installation
      • 💡State Sync
      • 💻Useful Commands
      • ⚙️RPC / API / gRPC
      • 🛰️IBC relayers
    • OmniFlix
      • ⚒️Installation
      • 💡State Sync
      • 💻Useful Commands
      • ⚙️RPC / API / gRPC
      • 🛰️IBC relayers
    • Provenance
      • ⚒️Installation
      • 💻Useful Commands
    • Source Protocol
      • ⚒️Installation
      • 💡State Sync
      • 💻Useful Commands
      • ⚙️RPC / API / gRPC
    • Pylons
      • ⚒️Installation
      • 💡State Sync
      • 💻Useful Commands
      • ⚙️RPC / API / gRPC
    • Stargaze
      • ⚒️Installation
      • 💡State Sync
      • 💻Useful Commands
      • ⚙️RPC / API / gRPC
      • 🛰️IBC relayers
    • Uptick
      • ⚒️Installation
      • 💻Useful Commands
    • UX Chain
      • ⚒️Installation
      • 💡State Sync
      • 💻Useful Commands
      • ⚙️RPC / API / gRPC
      • 🛰️IBC relayers
  • Testnets
    • Althea
      • ⚒️Installation
      • 💻Useful Commands
    • Hypersign
      • ⚒️Installation
      • 💻Useful Commands
Powered by GitBook
On this page
  1. MAINNETS
  2. Chain4Energy

State Sync

State Sync allows to sync a new node by fetching a snapshot of the network state at a recent height, instead of fetching and replaying all historical blocks.

Some networks which use wasm may not yet support wasm folder transfers with State Sync. In this case you may need to download wasm folder separately.

Depending on network, State Sync may need different amount of RAM to successfully fish sync process. It is recommended to have at least 8GB RAM.

  1. Stop existing service and reset database.

sudo systemctl stop c4ed
c4ed unsafe-reset-all --home $HOME/.c4e-chain
  1. Add peers.

PEER="1b802d4616c1de3fa687ad0d671b1b9d64754a44@88.198.49.217:26156,3d75b4da612395d69ef58a0f6dbb851bd98c1962@185.144.99.246:26656,a9bdcae2527c4a27a6f4882e852329241a945699@46.4.81.204:30656,2f6141859c28c088514b46f7783509aeeb87553f@141.94.193.12:11656,bf78d9bd64cf7e83357966aa3b4ca19d996ef1ef@51.75.55.49:26656,e84d7bff6960e7b50ee8eba09ef6f25b0b0b30cc@95.214.53.105:56656,717c041cf112f778508033e99a16288ec9d034c8@95.217.35.186:60756,cff10605b619e5119a1c9d53397a798de8fbf83b@64.227.136.63:26656,770fc199534d3126ff336b93aaf643a80e12761a@185.169.252.22:26656,c37c30000caf21391e77a457f7721685e41bea42@195.3.223.221:26656,d4c6f17b49af7f96c587613cbdb6e41b179079c2@185.208.206.217:26656"
sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$PEER\"/" $HOME/.c4e-chain/config/config.toml
  1. Fill variables with data for State Sync.

RPC="https://chain4energy-rpc.stakeangle.com:443"
RECENT_HEIGHT=$(curl -s $RPC/block | jq -r .result.block.header.height)
TRUST_HEIGHT=$((RECENT_HEIGHT - 1000))
TRUST_HASH=$(curl -s "$RPC/block?height=$TRUST_HEIGHT" | jq -r .result.block_id.hash)

echo $RECENT_HEIGHT $TRUST_HEIGHT $TRUST_HASH
  1. Add variable values to config.toml.

sed -i.bak -E "s|^(enable[[:space:]]+=[[:space:]]+).*$|\1true| ; \
s|^(rpc_servers[[:space:]]+=[[:space:]]+).*$|\1\"$RPC,$RPC\"| ; \
s|^(trust_height[[:space:]]+=[[:space:]]+).*$|\1$TRUST_HEIGHT| ; \
s|^(trust_hash[[:space:]]+=[[:space:]]+).*$|\1\"$TRUST_HASH\"|" $HOME/.c4e-chain/config/config.toml
  1. Start service and check journal.

sudo systemctl restart c4ed
sudo journalctl -u c4ed -f -o cat

State Sync typically takes up to 10 minutes.

Last updated 20 days ago

💡