Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Solo-mining Sugarchain with multiple computer

First of all, make sure you have a full node running and fully synced All machines need to be connected to the same local network (e.g same wi-fi)

Node configuration

On the computer with the full node, find the local IP address: On MacOS/Linux you can use


And should return something like

	ether e4:ce:8f:0e:33:c4 
	inet6 fe80::404:8467:3244:a799%en1 prefixlen 64 secured scopeid 0x7 
	inet netmask 0xffffff00 broadcast
	inet6 2001:7e8:c8de:2000:c40:7f55:b1ca:4fbe prefixlen 64 autoconf secured 
	inet6 2001:7e8:c8de:2000:bc3c:2b79:8478:693b prefixlen 64 autoconf temporary 
	nd6 options=201<PERFORMNUD,DAD>
	media: autoselect
	status: active

What we need is our IP address as well as the CIDR notation of it

The important part is the line with inet

inet netmask 0xffffff00 broadcast

With that, we will be able to calculate the CIDR address for the sugarchainf.conf So in my case, the IP of the full node is The netmask is 0xffffff00 in enter your netmask Calculating the mask and copy the subnet mask, in my case it's

Now on enter your IP and your mask Calculating the CIDR and copy the net CIDR notation, in my case it's

Now open your sugarchain.conf file and modify as follow


notice the rpcbind is the full node IP and the last rpcallowip is our IP in CIDR notation, this will allow anyone in our local network to connect to our node.


Now on any computer connected to the same network, just run the miner using the node IP For example with sugarmaker (don't forget to change the options accordingly to your own configuration)

 ./sugarmaker -o -u user -p pass --coinbase-addr=sugar1q3hjg38ygedjz96e7vyvsju36q2muke439t3237 -t1

With remote server

If you have some remote computer like a VPS and you want to make them mine on your computer, you would need to Remote Port Forward through SSH.

To connect to SSH

ssh -R localhost:31337: IP_SERVER

Note that I used the IP from rpcbind in localhost:31337:, so make sure to replace it with the one of your sugarchain.conf

To mine on your server

./sugarmaker -o http://localhost:31337 -u user -p pass --coinbase-addr=sugar1q3hjg38ygedjz96e7vyvsju36q2muke439t3237 -t1

Don't forget to change the options accordingly to your own configuration

Note if you mine with multiple device

To add some randomness on your block generation, and to avoid duplicate works (same miner with the same template with the same nonce would produce the same hash), it's advice to have a different coinbase-addr for each of your miner

Happy mining :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment