Mining
Since Quai Network is Proof of Work, mining is used in the production of blocks. Quai Network utilizes combined headers during block production. The act of combining headers is done inside of the Quai Network manager.

Install Manager + Miner Source Code

Manager + Miner can be found in the quai-manager repository.
1
git clone https://github.com/spruce-solutions/quai-manager
Copied!

Building the source

For prerequisites and detailed build instructions please read the Installation Instructions.
Building quai-manager requires both a Go (version 1.14 or later) and a C compiler. You can install them using your favourite package manager. Once the dependencies are installed, run
Build via Makefile
1
make quai-manager
Copied!
Build via GoLang directly
1
go build -o ./build/bin/manager manager/main.go
Copied!

Run the manager

Set the region and zone flags

The below commands will run the manager in region 1 and zone 2.
It can be set to any value between 1 and 3 for regions and zones and the manager will start in that location.
Run via Makefile
1
make run-mine region=1 zone=2
Copied!
To run the manager in background and save the logs
1
make run-mine-background region=1 zone=2
Copied!

Set

Run via Go binary
1
./build/bin/manager 1 2 1
Copied!

View Logs

1
cat logs/manager.log
2
3
// Example successful output
4
PRIME: [7112 29321 33661] @xc27ca45848d27e4f414dbafc0efc3b5fc96608fc407ff00fc924897f3d61ce2f
5
ZONE: [7113 29322 33662] @x35a47a31af0905c9baa8661412f5437cd8361271fd06b790e037c86b209c1490
6
PRIME: [7113 29322 33663] 0x822c0aab59bd3ec0d0a662f36fc6e1e82ee9a46ca7981822fddf4432c22cf2f9
7
ZONE: [7114 29323 33664] Oxd416c0e46a29d104bb37f146d3a37f66ec024c3f2703b3e92cc0903c80ab0da
8
ZONE: [7114 29323 33665] 0xb4b00b537ba6271695f0527e2a4e220224307a85d6b0681392a2ac1c37c18c01
9
REGION: [7114 29323 336661 0×84b3c32f881f7bb512f5467ac129149ebc33f25c690f740d83a6ddb94dbeßfbe
Copied!

Stopping the Manager

1
make stop
2
// This will close the port on which the manager was running and should print it
Copied!
To view a YouTube tutorial on how to set up a Bronze Age Quai Network miner, click here.
To read our article offering a step-by-step guide on how to set up a Bronze Age Quai Network miner, click here.