Docs
v1

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

OptionDefaultWhat it does
-a, --mining-address <ADDR>asked forYour 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 nameName of this rig on the pool. Letters, digits, ., _, -, at most 32
-p, --password <TEXT>emptyPool or bridge password. d=<n> or <password>,d=<n> asks for a fixed share difficulty. Also read from TENRAI_STRATUM_PASSWORD
--pooloffAccepts 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>5Seconds to wait after every URL in the list failed
-s, --node <HOST[:PORT]>127.0.0.1:28702Mining 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
URLProtocol
stratum+tcp://host:portVersion 1, unencrypted, only to localhost and 127.0.0.1
stratum+tls://host:portVersion 1 over TLS 1.3
stratum2+tls://host:portVersion 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

OptionDefaultWhat it does
--cpu-onlyoffMines on the CPU only
--gpu-onlyoffMines on GPUs only
-g, --devices <0,2,...>allGPUs to use, by the index from --list-devices
-t, --threads <N|all>2CPU 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,...>tunedHashes per GPU launch. One value for all GPUs, or one per GPU. Lower it if the desktop lags
--cpu-batch <N,...>tunedHashes per CPU batch. One value for all threads, or one per thread
--no-autotuneoffKeeps 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>autoGPU backend to start with: auto, opencl-3.0, opencl-1.2, cuda
--no-fallbackoffStays on the chosen backend when it fails instead of trying the next
--list-devicesLists GPUs and CPU, then exits

GPU backends

--backendOrder
autoCUDA 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.0OpenCL 3.0, then OpenCL 1.2, then CUDA
opencl-1.2OpenCL 1.2, then CUDA
cudaCUDA, 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

OptionDefaultWhat it does
--tenq-mode full|lightfulllight 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-prefetchoffBuilds 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

OptionDefaultWhat it does
--api-bind <IP[:PORT]>127.0.0.1:28770Address of the dashboard and the JSON statistics. A testnet address moves the port to 28773, a development address to 28776
--no-dashboarddashboard onServes the JSON statistics without the dashboard
--no-apiServes neither the dashboard nor the statistics
--metrics-bind <IP[:PORT]>offPrometheus metrics at /metrics, port 28793 unless given, see Logs and monitoring
--report-interval <S>30Seconds between the device tables in the log, at least 5
-d, --debugoffLogs jobs, every share and difficulty changes
--log-file <FILE>Also writes the log to a file, moved to <file>.old at 64 MiB
--no-coloroffPlain console output

Keep --api-bind on 127.0.0.1 unless a firewall protects the port; the dashboard and the statistics have no password.

PathContent
/Dashboard with charts
/v1/statsHashrate, shares, blocks, connection and every device with temperature, fan and power; a CPU reports temperature and power on Linux only
/v1/historyHashrate 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

OptionWhat it does
--benchmark [mainnet|development]Measures the hashrate on a synthetic job. Default mainnet
--onceExits 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.

JSONtenrai-miner.json
{
  "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:

Shell
cargo build --release -p tenrai-miner
bins/miner/hiveos/package.sh

In the flight sheet, choose Custom as miner:

FieldValue
Miner nametenrai-miner
Installation URLURL of tenrai-miner-<version>.tar.gz
Hash algorithmtenq
Wallet and worker template%WAL%.%WORKER_NAME%
Pool URLstratum+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
PassPool 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.

Type to search guides, concepts and reference pages.