Docs
v1

Reference

tenraid command line

Every tenraid command and option with its default. Network and data, API, P2P, storage, TenQ, validator and logging.

On this page
Shell
tenraid [command] [options]

Without a command tenraid starts the node, as tenraid run does; the options of run follow either form. A command-line option overrides node.json, which overrides the default.

Commands

CommandWhat it does
runStarts the node. Also what tenraid does without a command
initCreates the chain database from the genesis manifest and prints the head
inspectPrints the finalized head
genesisPrints the chain ID, genesis ID and parameter hash of the genesis manifest
verify-storeOpens the database, checks it against the manifest and prints the head
reset-db --yesDeletes the chain database. Node identity and peer book stay
reset-peers --yesForgets every learned peer. Configured peers stay
reset-identity --yesDeletes the node identity; the next start creates a new one. Validator overlay keys stay
validator-endpoint [--route <HOST[:PORT]>]Prints the endpoint bytes for a validator registration. A host stands for TCP and QUIC on the overlay port; up to four routes, none when the port is closed
prepare-genesis-validator-signerFor a validator of a new chain's genesis: prepares its local signer journal. Only valid before the first finalized cut

Network and data

Every command takes these.

OptionDefaultMeaning
--network <NAME>mainnetmainnet, testnet, testnet100 or development. Mainnet and development have a built-in manifest
--manifest <FILE>built inGenesis manifest. It also sets the network
--data-dir <DIR>%LOCALAPPDATA%\Tenrai\<network>, elsewhere ~/.tenrai/<network>Chain database, node identity, peer book and node.json

run

OptionDefaultMeaning
-c, --config <FILE>node.json in the data directorySettings file. The default one is created on the first start
--reset-dbDeletes the chain database before starting

API

OptionDefaultMeaning
--rpc-bind <IP[:PORT]>127.0.0.1:28701HTTP API and WebSocket events
--mining-bind <IP[:PORT]>127.0.0.1:28702Mining control for the miner and the stratum bridge. Loopback only
--mine-when-not-syncedoffHands out mining work while the node is not synchronized, for a new chain or a lone test node; same as "mine_when_not_synced": true
--browser-origin <ORIGIN>no web pagesAdmits a web page to the API and its sockets. Repeatable; replaces browser_origins
--no-api-landing-pagepage onNo overview page of routes and limits at /
--metrics-bind <IP[:PORT]>offPrometheus metrics at /metrics on a listener of their own, port 28790 unless given

The ports shown are those of mainnet; a testnet node uses 28706 and 28707, a development node 28711 and 28712.

P2P

OptionDefaultMeaning
--listen <IP[:PORT]>0.0.0.0:28700, testnet 28705, development 28710Listens on QUIC and TCP. Repeatable
--peer <HOST[:PORT]>built-in peers on mainnetPeer to connect to: an IP or host name, on the network's P2P port unless one is given. IDENTITY@MULTIADDR accepts only that node. Repeatable
--sync-peer <HOST[:PORT]>Peer the node prefers to sync from, written like --peer; other peers take over when it fails
--relay-peer <IDENTITY@MULTIADDR>Peer that relays for nodes behind NAT. Repeatable
--max-inbound <N>24, bootstrap 64Inbound peers, at most the default
--max-outbound <N>8, bootstrap 16Outbound peers, at most the default
--connections-per-ip <N>8Connections from one network: an IPv4 /24 or an IPv6 /64
--relay-fanout <N>6Peers each new block and transaction is pushed to
--quic-congestion-control <cubic|bbr>cubicCongestion control on QUIC connections, the validator overlay's included
--p2p-role <ROLE>standardbootstrap accepts more connections and needs no peer of its own
--upnpoffAsks the router to forward the P2P port, and on a validator the overlay port
--no-relay-serviceRelays for no validator, even when other nodes reach this node

A public network runs its P2P without any of these options. The development network starts it only with --listen, --peer, --sync-peer or public_p2p in node.json. Networking and peers shows the peer forms.

Storage

OptionDefaultMeaning
--storage-mode <MODE>fullfull, archive or pruned, see Storage
--prune-days <1-100>2Days of block bodies a pruned node keeps
--peer-snapshot-bootstrapoffStarts a fresh pruned mainnet node from the checkpoint built into the release and its pinned peers, instead of syncing from genesis
--peer-snapshot-replace-existingoffWith --peer-snapshot-bootstrap: replaces an existing older database once the snapshot is verified. The old data is kept aside

A validator, or a node that sends automatic heartbeats, needs every block body since genesis: full or archive on a database synced from genesis. Resync a pruned or snapshot-started database before enabling either.

TenQ

OptionDefaultMeaning
--tenq-threads <N>from node.jsonBuilds the 2 GiB TenQ dataset with N threads. Public networks need the dataset or --tenq-light; the node.json of the first start sets it
--tenq-lightoffChecks blocks from the 32 MiB cache. Several times slower; not for validators
--tenq-prefetch <HEIGHTS>1024Cuts before an epoch at which its dataset is built ahead; 0 turns it off
--no-tenq-prefetchoffBuilds each dataset only when its epoch starts; block checks wait for it

Validator

OptionMeaning
--validator-key-file <FILE>Encrypted ML-DSA validator key. The validator overlay then listens on port 28704, testnet 28709, development 28714
--validator-key-password-file <FILE>Password of that key
--dev-validatorDevelopment only: finalizes a cut every 2.5 s with the built-in key

The automatic heartbeat has no command-line option. It is set in the validator section of node.json, together with the key, see Run a validator.

Logging

Every command takes these.

OptionMeaning
-d, --debugDetail for developers
--log-file <FILE>Also appends the log to a file
--no-colorPlain console output

The environment variable RUST_LOG replaces both levels, for example RUST_LOG=warn,tenrai_node::p2p=debug.

Type to search guides, concepts and reference pages.