Deployment

This guide covers deploying the XChain Platform from scratch, from a single-chain regtest setup to a full multi-chain mainnet installation.


Prerequisites

Software

  • Docker: Engine 20.10 or later. Docker must be accessible to the current user (add user to docker group or run as root).
  • Node.js: 22 (22.x LTS) exactly, required to run the xchain-node CLI. Node 18 and earlier fail on the ESM-only mariadb driver (ERR_REQUIRE_ESM); Node 24 fails the Node ABI 127 consensus-runtime pin in the xchain-vm the indexer and explorer pull in.
  • Git: to clone xchain-node.

Verify Docker is working before proceeding:

docker info

Disk Space

Blockchain data can be substantial. Budget accordingly before starting a mainnet sync:

Chain Approx. blockchain size (mainnet, as of 2026)
Bitcoin (BTC) ~700 GB
Litecoin (LTC) ~100 GB
Dogecoin (DOGE) ~100 GB

Add headroom for the indexer and decoder databases. A full BTC + LTC + DOGE mainnet deployment should have at least 1.5 TB of free disk space. For regtest, a few gigabytes is sufficient.

Network Ports

Each service exposes a JSON-RPC port. Make sure these are not blocked by firewall rules on the host if external access is needed. Default ports differ per coin and network. See Configuration for a full port listing.


Installing xchain-node

xchain-node is the CLI tool that installs, starts, stops, and monitors all other services as Docker containers.

git clone https://github.com/XChain-Platform/xchain-node
cd xchain-node
npm install

Optionally install the xchain-node symlink globally:

# Follow the steps in INSTALL.md inside the xchain-node directory

After installation, verify the CLI is working:

xchain-node --help
# or if installed globally:
xchain-node --help

Running the Installer

The install command clones the target service from GitHub, builds its Docker image, and registers it with the hub. The all keyword installs every service for a given chain and network in the correct dependency order.

xchain-node install all bitcoin mainnet

Arguments: install [ref] [service] [chain] [network]

  • ref: what to install. Omit it for the latest published release: that resolves the release manifest and pins every component to the exact commit that was tagged, signed and tested together, which is the only form that gives you a reproducible stack. A release tag such as v0.15.2 installs that release instead. A branch name (master, develop) is also accepted and installs whatever that branch happens to point at right now, which is for development, not for running a node. Later, xchain-node update all moves the node (CLI included) to the newest release; see Upgrading.
  • service: all, or a specific service name such as xchain-decoder.
  • chain: bitcoin, litecoin, dogecoin, or all.
  • network: mainnet, testnet, or regtest.

The installer automatically ensures xchain-hub is installed first, since other services depend on it for configuration.


Starting Services

Start all services for a chain:

xchain-node start all bitcoin mainnet

Start a single service:

xchain-node start xchain-decoder bitcoin mainnet

Check running container status:

xchain-node ps

Deployment Configurations

Full Multi-Chain Mainnet (BTC + LTC + DOGE)

A full mainnet deployment runs one coin node, decoder, indexer, encoder, and UTXO tracker per chain, plus one shared hub, explorer, and MariaDB instance.

Install each chain in sequence:

xchain-node install all bitcoin mainnet
xchain-node install all litecoin mainnet
xchain-node install all dogecoin mainnet

Minimum recommended resources for the full three-chain stack:

Resource Recommendation
CPU 8+ cores
RAM 32 GB
Disk 2 TB+ NVMe SSD
Network 100 Mbps sustained (during initial sync)

Single-Chain Deployment

If only one chain is needed, install only that chain:

xchain-node install all litecoin mainnet

This reduces resource requirements proportionally. A single-chain LTC or DOGE deployment can run comfortably on a 4-core, 8 GB RAM machine with 250 GB of disk.

Memory on a multi-chain host

The utxo-tracker is the service that decides how much memory a chain costs. It sizes three allocations from the memory it may use: a LevelDB block cache (a quarter of its budget), a heap-flush threshold (an eighth) and, during the initial bulk sync, an external-sort budget (half). Inside a container that budget is the container’s memory limit when one is set, and the whole host when none is.

xchain-node sets that limit for every tracker it creates: half the host RAM, divided by the number of trackers installed on the host, floored at 1024 MB and ceilinged at 16384 MB. On a 16 GB host running three chains each tracker gets 2730 MB, which derives a 682 MB cache, a 341 MB heap-flush threshold and a 1365 MB bulk-sync budget; the other half of the host is left for the chain daemons (a synced bitcoind alone holds 3 to 4 GB), MariaDB, the decoders, the indexers, the hub and the explorer.

