LogoLogo
REStakeMeet the teamBlock ExplorerHire Us
  • 🤐WhisperNode Public Guides
  • ⚛️Nodes -- Mainnet
    • Archway
      • Full Node Build
      • Setup Cosmovisor
      • Archway Resources
    • Chihuahua
      • Full Node Build
      • Setup Cosmovisor
      • Chihuahua Resources
    • AssetMantle
      • Full Node Build
      • Setup Cosmovisor
      • CLI Cheatsheet
    • Aura Network
      • Full Node Build
      • Setup Cosmovisor
      • Aura Network Resources
    • Axelar
      • Full Node Build
      • Setup Cosmovisor
      • Axelar Resources
    • Cheqd
      • Full Node Build
      • Setup Cosmovisor
      • Cheqd Resources
    • Comdex
      • Full Node Build
      • Setup Cosmovisor
      • Comdex Resources
    • Composable Finance
      • Full node build
      • Setup Cosmovisor
      • Composable Resources
    • CosmosHub
      • ICS-Provider -- [CosmosHub]
        • Full Node Build
        • Cosmovisor
      • ICS-Consumers
        • Neutron - Build a Node
      • Cosmos Resources
    • Dymension
      • Full Node Build
      • Setup Cosmovisor
      • Dymension Resources
    • Saga
      • Full Node Build
      • Setup Cosmovisor
      • Saga Resources
    • Empower
      • Full node build
      • Setup Cosmovisor
      • CLI Cheatsheet
      • Empower Resources
    • Gitopia
      • Full Node Build
      • Setup Cosmovisor
      • Gitopia Resources
    • Injective
      • Injective Resources
    • Juno
      • Full Node Build
      • Setup Cosmovisor
      • Juno Resources
    • Kujira
      • Full Node Build
      • Setup Cosmovisor
      • Oracle Price Feeder
      • Kujira Resources
    • Celestia
      • Full Node Build
      • Setup Cosmovisor
      • Celestia Resources
    • Migaloo
      • Full Node Build
      • Setup Cosmovisor
      • Migaloo Resources
    • Osmosis
      • Full Node Build
      • Setup Cosmovisor
      • Osmosis Resources
    • Passage
      • Full Node Build
      • Setup Cosmovisor
      • Passage Resources
    • Quasar Fi
      • Full node build
      • Setup Cosmovisor
      • Quasar Resources
    • Secret Network
      • Full Node Build
      • Setup Cosmovisor
      • Secret: State Sync
      • Secret Network Resources
    • Stargaze
      • Full node build
      • Setup Cosmovisor
      • Stargaze Resources
    • Stratos
      • Full Node Build
      • Setup Cosmovisor
      • Stratos Resources
  • 🧪Nodes -- Testnet
    • Archway - Constantine-3
      • Full Node Build
      • Setup Cosmovisor
      • Archway Resources
    • Babylon
      • Full Node Build
      • Setup Cosmovisor
      • Babylon Resources
    • Composable Finance - Banksy2
      • Full node build
      • Setup Cosmovisor
      • Composable Banksy2 Resources
    • Composable Finance - Banksy3
      • Full node build
      • Setup Cosmovisor
      • Composable Banksy3 Resources
    • Cooperative Denom
      • Full node build
      • Setup Cosmovisor
      • Cooperative Denom Resources
    • Cosmos
      • Full Node Build
      • Setup Cosmovisor
      • Cosmos Testnet Resources
    • Duality
      • Full Node Build
      • Setup Cosmovisor
      • Duality Testnet Resources
    • Dymension - Froopyland
      • Full node build
      • Setup Cosmovisor
      • CLI Cheatsheet
      • Dymension Resources
    • Seda
      • Full node build
      • Setup Cosmovisor
      • Seda Resources
    • Union | Testnet
      • Full node build
      • CLI Cheatsheet
      • Union Resources
    • Mantra Chain
      • Full node build
      • Setup Cosmovisor
      • CLI Cheatsheet
      • Mantra Chain Resources
    • dYdX Testnet
      • Full node build
      • Setup Cosmovisor
      • CLI Cheatsheet
      • Dymension Resources
    • Empower
      • Full node build
      • Setup Cosmovisor
      • CLI Cheatsheet
      • Empower Resources
    • Namada
      • Full node build
      • CLI Cheatsheet
      • Namada Resources
      • Tenderduty Setup
      • TMKMS Setup
      • Horcrux Setup
    • Penumbra
      • Full node build
      • CLI Cheatsheet
      • Namada Resources
      • Tenderduty Setup
      • TMKMS Setup
      • Horcrux Setup
    • BeraChain
      • Full node build
      • Setup Cosmovisor
      • Berachain Resources
      • CLI Cheatsheet
      • TMKMS Setup
      • Horcrux Setup
    • Neutron
      • Full Node Build
      • Setup Cosmovisor
      • Neutron Testnet Resources
    • Stride
      • Full Node Build
      • Setup Cosmovisor
      • Stride Testnet Resources
  • Reference
    • Team Validator Info
    • Chain Port Prefixes
Powered by GitBook
LogoLogo

Made with ❤️ by WhisperNode // © 2024.

On this page
  • State-Sync
  • Mainnet State Sync
  • Assign And Verify Variables
  • Set Variables In ~/.secretd/config/config.toml
  • Reset Database And Stop Node
  • Set IAVL-disable-fastnode
  • Increase Swap Space
  • Restart Node And Check Logs

Was this helpful?

Edit on GitHub
Export as PDF
  1. Nodes -- Mainnet
  2. Secret Network

Secret: State Sync

State-sync is a module built into the Cosmos SDK to allow validators to rapidly join the network by syncing your node with a snapshot enabled RPC from a trusted block height.

PreviousSetup CosmovisorNextSecret Network Resources

Last updated 1 year ago

Was this helpful?

Official Docs:


State-Sync

State-sync is a module built into the Cosmos SDK to allow validators to rapidly join the network by syncing your node with a snapshot enabled RPC from a trusted block height.

This greatly reduces the time required for a validator or sentry to sync with the network from days to minutes. The limitations of this are that there is not a full transaction history, just the most recent state that the state-sync RPC has stored. An advantage of state-sync is that the database is very small in comparison to a fully synced node, therefore using state-sync to re-sync your node to the network can help keep running costs lower by minimizing storage usage.

By syncing to the network with state-sync, a node can avoid having to go through all the upgrade procedures and can sync with the most recent binary only.

NOTE: For nodes that are intended to serve data for dapps, explorers, or any other RPC requiring full history, state-syncing to the network would not be appropriate.

Mainnet State Sync

Lavender.Five Nodes and SecretNFT are operating and maintaining the snapshot RPCs.

The state-sync configuration is as follows:

# snapshot-interval specifies the block interval at which local state sync snapshots are
# taken (0 to disable). Must be a multiple of pruning-keep-every.
snapshot-interval = 2000

# snapshot-keep-recent specifies the number of recent snapshots to keep and serve (0 to keep all).
snapshot-keep-recent = 3

Assign And Verify Variables

SNAP_RPC="https://rpc.secret.express:443"

Set the state-sync BLOCK_HEIGHT and fetch the TRUST_HASH from the snapshot RPC. The BLOCK_HEIGHT to sync is determined by finding the latest block that's a multiple of snapshot-interval.

BLOCK_HEIGHT=$(curl -s $SNAP_RPC/block | jq -r .result.block.header.height | awk '{print $1 - ($1 % 6000)}')
TRUST_HASH=$(curl -s "$SNAP_RPC/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash)

echo $BLOCK_HEIGHT $TRUST_HASH

# output should be similar to:
# 3506000 FCB54D74A4A33F8C1CC18A7240D76D87CB192A89C17837C4DB6C6140612DDFEB74A4A33F8C1CC18A7240D76D87CB192A89C17837C4DB6C6140612DDFEB

Set Variables In ~/.secretd/config/config.toml

sed -i.bak -E "s|^(enable[[:space:]]+=[[:space:]]+).*$|\1true|
s|^(rpc_servers[[:space:]]+=[[:space:]]+).*$|\1\"https://rpc.cosmos.directory:443/secretnetwork,https://rpc.secret.express:443\"|
s|^(trust_height[[:space:]]+=[[:space:]]+).*$|\1$BLOCK_HEIGHT|
s|^(trust_hash[[:space:]]+=[[:space:]]+).*$|\1\"$TRUST_HASH\"|" $HOME/.secretd/config/config.toml

Reset Database And Stop Node

⚠️ This will erase your node database. If you are already running validator, be sure you backed up your `config/priv_validator_key.json` and `config/node_key.json` prior to running `unsafe-reset-all`.

It is recommended to copy data/priv_validator_state.json to a backup and restore it after unsafe-reset-all to avoid potential double signing.

sudo systemctl stop cosmovisor && secretd tendermint unsafe-reset-all --home ~/.secretd/ --keep-addr-book

Set IAVL-disable-fastnode

IAVL fast node must be disabled, otherwise the daemon will attempt to upgrade the database while state sync is occuring.

sed -i.bak -e "s/^iavl-disable-fastnode *=.*/iavl-disable-fastnode = true/" ~/.secretd/config/app.toml

Increase Swap Space

sudo umount -l /tmp 
sudo mount -t tmpfs -o size=8G,mode=1777 overflow /tmp

Restart Node And Check Logs

sudo systemctl restart cosmovisor && journalctl -fu cosmovisor

This documentation assumes you have followed the instructions for .

This generally takes several minutes to complete, but has been known to take up to 24 hours. To better help the process along, add .

⚛️
Running a Full Node
seeds
LogoState-SyncSecret Network