Joining Network Using State Sync

State sync offers the quickest way to join SEDA network.

The state sync feature allows a new peer to join the network by asking for a snapshot from existing peers. SEDA provides the following RPC nodes to support this feature. Use these addresses in Step 3:

Network
RPC1
RPC2

seda-1 (mainnet)

13.40.140.211:26657

https://rpc.seda.xyz

seda-1-testnet (testnet)

18.171.235.206:26657

https://rpc.testnet.seda.xyz

Steps:

  1. Check the version history and download the correct binary version from the SEDA Chain repository.

  2. Initialize your node for mainnet or testnet:

    sedad join <moniker> --network mainnet
  3. Run the following commands to enable state sync and add trusted information to the configuration file config.toml.

    RPC="https://rpc.seda.xyz" # For testnet, use https://rpc.testnet.seda.xyz
    
    LATEST_HEIGHT=$(curl -s $RPC/block | jq -r .result.block.header.height); \
    BLOCK_HEIGHT=$((LATEST_HEIGHT - 2000)); \
    TRUST_HASH=$(curl -s "$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\"$RPC,$RPC\"| ; \
    s|^(trust_height[[:space:]]+=[[:space:]]+).*$|\1$BLOCK_HEIGHT| ; \
    s|^(trust_hash[[:space:]]+=[[:space:]]+).*$|\1\"$TRUST_HASH\"|" $HOME/.sedad/config/config.toml
    1. To complete this step manually, fill out the following fields in config.toml with the information obtained from a trusted source. We recommend using the block height around 2,000 blocks before the latest block height.

      [statesync]
      enable = true
      rpc_servers = "https://rpc.seda.xyz,13.40.140.211:26657"
      
      trust_height = 653231
      trust_hash = "B77528F6A290FCFBF25F730C6D490DE0DA7587EC6B2612AA2547773499CFB47E"
      trust_period = "168h0m0s"
  4. (Optional) Sometimes a recent snapshot may not be available in the peer-to-peer network, making it difficult to verify its header. SEDA runs a node that broadcasts snapshots taken every 100 blocks to the network. To ensure that a request for snapshots is sent to this node, add the following address to the persistent_peers field in config.toml. For mainnet:

    persistent_peers = "[email protected]:26656"

    For testnet:

    persistent_peers = "[email protected]:26656"
  5. You may have to disable SEDA signer to start the node. If you are a validator, please read SEDA Keys to set up SEDA signer after you finish the current instructions.

    sedad config set app seda.enable-seda-signer false
  6. Start the node.

    sedad start

Last updated

Was this helpful?