State sync lets a node bootstrap from a recent application snapshot instead of replaying every block from genesis. Use deploy.sh state-sync for normal c8ntinuum installs; the hosted script and peer-list source are listed in Deployment Scripts. The script resolves trusted RPC endpoints and snapshot peers, patches the node config, resets local chain data, starts the node, waits for catch-up, then disables state sync again.
State sync wipes the local data/ directory. Back up anything you need before confirming the reset.
Prerequisites
- Managed install and node home created by
deploy.sh install --moniker <moniker>
curl, jq, and sed
- Network access to trusted CometBFT RPC endpoints and P2P snapshot peers
Default homes:
| OS | Node home | Process model |
|---|
| Linux | /var/lib/ctmd | ctmd.service managed by systemd |
| macOS | $HOME/.ctmd | deploy.sh start background process with PID/log files |
Quick start
Linux:
sudo ./deploy.sh install --moniker <your-node-moniker>
sudo ./deploy.sh state-sync
macOS:
./deploy.sh install --moniker <your-node-moniker>
./deploy.sh state-sync
The default flow targets mainnet:
| Item | Value |
|---|
| Chain ID | continuum_2184-1 |
| Genesis URL | https://resources.c8ntinuum.io/mainnet/genesis.json |
| Genesis SHA-256 | 939cd10fe450f6826894f0d76e82ed5e90845d5f60aaae92f577cf50b83bb474 |
| Peers URL | https://resources.c8ntinuum.io/peers.json |
| Trust-height lag | 2000 blocks |
| Trust period | 168h0m0s |
| P2P port | 26656 |
Testnet
Install the node with the testnet chain ID first. deploy.sh state-sync reads the chain ID from the initialized home, so the chain selection happens during install, not as a state-sync flag. The peers file is shared across networks and selected by the installed chain ID.
Linux:
sudo env CTMD_GENESIS_URL=https://resources.c8ntinuum.io/testnet/genesis.json \
./deploy.sh install --moniker <your-node-moniker> --chain-id continuum_2185-1
macOS:
CTMD_GENESIS_URL=https://resources.c8ntinuum.io/testnet/genesis.json \
./deploy.sh install --moniker <your-node-moniker> --chain-id continuum_2185-1
Use the same genesis URL override when running state sync:
Linux:
sudo env CTMD_GENESIS_URL=https://resources.c8ntinuum.io/testnet/genesis.json \
./deploy.sh state-sync
macOS:
CTMD_GENESIS_URL=https://resources.c8ntinuum.io/testnet/genesis.json \
./deploy.sh state-sync
Custom endpoints
deploy.sh state-sync reads RPCs and snapshot peers from https://resources.c8ntinuum.io/peers.json, selected by chain ID. Override individual endpoints when you need private infrastructure:
sudo ./deploy.sh state-sync \
--rpc-1 https://<trusted-rpc-1> \
--rpc-2 https://<trusted-rpc-2> \
--p2p-host-1 <snapshot-peer-1> \
--p2p-host-2 <snapshot-peer-2>
Options:
| Flag | Default | Purpose |
|---|
--lag N | 2000 | Blocks behind latest height for the trust point. |
-y, --yes | none | Auto-confirm apply, reset, and start prompts. |
--rpc-1 URL | first RPC in peers.json | Override trusted RPC 1. |
--rpc-2 URL | second RPC in peers.json | Override trusted RPC 2. |
--p2p-host-1 HOST | first peer host in peers.json | Override snapshot peer host 1. |
--p2p-host-2 HOST | second peer host in peers.json | Override snapshot peer host 2. |
The trust period is fixed at 168h0m0s, and snapshot peer addresses use P2P port 26656.
What the script does
- Detects the host OS and node home.
- Verifies required commands and the initialized node home.
- Reads the installed chain ID from
client.toml and resolves trusted RPCs and P2P snapshot peers.
- Stops the Linux service, or checks for a running local process on macOS.
- Downloads and verifies
genesis.json.
- Repairs chain ID settings in
app.toml, client.toml, and config.toml.
- Fetches the latest height from RPC 1 and computes
trust_height = latest_height - lag.
- Fetches the
trust_hash at the trust height.
- Patches
[statesync], [mempool], and [p2p].
- Resets local data with
unsafe-reset-all --keep-addr-book.
- Starts the node and waits until catch-up completes or the node reaches the trusted RPC tip.
- Sets
[statesync].enable = false.
- Restarts the service on Linux or starts the managed background node on macOS.
Trust verification
Before confirming the run, verify the printed Trust Height and Trust Hash against an independent source. The script uses RPC 1 to compute the trust point, so an explorer or third RPC gives you a better safety check.
| Network | Explorer |
|---|
| Mainnet | https://ctmscan.io |
| Testnet | https://testnet.ctmscan.io |
Look up the block at the printed trust height and compare its block hash to the printed trust hash. The comparison is case-insensitive. If the hashes do not match, do not continue.
Config written
deploy.sh state-sync writes these fields in config.toml:
| Field | Section | Value |
|---|
enable | [statesync] | true during sync, then false after catch-up. |
rpc_servers | [statesync] | <rpc-1>,<rpc-2> |
trust_height | [statesync] | Latest height minus lag. |
trust_hash | [statesync] | Block hash at the trust height. |
trust_period | [statesync] | Fixed script default 168h0m0s. |
seeds | [p2p] | Seeds from peers.json, if present. |
persistent_peers | [p2p] | Snapshot peers discovered from the trusted RPCs. |
max_packet_msg_payload_size | [p2p] | 10240 |
Nodes that should provide snapshots to the network need snapshots enabled in app.toml:
[state-sync]
snapshot-interval = 5000
snapshot-keep-recent = 2
Logs and artifacts
| Path | OS | Purpose |
|---|
sudo journalctl -u ctmd.service | Linux | Sync and runtime logs. |
$HOME/.ctmd/state_sync.log | macOS | State sync catch-up log. |
$HOME/.ctmd/node.log | macOS | Post-sync node log. |
Check local sync status:
curl -s http://127.0.0.1:26657/status | jq .result.sync_info
Troubleshooting
| Issue | Fix |
|---|
| RPC height or block hash cannot be fetched | Confirm the RPC responds to /status and /block?height=<height>. |
| No peers were discovered | Confirm the RPC /status response includes result.node_info.id. |
| No snapshots found | Confirm the snapshot peers are reachable on P2P port 26656; if needed, rerun with --lag 5000. |
| Local node is past the trust height | Skip state sync and let normal block sync continue, or choose an older trust point with a larger lag. |