GPU miner
Mining12.4.15+

GPU miner

The lotus-miner-cli command line, the Lotus Miner desktop app, the Docker images and the browser miner, with every flag.

The GPU miner is lotus-miner-cli, an OpenCL program in the gpuminer/ directory of the node's repository. The Lotus Miner desktop app and the Docker images run that same program.

Command line #

Mine on a pool node, or on your own node's stratum server:

Shell
./lotus-miner-cli -g 0 -o YOUR_LOTUS_ADDRESS \
  --stratum stratum+tcp://POOL_NODE:PORT \
  --stratum-user YOUR_LOTUS_ADDRESS.rig1

The node's How to mine page shows the address and port to use. One process drives one card: start one per card, with -g 0, -g 1, and so on.

Mine against your own node's RPC instead of stratum (LotusHash only):

Shell
./lotus-miner-cli -g 0 -o YOUR_LOTUS_ADDRESS \
  -a http://127.0.0.1:10604 -u RPC_USER -p RPC_PASSWORD -i 1
Warning

Always pass your own address with -o. Up to 12.4.15 the miner has a built-in default address, written to ~/.lotus-miner/config.toml on first run. Started without -o, it mines to that address, not yours.

Build it from the repository:

Shell
cd gpuminer
cargo build --release -p lotus-miner-cli
./target/release/lotus-miner-cli --help

Release archives are named lotus-gpu-miner-nvidia-<version>-linux-x86_64.tar.gz and lotus-gpu-miner-amd-<version>-linux-x86_64.tar.gz. Downloads: https://lotusia.network/downloads/

12.4.16+

Coming in 12.4.16: one miner binary and one image for NVIDIA and AMD cards, with --backend auto|nvidia|amd and --list-devices. The built-in payout address is removed: without an address the miner refuses to start. With only -o, it mines on the pool by default.

Algorithms #

--algoWhat the card doesTransport
lotushash (default)Lotus' own proof of workstratum (--stratum) or RPC (-a)
sha256dActs as a Bitcoin ASICstandard Stratum V1, needs --stratum
scryptActs as a Litecoin ASICstandard Stratum V1, needs --stratum

sha256d and scrypt are for the node's merged-mining listeners. In those modes the miner runs a known-answer self-test at startup and refuses to mine (exit code 3) if the card disagrees with the CPU.

Napoleon upgrade

On mainnet, blocks mined with sha256d or scrypt are valid only from the Napoleon activation. Until then, use these modes on a test network.

LotusHash has two OpenCL kernels, chosen with --kernel-type: lotus_og (default) and poclbm.

Flags #

FlagDefaultMeaning
-o, --mine-to-addresssee the warning aboveThe Lotus address that is paid.
--stratum <URL> (alias --stratum-url)nonestratum+tcp://host:port. Repeat it, or give a comma list, for failover: the first is the primary. Without it the miner uses RPC.
--stratum-userthe -o address<Lotus address>[.worker]. One for all URLs, or one per URL in the same order.
--stratum-passwordxIgnored by the node on LotusHash listeners.
--algolotushashlotushash, sha256d or scrypt.
-g, --gpu-index0Which card.
-s, --kernel-size23The batch is 2 to this power. For sha256d: 2^N work items of 16 nonces, default 22.
--kernel-typelotus_oglotus_og or poclbm.
--failover-after2Failed sessions in a row before moving to the next URL.
--primary-retry300On a backup URL, seconds between probes of the primary. 0 = never return.
--reconnect-max15Cap of the reconnect backoff, in seconds. It starts at 1 s.
--job-timeout30Reconnect if no job this long after authorize. 0 = off.
--idle-timeout600Reconnect if no job or difficulty this long. 0 = off.
--submit-timeout30Seconds after which a submit counts as unanswered. 0 = off.
--max-unanswered-submits3Reconnect after this many unanswered submits in a row. 0 = off.
--stable-after60Seconds with a job after which the backoff is reset.
--tcp-keepalive30Keepalive idle seconds. 0 = system default.
--suggest-difficultynonesha256d and scrypt: difficulty asked from the server after login.
--no-version-rollingoffsha256d: do not ask for version rolling.
--scrypt-concurrency8192Scrypt: hashes per launch.
--scrypt-lookup-gap2Scrypt: keep one scratchpad entry out of N.
-a, --rpc-urlhttp://127.0.0.1:10604RPC mode: the node's address.
-u, --rpc-user, -p, --rpc-passwordlotus, lotusRPC mode: credentials.
-i, --rpc-poll-interval3RPC mode: seconds between requests for new work.
-m, --poolminingoffRPC mode: submit shares to an RPC pool.
--debugoffVerbose output.

