Skip to content

Node Synchronization Methods

The XOS Testnet offers multiple synchronization techniques for initializing and operating the xosd binary. These approaches provide node operators flexibility to select the most appropriate method based on setup time requirements, hardware capabilities, and historical data needs. Below, we explain the primary synchronization strategies with detailed implementation instructions.

Complete Blockchain Replay

This method initializes your xosd node by replaying the entire blockchain history from the genesis block. While this approach provides comprehensive historical data, it requires significant time as every block and transaction must be downloaded and verified.

  1. Prepare the Environment: Confirm that you have correctly installed and configured the appropriate version of the xosd binary on your system. Check the Networks reference to download the correct binary version and consult the Installation Guide for complete setup instructions.

  2. Launch the Node:

bash
xosd start

Accelerated State Synchronization

State Sync provides a rapid bootstrapping mechanism for new nodes. Instead of processing each block sequentially, this method directly imports larger segments of application state. For technical details, refer to CometBFT's State Sync documentation.

  1. Obtain Recent Blockchain Anchor Points:

    • Access a blockchain explorer to identify a recent block height and its corresponding hash.
    • Select any height/hash within the current bonding period. For optimal performance, choose a height approximately current height - 1000 to match the snapshot creation interval.
  2. Modify Node Configuration:

    • Update the ~/.xosd/config/config.toml file with the following parameters:
      [statesync]
      enable = true
      rpc_servers = "<rpc_servers>"
      trust_height = <trust_height>
      trust_hash = "<trust_hash>"
      trust_period = "168h0m0s"
    • Configure rpc_servers with reliable provider addresses. A minimum of two servers must be specified, though using the same server twice is technically acceptable.
  3. Initiate Synchronization:

    • Execute the following command to begin the state sync process:
      bash
      xosd start
    • Be patient during synchronization as the node retrieves and applies state snapshots. Typical log entries will resemble:
      > INF Discovered new snapshot format=1 hash="0x000..." height=8967000 module=statesync
      > INF Fetching snapshot chunk chunk=4 format=1 height=8967000 module=statesync total=45
      > INF Applied snapshot chunk to ABCI app chunk=0 format=1 height=8967000 module=statesync total=45
  4. Confirm Successful Synchronization:

    • After state sync completion, the node transitions to normal block processing. If synchronization encounters issues with errors like state sync aborted, attempt restarting xosd or consider using xosd unsafe-reset-all as a last resort (always backup your configuration and data before executing this command).