Three things follow from the formula:

  • The limit is computed when the container is created. Adding a chain to a host does not shrink the trackers that already exist; run xchain-node recreate xchain-utxo-tracker all all after installing a new chain so every tracker is re-sized for the new count.
  • A host that cannot afford the floor is told. When half the host divided by the tracker count falls under 1024 MB, each tracker still gets 1024 MB and install prints a warning that the host is oversubscribed; run fewer chains there.
  • Only the tracker is limited by default. The decoder, indexer and hub do not size themselves to a cgroup limit, so a limit on them turns a transient spike (a large mempool batch, a deep reorg) into an OOM kill and a restart loop. Cap one explicitly with XCHAIN_NODE_MODULE_MEMORY_MB_<SERVICE> only after measuring it.

Confirm the limit landed. A kernel without the memory cgroup controller does not refuse --memory. Docker takes the flag, prints WARNING: Your kernel does not support memory limit capabilities or the cgroup is not mounted. Limitation discarded., exits successfully, and creates the container with no limit at all. Two reads say whether that happened. Ask Docker what the container got:

docker inspect -f '{{.HostConfig.Memory}}' xchain-node-dogecoin-mainnet-xchain-utxo-tracker

A non-zero byte count is the limit in force; 0 means the tracker is running on the whole host. The tracker’s own boot line agrees: docker logs on it prints memory budget NNNNMB (cgroup limit) when a limit binds, and (host memory) when none does. xchain-node performs this check itself after every create and warns when the limit did not stick, but the two commands above confirm it at any time.

Raspberry Pi OS ships with the memory cgroup controller off, which is the usual cause. Append cgroup_enable=memory cgroup_memory=1 to the single line in /boot/firmware/cmdline.txt, reboot, then run xchain-node recreate xchain-utxo-tracker all all so every tracker is created again with its limit. On a Raspberry Pi 5 the disable comes from the firmware, which injects cgroup_disable=memory ahead of whatever cmdline.txt holds: the file never carries it, so there is nothing to remove, and after the fix cat /proc/cmdline still shows cgroup_disable=memory followed by your appended parameters. That is the working state, not a failed one: the kernel takes the last setting on the line, so the appended enable wins. Judge the fix by docker inspect returning a non-zero limit and the tracker’s boot line reading (cgroup limit), never by grepping the kernel command line for the disable. On any other host, run docker info and look for No memory limit support among its warnings.

The limit is what leaves the host its page cache. On a four-chain Pi 5 the same tracker’s heap-flush threshold went from 2027 MB, sized against the whole host, to 256 MB under a 2 GB cap, and host memory available went from 3793 MB to 7669 MB with nothing else changed. The section below is why that page cache matters.

To override the derivation for a tracker, either set the container limit (XCHAIN_NODE_MODULE_MEMORY_MB_XCHAIN_UTXO_TRACKER=4096 before recreate; the tracker re-derives its slices from the new limit) or set the slices themselves in the tracker’s environment (LEVELDB_CACHE_BYTES, HEAP_FLUSH_THRESHOLD_MB, BULK_SYNC_RAM_BUDGET), documented on the utxo-tracker configuration page. Setting a slice larger than the container limit allows is the one combination to avoid: the kernel enforces the limit, not the tracker.

Disk I/O on a multi-chain host

On a host with a single disk, every chain’s coin node, decoder, indexer, encoder and UTXO tracker read and write that same disk, and it is often the first resource to saturate, not CPU or RAM. The mechanism is the page cache, not an idle writer. A synced chain’s services are quiet at idle: measured over fourteen minutes on a four-chain host, their block I/O counters did not move and iowait sat at 0.3, with the tracker parsing the mempool every minute. What the tracker does on every mempool pass is read index blocks from its LevelDB store, and on a mainnet Bitcoin tracker that store is around 92,000 table files (176 GiB at the 2 MB default file size) while LevelDB keeps index blocks resident for only its default 1,000 open files. Every other lookup goes to the page cache, and while the page cache holds them the passes cost no disk reads at all. When another process evicts the page cache, which a coin node in initial block download with a large dbcache does, every mempool pass re-reads those index blocks off the device at its full bandwidth (41.8 GB in five minutes on one Pi 5), and that is what starves the second chain’s initial block download.

Measure the effect without stopping anything by sampling each container’s block I/O twice, five minutes apart:

docker stats --no-stream --format '{{.Name}}\t{{.BlockIO}}'

