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.
{
"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
| Option | Default | Use |
|---|---|---|
--rpc-bind | 127.0.0.1:28701 | HTTP API and WebSocket events. An IP alone keeps the port |
--mining-bind | 127.0.0.1:28702 | Work for the miner and the stratum bridge; loopback only |
--mine-when-not-synced | off | Work also while the node is not synchronized, for a new chain or a lone test node |
--no-api-landing-page | page on | Turns off the overview of routes and limits at / |
The rpc section sizes the API's own runtime, so public traffic cannot hold up consensus:
| Field | Default | Meaning |
|---|---|---|
worker_threads | 2 | Threads of the API runtime |
blocking_threads | 32 | Storage reads and the address index |
per_ip_requests_per_second | 1,000 | Requests per second per client address, 0 is off |
per_ip_request_burst | 2,000 | Burst for that limit |
per_ip_stream_slots | 32 | Sockets per client address, 0 is off |
max_connections | 2,048 | Open connections in total |
per_ip_connections | 256 | Open 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.
tenraid run --browser-origin https://explorer.exampleThe 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:
| Setting | Memory | Use |
|---|---|---|
--tenq-threads <N> or tenq.full_dataset | 2 GiB dataset | Recommended; required for validators |
--tenq-light or "tenq": { "light": true } | 32 MiB cache | Saves 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.
Public networks require the guard in enforce mode; the node refuses to start without it. Only the development network runs without one.
| Field | Example | Meaning |
|---|---|---|
hard_free_bytes | 1 GiB | Below this much free space the node writes no new cuts |
soft_free_bytes | 2.5 GiB | Below this the node takes no new transactions and no mining work, and the address index pauses |
recovery_free_bytes | 5 GiB | Above this the node returns to normal |
poll_seconds | 10 | How 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
| Option | Use |
|---|---|
-d, --debug | Detail for developers |
--log-file <FILE> | Also append the log to a file |
--no-color | Plain console output |
RUST_LOG replaces both levels, for example RUST_LOG=warn,tenrai_node::p2p=debug.
