6.3 KiB
How to mine with Zebra on testnet
Important
s-nomp has not been updated for NU5, so you'll need the fixes in the branches below.
These fixes disable mining pool operator payments and miner payments: they just pay to the address configured for the node.
Install, run, and sync Zebra
-
Configure
zebrad.toml:- change the
network.networkconfig toTestnet - add your testnet transparent address in
mining.miner_address, or you can use the ZF testnet addresst27eWDgjFYJGVXmzrXeVjnb5J3uXDM9xH9v - ensure that there is an
rpc.listen_addrin the config to enable the RPC server
Example config:
[consensus] checkpoint_sync = true debug_skip_parameter_preload = false [mempool] eviction_memory_time = '1h' tx_cost_limit = 80000000 [metrics] [network] crawl_new_peer_interval = '1m 1s' initial_mainnet_peers = [ 'dnsseed.z.cash:8233', 'dnsseed.str4d.xyz:8233', 'mainnet.seeder.zfnd.org:8233', 'mainnet.is.yolo.money:8233', ] initial_testnet_peers = [ 'dnsseed.testnet.z.cash:18233', 'testnet.seeder.zfnd.org:18233', 'testnet.is.yolo.money:18233', ] listen_addr = '0.0.0.0:18233' network = 'Testnet' peerset_initial_target_size = 25 [rpc] debug_force_finished_sync = false parallel_cpu_threads = 1 listen_addr = '127.0.0.1:18232' [state] cache_dir = '/home/ar/.cache/zebra' delete_old_database = true ephemeral = false [sync] checkpoint_verify_concurrency_limit = 1000 download_concurrency_limit = 50 full_verify_concurrency_limit = 20 parallel_cpu_threads = 0 [tracing] buffer_limit = 128000 force_use_color = false use_color = true use_journald = false [mining] miner_address = 't27eWDgjFYJGVXmzrXeVjnb5J3uXDM9xH9v' - change the
-
Build and Run Zebra with the
getblocktemplate-rpcsfeature:cargo run --release --features "getblocktemplate-rpcs" --bin zebrad -- -c zebrad.toml -
Wait a few hours for Zebra to sync to the testnet tip (on mainnet this takes 2-3 days)
Install s-nomp
General instructions with Debian/Ubuntu examples
Install dependencies
-
Install
redisand run it on the default port: https://redis.io/docs/getting-started/sudo apt install lsb-release curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list sudo apt-get update sudo apt-get install redis redis-server -
Install and activate a node version manager (e.g.
nodenvornvm) -
Install
boostandlibsodiumdevelopment librariessudo apt install libboost-all-dev sudo apt install libsodium-dev
Install s-nomp
-
git clone https://github.com/ZcashFoundation/s-nomp -
cd s-nomp -
Use the Zebra fixes:
git checkout zebra-mining -
Use node 8.11.0:
nodenv install 8.11.0 nodenv local 8.11.0or
nvm install 8.11.0 nvm use 8.11.0 -
Update dependencies and install:
export CXXFLAGS="-std=gnu++17" npm update npm install
Arch-specific instructions
Install dependencies
-
Install
redisand run it on the default port:sudo pacman -S redis sudo systemctl start redis -
Install and activate
nvm:sudo pacman -S nvm unset npm_config_prefix source /usr/share/nvm/init-nvm.sh -
Install
boostandlibsodiumdevelopment libraries:sudo pacman -S boost libsodium
Install s-nomp
-
git clone https://github.com/ZcashFoundation/s-nomp && cd s-nomp -
Use the Zebra configs:
git checkout zebra-mining -
Use node 8.11.0:
nvm install 8.11.0 nvm use 8.11.0 -
Update dependencies and install:
npm update npm install
Run s-nomp
- Edit
pool_configs/zcash.jsonsodaemons[0].portis your Zebra port - Run
s-nompusingnpm start
Note: the website will log an RPC error even when it is disabled in the config. This seems like a s-nomp bug.
Install a CPU or GPU miner
Install dependencies
General instructions
- Install a statically compiled
boostandicu. - Install
cmake.
Arch-specific instructions
sudo pacman -S cmake boost icu
Install nheqminer
We're going to install nheqminer, which supports multiple CPU and GPU Equihash
solvers, namely djezo, xenoncat, and tromp. We're using tromp on a CPU
in the following instructions since it is the easiest to install and use.
git clone https://github.com/ZcashFoundation/nheqminercd nheqminer- Use the Zebra fixes:
git checkout zebra-mining - Follow the build instructions at https://github.com/nicehash/nheqminer#general-instructions, or run:
mkdir build
cd build
# Turn off `djezo` and `xenoncat`, which are enabled by default, and turn on `tromp` instead.
cmake -DUSE_CUDA_DJEZO=OFF -DUSE_CPU_XENONCAT=OFF -DUSE_CPU_TROMP=ON ..
make -j $(nproc)
Run miner
- Follow the run instructions at: https://github.com/nicehash/nheqminer#run-instructions
# you can use your own testnet address here
# miner and pool payments are disabled, configure your address on your node to get paid
./nheqminer -l 127.0.0.1:1234 -u tmRGc4CD1UyUdbSJmTUzcB6oDqk4qUaHnnh.worker1 -t 1
Notes:
- A typical solution rate is 2-4 Sols/s per core
nheqminersometimes ignores Control-C, if that happens, you can quit it using:killall nheqminer, or- Control-Z then
kill %1
- Running
nheqminerwith a single thread (-t 1) can help avoid this issue