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).
Why each era needs its own release
No single release can replay the whole chain. A later release stops withBINARY 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: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, thenfull-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. Nohalt-heightorhalt-timeis set inapp.toml, and[statesync] enable = trueis not set inconfig.toml. - The upgrade map is valid, and it agrees with x/upgrade at the first trusted RPC from
peers.jsonthat answers, including any upgrade the chain has scheduled. When no trusted RPC answers,full-syncwarns that the map is not checked against the chain and goes on. - Every release downloads, matches its
.sha256and 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-validatoris 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 statusshows a line such asFull sync: from block 1 (started ...): ctmd 0.2.3, era 1 of 2; next: .... - Once the node is synced,
full-syncremoves 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: runsudo ./deploy.sh upgradefor 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 upgradethen switches it. Before the height,upgraderefuses on macOS. full-syncnever switches to a newerlatest_version; runsudo ./deploy.sh upgradefor that. Right after a full sync there is no/opt/ctmd.previous, soupgrade --rollbackhas nothing to go back to.sudo ./deploy.sh full-sync --cancelremoves the plan and the watcher. The node keeps running its release and halts at the next chain upgrade, wheresudo ./deploy.sh upgradeswitches it.- If the node halts at a chain upgrade that the plan does not list,
full-syncexits 3. The data so far is good: once the upgrade is in the map, runsudo ./deploy.sh full-sync --cancel, thensudo ./deploy.sh upgrade. - While a full sync is in progress,
install,state-sync,snapshot restore,adoptand every form ofupgraderefuse.start,stop,status,logsandrpcwork.