The miner reads its defaults from ~/.lotus-miner/config.toml and creates that file on first run. Command-line flags win over it. The -c, --config flag is accepted but another file is not loaded in 12.4.15: edit the default file instead.

The miner writes lotus-miner.log in its working directory. An invalid command line exits with code 2.

Lotus Miner app #

Lotus Miner is the desktop app for Windows, macOS and Linux, in desktop/lotus-miner-gui. It starts and supervises lotus-miner-cli, one process per card.

  1. Download the archive for your system from https://lotusia.network/downloads/ and unpack it into a folder you can write to.
  2. Start the app and paste your Lotus address.
  3. Press Start.

What it does:

  • Easy mode: an address and one button, with a hashrate chart, accepted and rejected shares, an estimate per day, the pending balance and the pool blocks that paid you.
  • Advanced mode: per-card on/off, intensity, kernel, instances and a pause temperature; the algorithm; the pool's nodes or your own list of pools in priority order; profiles; the log; and the equivalent command line.
  • Failover: it probes the pool's nodes every minute, starts on the fastest healthy one and gives the others to the miner as its failover list.

The app is portable. Settings, hashrate history and sessions are in lotus-miner.sqlite in the app's own folder, with its logs. To uninstall, delete the folder. On Windows the miner also creates %USERPROFILE%\.lotus-miner\config.toml on first run.

The app talks only to the chosen pool and to the pool's public API. The payout address is the only identifier sent.

Docker #

Images are published as ghcr.io/lotusdevorg/lotus-gpu-miner (NVIDIA) and ghcr.io/lotusdevorg/lotus-gpu-miner-amd (AMD).

Shell
docker run --rm --gpus all ghcr.io/lotusdevorg/lotus-gpu-miner \
  -o YOUR_LOTUS_ADDRESS \
  --stratum stratum+tcp://POOL_NODE:PORT

The container detects the cards and starts INSTANCES_PER_GPU miners per card (default 1). It restarts a miner that exits unexpectedly. KERNEL_SIZE (default 22) and the usual flags are accepted.

Warning

Started without -o, the image mines to one of its built-in addresses, not to yours.

Browser miner #

A node can let visitors mine in their browser, from the Mine in your browser view of its Pool page. The browser speaks the same LotusHash stratum as a GPU miner, over a WebSocket. It is meant for trying mining out, not for earning.

The operator turns it on with a WebSocket listener, next to the stratum server:

Config
stratum=1
stratumwslisten=127.0.0.1:3335

Put a reverse proxy in front of it that forwards the path /api/v1/mining/ws with the WebSocket upgrade headers. Never bind the listener to a public address without a proxy. The limits and the other -stratumws* options are on the Stratum server page.

In the browser, nothing starts without a click. The page tests its hashing code before mining and refuses to start on a mismatch. It uses the CPU through WebAssembly, or the graphics card through WebGPU when that is faster and passes its self-test.

Source share/www/docs/gpu-miner.md in the lotusd repository
Checked against gpuminer/lotus-miner-cli/src/main.rs gpuminer/lotus-miner-lib/src/settings.rs gpuminer/STRATUM-AND-HASHRATE.md desktop/lotus-miner-gui/README.md dockerfiles/start-miners.sh doc/ci.md doc/browser-miner.md