The container whose BlockIO grew the most between the two samples is the current reader or writer. A synced chain’s tracker whose BlockIO grows by gigabytes while idle is not busy; it has lost its page cache and is re-reading its index from the disk, which is the signature to look for.

On a single-disk host, prefer these in order:

  • Cap the trackers so the host keeps its page cache. The memory limit in the section above is what stops a tracker from sizing its own caches against the whole host; with the limit in force the page cache survives and the idle re-reads stop. Confirm the limit landed before going further down this list.
  • Sync one chain at a time. Install and let each chain finish its initial block download before installing the next, so no initial block download evicts a synced tracker’s index while it runs.
  • Only if the cap and the ordering are not enough, stop the synced chain’s services for the other chain’s initial block download, then start them again once it catches up:
xchain-node stop all bitcoin mainnet
# ... let dogecoin finish its initial block download ...
xchain-node start all bitcoin mainnet

See Stopping for the stop and start forms, the per-service stop timeouts, and why stopping a coin daemon from inside its container does not work.

Regtest Deployment (Development / Testing)

Regtest uses local blockchain simulation with no real network sync. This is the fastest way to bring up a fully working stack for development or testing.

xchain-node install all bitcoin regtest
xchain-node start all bitcoin regtest

Regtest also installs xchain-regtest-miner, which automatically mines blocks when transactions appear in the mempool.

To skip bootstrap archive downloads and force a full parse from block 0:

xchain-node --no-bootstrap install all bitcoin regtest

Private Deployment (Regtest as Production)

Some operators run a private XChain instance on a permissioned regtest network. The setup is identical to a standard regtest deployment. Control block production via the regtest-miner or by calling generatetoaddress directly on the coin node.


Initial Sync

After starting a mainnet coin node for the first time, it must download and verify the entire blockchain. This can take anywhere from several hours (LTC, DOGE) to multiple days (BTC) depending on disk I/O speed and network bandwidth.

The decoder and the UTXO tracker follow the coin node’s tip. While the node reports initialblockdownload: true with its tip below the height a service already holds, the service waits instead of treating the lower tip as a reorg, and xchain-node ps shows it as WAITING FOR NODE with the two heights under the table. You can watch the wait and the node’s progress in the service logs:

xchain-node logs xchain-decoder bitcoin mainnet

The service logs when it resumes after the node passes it.

The wait only starts once the node has answered. A node mid-sync on slow hardware can time out every RPC call for days first, and from outside that looks the same: a healthy, idle container. The container healthcheck deliberately stays green (a restart cannot fix an outage upstream of the service), so ps reads the service’s own health surface and shows NODE UNREACHABLE with how long it has been since the node last answered, or that it never has, and the service’s health payload carries node_last_ok_at and node_unreachable. If you see it, check that the coin node container is running and answering RPC, and read its logs; the service needs no restart.

Bootstrap Archives (Optional)

On a fresh install, xchain-node downloads the published bootstrap archive for each of the decoder, the indexer and the UTXO tracker and restores it, so the service starts at the archive’s height instead of parsing from its start block. The same restore can be run by hand:

xchain-node bootstrap restore xchain-utxo-tracker bitcoin mainnet

Use --no-bootstrap on install to skip this entirely and do a full parse.

A bootstrap assumes a coin node at or past the archive’s height. On a mainnet host whose node is still syncing from zero, a restored service sits thousands of blocks above the node for hours or days. Each archive carries the height it ends at, and the install compares it with the node’s tip before restoring:

  • the node is at or past the archive: restored, nothing to do;
  • the node is below the archive, still in initial block download, and the service waits that out (decoder and tracker from v0.16.0, and the indexer, which follows the decoder and is restored whatever the node reports): restored, reported as WAITING FOR NODE in the install summary and in ps, and the service continues on its own once the node passes the archive height;
  • the node is below the archive and the decoder or tracker would read its lower tip as a reorg, either because the service image predates that wait or because the node is not in initial block download (the services wait only then): the restore is refused and the service parses forward from its start block as the node catches up. The summary says so. To take the restore later, wait for the node to pass the archive height and re-run install with XCHAIN_NODE_FORCE_BOOTSTRAP=1, or install with --no-bootstrap to stop it trying;
  • the archive carries no height (published before the member existed) or the node cannot be asked yet: restored as before, with a note saying the comparison was not possible.

XCHAIN_NODE_SKIP_NODE_TIP_GUARD=1 skips the comparison; it is warned loudly, like the other skip gates.

Two orderings avoid the wait entirely on a slow host: let the coin node finish its initial sync before installing the services, or install with --no-bootstrap and let the services parse forward behind the node.

