This is currently in development pending 1.0.2 release

Mine Bitcoin Cash blocks with JavaScript.

A Bitcoin Cash node with a verified blockchain is required.

Node.js

npm install twexxor-bitcoin-cash-miner

Create a configuration file in node_modules named twexxor-bitcoin-cash-miner-configuration.js.

const _1_0 = [
	'/twexxor/bitcoin-cli',
	'/twexxor/bitcoin.conf',
	'bitcoincash:000000000000000000000000000000000000000000'
];
module.exports = _1_0;

Set _1_0[0] to the full path of the Bitcoin Cash bitcoin-cli binary file.

Set _1_0[1] to the full path of the Bitcoin Cash node bitcoin.conf configuration file.

Set _1_0[2] to a Bitcoin Cash wallet address to receive block rewards.

The following options must be defined in bitcoin.conf.

rpcbind=127.0.0.1
rpcpassword=twexxor
rpcport=8332
rpcuser=twexxor

Set each option to their actual values.

Start a mining process.

nodejs twexxor-bitcoin-cash-miner.js 1

Start additional mining processes based on available CPU or GPU device threads.

Increment the optional 1 parameter to generate additional block data on faster devices.

When someone else finds a block, each mining process needs to be terminated and started again.

The maximum execution time should be 1 minute to avoid mining with old block data.

When a mining process finds a block, it’s submitted to the blockchain.

GitHub

View Github