ar.io Logoar.io Documentation

The ar-io-node CLI

Release Requirement: the ar-io-node CLI requires gateway Release 85 or later.

ar-io-node is the gateway's command-line tool. Its own commands build and check index bands and fill and check a gateway's L1 index. Any other command runs as the ar.io CLI from @ar.io/sdk.

It runs in the core image. From the gateway's directory (where .env and docker-compose.yaml are), ./tools/ar-io-node runs it in the image named by CORE_IMAGE_TAG, so the host needs only Docker. It mounts only what a command needs.

./tools/ar-io-node --help
./tools/ar-io-node network-help        # the ar.io commands it runs for you

Output

It follows the ar.io CLI's conventions, so a script or an agent can drive it:

  • A command's result is one JSON value on stdout, with exit code 0.
  • An error goes to stderr, with exit code 1 (130 if you interrupt it). A check that fails prints its full result, as JSON, on stderr.
  • Logs go to stderr too, so stdout can always be parsed.

Read stdout and branch on the exit code; don't parse stderr for success. Band commands never prompt and never take a key.

Commands

CommandWhat it does
index-band-buildBuilds one root-TX band from CSV records, checks a sample of its headers against their root transactions, and publishes it for the index-swarm sidecar
index-band-verifyRuns that header check on any built or installed band
index-band-exportWrites one source's root-TX records for a height range as the CSV index-band-build reads. The source is this gateway's ClickHouse or SQLite, a peer's ClickHouse, or an overlay directory of CSV files
index-l1-import --fillFills the gateway's core.db from installed parquet-l1 bands while the gateway runs, writing only the heights missing beneath what it indexed itself. Core runs this by itself with L1_BAND_IMPORT_ENABLED=true
index-l1-importWithout --fill, imports the bands with the gateway stopped. Faster, but only for a new core.db the gateway has never run on
index-l1-verifyChecks an L1 index against what the chain commits to: a gateway's own core.db (--core-db), or a directory of bands with no gateway at all (--bands-dir). Read-only
index-l1-auditChecks the blocks index-l1-verify has to skip, those holding a format-1 transaction with data, by fetching a sample of that data and recomputing each block's tx_root. Read-only
Any other commandRuns as the ar.io CLI of the @ar.io/sdk the gateway carries, with the same arguments, output and exit code. For example, ./tools/ar-io-node get-gateway --address <wallet>

The ar.io commands use the SDK's own network defaults and flags, not your gateway's settings. For one that signs, prefer --wallet-file to --private-key: an inline key is visible in ps and docker inspect.

For how these fit together, see Bootstrap from L1 Bands and Publishable Bands.

Full Reference

Every option, the paths it mounts, and the JSON each command prints are in the ar-io-node CLI reference.

How is this guide?