deploy.sh full-sync syncs a node that has no chain data yet from block 1, through every chain upgrade (x/upgrade), and switches the ctmd release at each one. Use it for a new node that should replay the chain itself, where no data snapshot fits or none should be trusted. For a node that needs only recent blocks, State Sync is quicker. For the full history on Linux, restoring a data snapshot is quicker too (see Archive Data Setup).
A full sync takes weeks on mainnet and needs peers that keep every block. It runs only on a network whose upgrade map is published: mainnet, not testnet yet.

Why each era needs its own release

No single release can replay the whole chain. A later release stops with BINARY UPDATED BEFORE TRIGGER below an upgrade it knows, and an earlier one halts at the next upgrade’s height. So full-sync runs each stretch of history with the release that ran it, as listed in the upgrade map in https://resources.c8ntinuum.io/metadata.json: Both mainnet releases are published for linux-amd64, linux-arm64 and darwin-arm64.

Quick start

Linux:
macOS:
macOS does not include tmux: install it first (brew install tmux), or use screen. On macOS, run every command on this page without sudo: deploy.sh refuses root there. The files this page places under /opt live under the install prefix there (PREFIX: the node home, $HOME/.ctmd, unless --prefix DIR). On Linux, Ctrl-C (exit 130) or a lost session ends only the wait: the node keeps syncing and the watcher keeps switching it. On macOS, it also ends the switches (see below). Either way, run full-sync again to follow the sync and finish it.

How the release is switched

On Linux, full-sync writes its plan to /opt/.ctmd-full-sync and turns on the chain-upgrade watcher (ctmd-chain-upgrade.path and ctmd-chain-upgrade.timer). At each upgrade’s halt, the watcher stops the node, points /opt/ctmd at that upgrade’s release, and starts the node again. This works whether or not full-sync is running, and across reboots. macOS has no watcher, so full-sync makes the same switches itself, and only while it runs. Keep it running in tmux. If it stops, the node halts at the next chain upgrade until full-sync runs again. For a node halted there, run full-sync, not start.

Before anything changes

full-sync checks the node, the map and every release before it changes anything. When a check fails, it stops with ERROR: ... and exit 1, and nothing has changed. Among the checks:
  • The node is stopped and data/ holds no chain data. To start over: sudo ./deploy.sh stop, sudo ./deploy.sh reset, sudo ./deploy.sh install, then full-sync.
  • No release is armed for a chain upgrade, and no upgrade or snapshot command was left unfinished.
  • Block sync is on in config.toml. No halt-height or halt-time is set in app.toml, and [statesync] enable = true is not set in config.toml.
  • The upgrade map is valid, and it agrees with x/upgrade at the first trusted RPC from peers.json that answers, including any upgrade the chain has scheduled. When no trusted RPC answers, full-sync warns that the map is not checked against the chain and goes on.
  • Every release downloads, matches its .sha256 and checksum lists, runs on this host, and reports its version. Each one knows the upgrade that starts its stretch and not the next one.
  • The node’s key has voting power 0, or --allow-validator is passed (only when this node is to be that validator and the key runs nowhere else). When no trusted RPC answers, it warns and goes on.
  • /opt (macOS: PREFIX/releases) keeps at least 1 GB free with every release unpacked.

Options

Following, finishing, and cancelling

  • While the sync runs, sudo ./deploy.sh status shows a line such as Full sync: from block 1 (started ...): ctmd 0.2.3, era 1 of 2; next: ....
  • Once the node is synced, full-sync removes the plan and prints ==> Full sync complete: ctmd 0.2.4 runs from /opt/ctmd-0.2.4. On Linux it also removes the watcher, unless the plan lists a chain upgrade ahead of the network: that release then stays armed and the watcher stays. A scheduled chain upgrade added to the map after the full sync began is not armed: run sudo ./deploy.sh upgrade for it once the sync is done. macOS arms nothing: for a chain upgrade ahead of the network, the node halts at it, and ./deploy.sh upgrade then switches it. Before the height, upgrade refuses on macOS.
  • full-sync never switches to a newer latest_version; run sudo ./deploy.sh upgrade for that. Right after a full sync there is no /opt/ctmd.previous, so upgrade --rollback has nothing to go back to.
  • sudo ./deploy.sh full-sync --cancel removes the plan and the watcher. The node keeps running its release and halts at the next chain upgrade, where sudo ./deploy.sh upgrade switches it.
  • If the node halts at a chain upgrade that the plan does not list, full-sync exits 3. The data so far is good: once the upgrade is in the map, run sudo ./deploy.sh full-sync --cancel, then sudo ./deploy.sh upgrade.
  • While a full sync is in progress, install, state-sync, snapshot restore, adopt and every form of upgrade refuse. start, stop, status, logs and rpc work.

Exit codes