Reference
Miner options
Every option of tenrai-miner with its default and what it is for. Connection, devices, GPU backends, TenQ mode, statistics, config file and HiveOS.
On this page
tenrai-miner --help prints the same list. Every option has a default except your address: tenrai-miner -a <address> mines solo on this machine's node with every GPU and two CPU threads, and shows its dashboard on http://127.0.0.1:28770/.
Connection
| Option | Default | What it does |
|---|---|---|
-a, --mining-address <ADDR> | asked for | Your payout address. Also read from TENRAI_MINING_ADDRESS. Started without one, the miner asks for it and offers to save it in tenrai-miner.json; where nobody can answer, it stops and says what to pass |
--stratum <URL,...> | Mines on a pool or bridge: a host, HOST:PORT or a URL from the table below. Several are tried in order; the next one takes over when one fails | |
-w, --worker <NAME> | host name | Name of this rig on the pool. Letters, digits, ., _, -, at most 32 |
-p, --password <TEXT> | empty | Pool or bridge password. d=<n> or <password>,d=<n> asks for a fixed share difficulty. Also read from TENRAI_STRATUM_PASSWORD |
--pool | off | Accepts work that pays the pool's address. Required for pools; without it the miner only mines work that pays -a |
--tls-ca <FILE> | Extra certificate to trust for stratum+tls:// and stratum2+tls://, for a server with a self-signed one | |
--retry-delay <S> | 5 | Seconds to wait after every URL in the list failed |
-s, --node <HOST[:PORT]> | 127.0.0.1:28702 | Mining listener of the local node, or the HTTPS URL of a Tenrai API that offers mining. Used when --stratum is not given. The prefix of -a picks the port: 28707 for a testnet address, 28712 for development |
--chain-id <HEX> | Refuses a node that serves another chain | |
--tag <TEXT> | Tenrai Ref v<version> | Text in your blocks, shown in the explorer. At most 20 characters, empty for none. A pool may replace it with its name |
| URL | Protocol |
|---|---|
stratum+tcp://host:port | Version 1, unencrypted, only to localhost and 127.0.0.1 |
stratum+tls://host:port | Version 1 over TLS 1.3 |
stratum2+tls://host:port | Version 2, binary frames, always TLS 1.3 |
While the node catches up
The node hands out work only while it is synchronized with its peers; a dip of up to 30 seconds, such as peers reconnecting, keeps the work coming. While the node catches up or cannot be reached, the miner keeps its job for a few seconds and then pauses. It says so once, reminds you once a minute with the node's height and starts again by itself. Stratum bridges and pools do the same for their miners.
For a private development chain or a lone test node, set mine_when_not_synced: true in node.json or start the node with tenraid run --mine-when-not-synced. That is a node setting, not a miner option.
Devices
| Option | Default | What it does |
|---|---|---|
--cpu-only | off | Mines on the CPU only |
--gpu-only | off | Mines on GPUs only |
-g, --devices <0,2,...> | all | GPUs to use, by the index from --list-devices |
-t, --threads <N|all> | 2 | CPU threads that mine. all uses every thread but the ones that feed the GPUs: 1, or 2 with more than 3 GPUs |
--reserve-threads <N> | Mines on every CPU thread but N, which stay free to feed the GPUs; 0 mines on all. Cannot be combined with --threads | |
-i, --intensity <N,...> | tuned | Hashes per GPU launch. One value for all GPUs, or one per GPU. Lower it if the desktop lags |
--cpu-batch <N,...> | tuned | Hashes per CPU batch. One value for all threads, or one per thread |
--no-autotune | off | Keeps the standard batch sizes instead of tuning each GPU and CPU thread for its hashrate. Values given with --intensity or --cpu-batch stay fixed either way |
--temp-limit <C> | Pauses a GPU at this temperature and resumes it 5 degrees lower | |
--backend <NAME> | auto | GPU backend to start with: auto, opencl-3.0, opencl-1.2, cuda |
--no-fallback | off | Stays on the chosen backend when it fails instead of trying the next |
--list-devices | Lists GPUs and CPU, then exits |
GPU backends
--backend | Order |
|---|---|
auto | CUDA where NVRTC is installed, then OpenCL. Otherwise OpenCL 3.0 where the card supports the required sub-group features, else OpenCL 1.2, then CUDA |
opencl-3.0 | OpenCL 3.0, then OpenCL 1.2, then CUDA |
opencl-1.2 | OpenCL 1.2, then CUDA |
cuda | CUDA, then OpenCL |
On NVIDIA cards auto runs CUDA when NVRTC is installed. Without it auto runs OpenCL 1.2 there, because the drivers report OpenCL 3.0 without the needed features. CUDA needs NVIDIA driver R550 or newer and NVRTC 12 (nvrtc64_120_0.dll on Windows, libnvrtc.so.12 on Linux) from the CUDA toolkit or next to the miner.
Every GPU is tested against the CPU at the start of each epoch, and every block or share it finds is hashed again on the CPU before it is sent. A card that fails, or returns three wrong hashes in a row, moves to its next backend. With no backend left it retries after 30 seconds, then at longer intervals up to 5 minutes.
TenQ
| Option | Default | What it does |
|---|---|---|
--tenq-mode full|light | full | light uses a 32 MiB cache instead of the 2 GiB dataset, on CPU and GPU. About 20 times slower; only for machines without the memory |
--no-tenq-prefetch | off | Builds each epoch's dataset only when the epoch starts. Saves memory, but mining pauses during the build |
In full mode the miner falls back to light while there is no room for the dataset. The next epoch's dataset is built 1,024 cuts ahead when 2.5 GiB are free.
Statistics and logs
| Option | Default | What it does |
|---|---|---|
--api-bind <IP[:PORT]> | 127.0.0.1:28770 | Address of the dashboard and the JSON statistics. A testnet address moves the port to 28773, a development address to 28776 |
--no-dashboard | dashboard on | Serves the JSON statistics without the dashboard |
--no-api | Serves neither the dashboard nor the statistics | |
--metrics-bind <IP[:PORT]> | off | Prometheus metrics at /metrics, port 28793 unless given, see Logs and monitoring |
--report-interval <S> | 30 | Seconds between the device tables in the log, at least 5 |
-d, --debug | off | Logs jobs, every share and difficulty changes |
--log-file <FILE> | Also writes the log to a file, moved to <file>.old at 64 MiB | |
--no-color | off | Plain console output |
Keep --api-bind on 127.0.0.1 unless a firewall protects the port; the dashboard and the statistics have no password.
| Path | Content |
|---|---|
/ | Dashboard with charts |
/v1/stats | Hashrate, shares, blocks, connection and every device with temperature, fan and power; a CPU reports temperature and power on Linux only |
/v1/history | Hashrate and network difficulty, one point a minute for the last day |
Device states in /v1/stats: mining, waiting (no work), paused (temperature limit), failed (retrying), stalled (no hashes for 90 seconds).
Other
| Option | What it does |
|---|---|
--benchmark [mainnet|development] | Measures the hashrate on a synthetic job. Default mainnet |
--once | Exits after the first accepted block or share |
--config <FILE> | Reads options from this JSON file instead of tenrai-miner.json |
Config file
Without --config the miner reads tenrai-miner.json next to the program and creates it with the default settings on the first start. The file uses the long option names. true turns a switch on. A value on the command line replaces the file's; lists from both are added together. With your address in the file, tenrai-miner starts without arguments.
{
"mining-address": "trai1...",
"stratum": ["stratum+tls://pool-a.example.org:28741", "stratum2+tls://pool-b.example.org:28742"],
"worker": "rig1",
"pool": true,
"backend": "cuda",
"temp-limit": 80,
"threads": "all"
}HiveOS
Build the package on Linux and put the archive where the rig can download it:
cargo build --release -p tenrai-miner
bins/miner/hiveos/package.shIn the flight sheet, choose Custom as miner:
| Field | Value |
|---|---|
| Miner name | tenrai-miner |
| Installation URL | URL of tenrai-miner-<version>.tar.gz |
| Hash algorithm | tenq |
| Wallet and worker template | %WAL%.%WORKER_NAME% |
| Pool URL | stratum+tls://host:port or stratum2+tls://host:port, several separated by spaces, or http://127.0.0.1:28702 for a node on the rig |
| Pass | Pool password, if any; d=<n> for a fixed share difficulty |
| Extra config arguments | --pool when mining on a pool, plus any other option on this page, e.g. --temp-limit 80 |
HiveOS reads hashrate, temperatures and shares from /v1/stats.