Bootstrap signatures

Each published bootstrap archive can carry a detached Ed25519 signature (<archive>.sig). When the consumer machine has the publisher’s public key pinned (src/config/bootstrap_signing_pubkey.pem in the xchain-node checkout, or a path in XCHAIN_NODE_BOOTSTRAP_PUBKEY), the signature is verified before any restore; the checksum embedded inside the archive only detects transport corruption, while the signature proves the archive is the one the publisher built.

Signature enforcement is on by default (fail-closed): a restore is refused when the public key or .sig is missing, or when the signature does not verify. On a fresh install’s automatic restore the refusal is caught and the node syncs from scratch rather than restoring an unverified archive; a manual bootstrap restore aborts. To opt out, e.g. for a self-hosted source that publishes no signatures, set XCHAIN_NODE_REQUIRE_SIGNED_BOOTSTRAP=0 (also accepts false/no).

Publishers: generate a keypair once:

openssl genpkey -algorithm ed25519 -out bootstrap_signing_key.pem
openssl pkey -in bootstrap_signing_key.pem -pubout -out bootstrap_signing_pubkey.pem

Keep the private key on the publishing host(s) only (back it up offline; it is the trust root for every consumer’s restore), commit the public half as src/config/bootstrap_signing_pubkey.pem, and set XCHAIN_NODE_BOOTSTRAP_SIGNING_KEY=/path/to/bootstrap_signing_key.pem so bootstrap create writes a .sig beside each archive. Always upload the .sig together with its archive; a missing or mismatched signature makes every consumer refuse the restore.

To automate creation + signing + upload + retention, use scripts/publish-bootstraps.sh. It wraps bootstrap create for every served combo, signs inline, transfers each archive + .sig to the bootstrap host, and prunes to the newest few. It is cron-safe (single-instance flock) and makes the downtime-bearing UTXO-tracker creates opt-in (a tracker create stops its container for the snapshot):

# decoder + indexer only: online dump, no downtime (good for a weekly cron):
scripts/publish-bootstraps.sh --all
# include the UTXO trackers: stops each tracker for the snapshot, so schedule a window:
scripts/publish-bootstraps.sh --all --with-trackers

Verifying the Pipeline

Once all services are running, verify data is flowing through the pipeline:

1. Coin node is synced: Check decoder logs for active block processing (block numbers should be incrementing).

2. Decoder is writing to its database:

xchain-node exec xchain-decoder bitcoin mainnet \
  "mysql -u root XChain_BTC_Mainnet_Decoder -e 'SELECT MAX(block_index) FROM blocks;'"

3. Indexer is processing decoder output: The indexer block height should be close to (or equal to) the decoder block height. Check indexer logs:

xchain-node logs xchain-indexer bitcoin mainnet

4. Explorer is serving data: Hit the explorer’s HTTP endpoint. By default the explorer runs on port 18080:

curl http://localhost:18080/btc/api/ping

Log Locations

Logs are written to Docker container stdout/stderr. Access them via xchain-node:

xchain-node logs xchain-decoder bitcoin mainnet      # full logs
xchain-node tail xchain-decoder bitcoin mainnet      # follow (tail -f)
xchain-node monitor                                  # multi-pane live monitor (all services)
xchain-node tailmonitor                              # tail + monitor combined

Direct Docker access:

docker logs xchain-node-bitcoin-mainnet-xchain-decoder
docker logs -f xchain-node-bitcoin-mainnet-xchain-decoder

Stopping and Restarting Services

Stop all services for a chain:

xchain-node stop all bitcoin mainnet

Stop a single service:

xchain-node stop xchain-indexer bitcoin mainnet

Restart a service:

xchain-node restart xchain-decoder bitcoin mainnet

Restarting a service does not affect its database. The decoder and indexer resume from where they left off.


Upgrading a Deployed Fleet

On a single machine managed by one xchain-node install, xchain-node update all updates everything in the correct order; see Upgrading. If you split services across multiple hosts, follow the strict hub-before-indexer ordering with a single-chain canary and a post-deploy smoke pass described in Upgrading: Multi-Host Fleets before updating any multi-service release.


Copyright © 2025–2026 Dankest, LLC

Based on XChain Platform by Dankest, LLC – https://dankest.llc

Licensed under the GNU Affero General Public License v3.0 (AGPL-3.0-or-later) with a commercial license available for proprietary use.

You may use, modify, and distribute this material under the terms of the License. See LICENSE and NOTICE for full terms. See the licensing overview.

Edit this page on GitHub ↗