Docs
v1

Guide

Configure a node

Set up tenraid with command-line options and node.json. API access, browser origins, TenQ memory, disk pressure and logging.

On this page

tenraid reads its settings from three places. A command-line option wins over node.json, which wins over the built-in default.

node.json lives in the data directory, or wherever --config points. The first start writes it there with the default settings and never replaces an existing file. The parser refuses unknown fields. The settings reference lists every field.

JSONnode.json
{
  "rpc_bind": "127.0.0.1:28701",
  "mining_bind": "127.0.0.1:28702",
  "public_p2p": {
    "listen_addrs": ["0.0.0.0:28700"]
  },
  "storage": {
    "disk_pressure": {
      "mode": "enforce",
      "hard_free_bytes": 1073741824,
      "soft_free_bytes": 2684354560,
      "recovery_free_bytes": 5368709120,
      "poll_seconds": 10
    }
  },
  "tenq": { "full_dataset": { "build_threads": 8, "prefetch_heights": 1024 } },
  "log": { "file": "tenraid.log" }
}

Settings in node.json never change the chain or its rules; those come from the genesis manifest.

API

OptionDefaultUse
--rpc-bind127.0.0.1:28701HTTP API and WebSocket events. An IP alone keeps the port
--mining-bind127.0.0.1:28702Work for the miner and the stratum bridge; loopback only
--mine-when-not-syncedoffWork also while the node is not synchronized, for a new chain or a lone test node
--no-api-landing-pagepage onTurns off the overview of routes and limits at /

The rpc section sizes the API's own runtime, so public traffic cannot hold up consensus:

FieldDefaultMeaning
worker_threads2Threads of the API runtime
blocking_threads32Storage reads and the address index
per_ip_requests_per_second1,000Requests per second per client address, 0 is off
per_ip_request_burst2,000Burst for that limit
per_ip_stream_slots32Sockets per client address, 0 is off
max_connections2,048Open connections in total
per_ip_connections256Open connections per client address

The per-address limits sit far above what wallets and explorers send; they only stop a broken or hostile client. A connection that sends no complete request head within 10 seconds is closed. To let others use the node, put a TLS reverse proxy with rate limits in front of it instead of opening its API directly.

Browser access

Web pages cannot use the API until you allow their origin. Programs that are not browsers send no Origin and are not affected.

Shell
tenraid run --browser-origin https://explorer.example

The option repeats and replaces browser_origins from node.json. Other pages get 403. The mining listener never answers web pages.

TenQ

Public networks require one of these:

SettingMemoryUse
--tenq-threads <N> or tenq.full_dataset2 GiB datasetRecommended; required for validators
--tenq-light or "tenq": { "light": true }32 MiB cacheSaves memory at several times the CPU cost

With the dataset, the node builds the next epoch's dataset 1,024 cuts ahead when 2 GiB plus 512 MiB are free. --tenq-prefetch <heights> moves that point; --no-tenq-prefetch builds each dataset only when its epoch starts, and block checks wait for it.

Disk pressure

At soft pressure the storage.disk_pressure guard refuses new transactions and mining work and pauses the address index. At hard pressure the node also stops writing cuts, until free space is back above the soft threshold. It returns to normal once free space is above the recovery threshold. At every level it keeps serving its history to peers, since that only reads.

The disk pressure guard with the example thresholds. As free space falls, soft pressure starts at 2.5 GiB and hard pressure at 1 GiB. As it rises again, the node writes cuts again from 2.5 GiB and works normally again from 5 GiB. Soft pressure stops new transactions, mining work and indexing; hard pressure also stops new cuts. FREE DISK SPACE · EXAMPLE THRESHOLDS hard 1 GiB soft 2.5 GiB recovery 5 GiB hard hard or soft normal if it was, else soft normal 0 more free space falling: soft pressure from 2.5 GiB, hard pressure from 1 GiB rising: cuts again from 2.5 GiB, everything normal again from 5 GiB Soft: no new transactions, mining work or indexing. Hard: no new cuts either.
The thresholds work with a margin, so the node does not flip between states.

Public networks require the guard in enforce mode; the node refuses to start without it. Only the development network runs without one.

FieldExampleMeaning
hard_free_bytes1 GiBBelow this much free space the node writes no new cuts
soft_free_bytes2.5 GiBBelow this the node takes no new transactions and no mining work, and the address index pauses
recovery_free_bytes5 GiBAbove this the node returns to normal
poll_seconds10How often the free space is checked

Measure the thresholds for your volume and leave room for RocksDB and the operating system. They must satisfy hard < soft < recovery; poll_seconds is 1 to 300. "mode": "observe" only reports the state.

Logging

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

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

Type to search guides, concepts and reference pages.