Guide
Run a node
Start a Tenrai node on a public network step by step. Requirements, peers, node.json, the first start and how to check that it keeps up.
On this page
tenraid is the Tenrai full node. It downloads and checks every cut, keeps the chain in a RocksDB database, relays blocks and transactions to its peers and serves the HTTP API and WebSocket events that wallets, miners and explorers use.
Requirements
| System | Linux, macOS or Windows, x86_64 or ARM64 |
|---|---|
| CPU | Several cores. The node checks every block with TenQ |
| Memory | 2 GiB for the TenQ dataset, 2.5 GiB more to build the next one ahead, plus the database cache |
| Storage | An SSD with room to grow. The disk guard in step 3 stops the node below 1 GiB free |
| Network | Port 28700, TCP and UDP, open for peers. A testnet node uses 28705 |
1. Install
Build tenraid as described in Install.
2. Peers
On mainnet the node connects to the built-in peers by itself. A testnet has none built in; take the address of a node to connect to from a source you trust, such as the official Tenrai channels, and pass it with --peer.
| Network | Manifest | Peers |
|---|---|---|
| Mainnet | Built in | Built in |
| Testnet | --manifest <file> | --peer <IP or host> |
3. node.json
The first start writes node.json with the default settings into the data directory, %LOCALAPPDATA%\Tenrai\<network> on Windows and ~/.tenrai/<network> elsewhere. An existing file is never replaced. On a public network it holds the disk guard, which the node needs in enforce mode, and the TenQ dataset:
{
"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 } }
}| Setting | |
|---|---|
hard_free_bytes | Below 1 GiB free, the node writes no new cuts |
soft_free_bytes | Below 2.5 GiB free, the node takes no new transactions and no mining work |
recovery_free_bytes | From 5 GiB free on, the node works normally again |
build_threads | CPU threads that build the TenQ dataset |
Configure a node explains every section.
4. Start
tenraidNothing else is needed on mainnet: the network, the data directory, the ports and the peers have defaults. tenraid alone is the same as tenraid run, and options follow either form, such as tenraid --peer 198.51.100.7.
The first start creates the database and the node's identity, builds the TenQ dataset and starts to sync. It logs two values you may need later:
| Log value | Give it to |
|---|---|
The node's own --peer value | Operators who want to connect to you |
node identity | Wallets that pin your node |
More peers go into --peer or public_p2p.bootstrap_peers in node.json, see Networking and peers.
5. Check that it keeps up
Every 10 seconds the node logs its height, new cuts and blocks, waiting transactions and peers. While it catches up, the line adds progress in percent and the time left.
curl http://127.0.0.1:28701/v1/node/sync{"api_version":1,"synced":true,"finalized_height":19660,"best_peer_height":19660,"behind_by":0,"peers":8}Use it
| Who | Connects to |
|---|---|
| Wallets and scripts on this machine | The API at http://127.0.0.1:28701 |
tenrai-miner, tenrai-stratum-bridge, pools | The mining listener at http://127.0.0.1:28702 |
| Prometheus | --metrics-bind, see Logs and monitoring |
The API listens on 127.0.0.1 only. Do not open it to the internet directly; put a TLS reverse proxy with rate limits in front if others need it. Web pages need an explicit --browser-origin, see Configure a node.
Without the memory for the dataset
--tenq-light checks blocks from a 32 MiB cache instead of the 2 GiB dataset. That takes several times more CPU, and a node with few threads may fall behind. Validators cannot use it.
