How to solo mine Bitcoin Royale (BTCR) - bitcoinroyale/bitcoinroyale GitHub Wiki
Bitcoin Royale uses the same hash algorithm as Bitcoin (SHA256) and therefore can use the same mining equipment. CPU mining may work in the early early days of the network but will quickly become irrelevant.
Roughly speaking, CPU mining can produce a few MH (mega-hash/sec), GPU mining can produce a few GH (giga-hash/sec) and ASIC mining can produce a few TH (tera-hash/sec). Each family is about x1000 as powerful as the previous.
Make sure you have a Bitcoin Royale wallet installed.
For privacy and security reasons it's recommended to mine to multiple addresses (Satoshi's original solo miner worked this way and mined each block to a different address). Create multiple addresses that will receive the block rewards with this simple perl script:
for ($i = 0 ; $i < 5000 ; $i++) {
$addr = `broyale-cli getnewaddress`;
chomp $addr;
$arr[$i] = '"' . $addr . '"';
}
print "[" . join(",", @arr) . "]\n";
Save the above as addr.pl
and run perl addr.pl > addresses.json
This will create the file addresses.json
that holds your addresses. We will use this file in a minute.
Make sure you have a Bitcoin Royale network node installed. Ideally, this would run on a VPS because mining takes a long time. Don't place your wallet on this VPS to avoid theft.
Use the following configuration for ~/.broyale/broyale.conf
:
rpcuser=bruser
rpcpassword=brpassword
rpcallowip=127.0.0.1
server=1
listen=1
Run the node with:
broyaled -daemon
CKPOOL is a robust Stratum solo mining server that was adapted for Bitcoin Royale, install it on the VPS running the node:
sudo apt-get install build-essential yasm libpq-dev libgsl-dev autoconf automake libtool
git clone https://github.com/bitcoinroyale/ckpool
cd ckpool
./autogen.sh
./configure --without-ckdb
make
Use the following configuration for ckpool/src/ckpool.conf
:
{
"btcd": [{
"url": "127.0.0.1:8332",
"auth": "bruser",
"pass": "brpassword",
"notify": false
}],
"btcaddress": <ADDRESSES>,
"blockpoll": 100,
"update_interval": 30,
"mindiff": 1,
"startdiff": <DIFFICULTY>
}
Replace <ADDRESSES>
with the contents of addresses.json
we've created earlier.
Replace <DIFFICULTY>
with the share difficulty of the mining equipment you'll be using. It is roughly 7*GH meaning 7 times the hash power in giga-hash/sec. For a CPU miner with 10MH (0.01GH) this is 0.07
which is rounded to 1
, for a GPU miner with 10GH this is 70
and for an ASIC miner with 10TH (10000GH) this is 70000
.
This will start the Stratum mining server on your VPS running the Bitcoin Royale node:
cd ckpool/src
nohup ./ckpool -H -k &
The server is now running in the backgroud, to monitor it via console, run:
tail -f nohup.out
The server is listening on port 3333 and its endpoint is stratum+tcp://<SERVER-IP>:3333
where <SERVER-IP>
is the IP address of the VPS.
To connect a CPU miner, install it first on the computer that will do the actual mining, and run:
cd cpuminer-multi
./cpuminer --algo=sha256d -o stratum+tcp://<SERVER-IP>:3333 -u cpu_miner -p whatever
To connect a GPU or ASIC that is found locally, use a tool like cgminer on the computer hosting the hardware, and run:
cd cgminer
./cgminer -o stratum+tcp://<SERVER-IP>:3333 -u hardware_miner -p whatever
To connect a GPU or ASIC that is found remotely, use a rental service like miningrigrentals.com or nicehash.com and specify the rig type to be Sha256
and the following mining pool endpoint:
stratum+tcp://<SERVER-IP>:3333
Notice that the rental service will provide you with the ideal difficulty value to place as <DIFFICULTY>
in ckpool.conf
from earlier.
Also notice that your Stratum server can host more than one miner at the same time.