At this point, you should be somewhat familiar with the Linux interface and have all the prerequisites to set up your miner and begin confirming blocks! The process to setting up a miner is quite similar to setting up the node, so let’s walk through it step-by-step.
Setting up your miner is the final step in a multi-part article/video series. If you have not already read How to Set Up and Maintain your Bronze Age Quai Node, along with How to Create Addresses and Send Transactions on Quai, it is essential to complete the steps outlined in those articles before starting your miner. If you would prefer to learn this information in video format, you can watch a member of our team do it all on our YouTube channel.
Step 1: install the manager and miner source code
You should already have go-quai completely set up on your machine, but running a miner requires us to clone another Github repository called quai-manager. To do this, run the following command:
git clone https://github.com/spruce-solutions/quai-manager
Remember, if you are on Mac, to make sure to clone this repository into the Quai folder on your Desktop.
Once this has been done, we need to go into the quai-manager directory we just created by using:
cd quai-manager
Once you are in this directory, we again need to generate the binary for quai-manager, just like we did for go-quai. To do this, run the following command:
make quai-manager
Once this is done, we have completed the setup of quai-manager and are ready to jump into the next step.
Step 2: input your unique addresses to the network.env
In this step, we will return to editing the network.env file. To do this, re-enter the go-quai Directory with the commands
cd ..
cd go-quai
Now that we’re back in go-quai, we can reopen our network.env file to edit it with the following command:
nano network.env
Once back in this file, it is essential to input the unique Quai addresses you created in the last article into the Coinbase part of the network.env file.
Each Quai miner mines 3 of the Quai chains. The Prime chain is mined by all miners, and then miners choose one of 3 Region chains to mine, and one of three Zone chains subordinate to that Region chain to mine. To receive Quai rewards per block (both for Testnet block rewards, and for the Mainnet Quai Rewards Program), you must change the COINBASE_ADDRESS variables for the 3 chains you are mining. If you do not, we are unable to identify who mined which blocks correctly, and you will not recieve your 1 $QUAI/block Mainnet Reward.
Step 3: prime your node for mining
It is important to note that to run a miner on Quai, you must be running a full node with the mining flag. This is why in the first article, we told those interested in mining to not bother running the make run-full-node command.
To set up your node with a mining flag, we need to go back to the go-quai directory using
cd ..
cd go-quai
Once we are back in the go-quai directory, we can start running our full node that is primed for mining. The command to do this is:
make run-full-mining
To double check that our node is running properly, we can run the following command to check our nodelogs:
cat nodelogs/zone1-1.log
If your node is functioning as expected, you are ready to move on to Step 4!
Step 4: Starting up your miner
Note: To ensure your miner is properly connected to the network before mining, make sure you have at least one peer on all three chains you will mine for before starting the miner.
First we need to go back to the quai-manager directory, which is where we will input our mining commands. To do this, we can run the following:
cd
cd quai-manager
Now we are able to run the command that actually starts our mining:
make run-mine-background region=x zone=y
-region=1: Cyprus
-region=2: Paxos
-region=3: Hydra
x and y can be any number between 1 and 3. All Quai miners automatically mine the Prime chain, but individuals get to chose which Region and Zone chains they wish to support.
You are now able to view your mining logs by using the following command:
cat logs/manager.log
As an example, output of correct mining logs should look like this:
Note: It can take a few minutes for your miner to begin processing blocks. If you run the mining logs command before the miner is ready, you will be greeted with an error. This is not an issue, just give it a couple more minutes and try the command again.
To stop your miner, you can simply run the same command as to stop our node:
make stop
To stop your node as well, return to the go-quai directory and run the make stop command again.
Step 5: how to update your miner
Throughout the Testnet, our developers will regularly be applying updates to Quai Network. Whenever an update is announced it is important pull the latest updates to the quai-manager repository and remake the binary, similar to how we update our node.
First, we can pull the updates to the quai-manager repo by running the following command in the quai-manager directory:
git pull origin main
After this step, we can remake the quai-manager binary.
make quai-manager
After this step, your miner is back up to date. You can turn your node and miner back on, and continue earning rewards!
Note: Updating your miner is likely the most important thing you can do to help the Testnet. Miners that remain out of date will begin mining forked chains, which interrupts the efficiency of the Bronze Age Testnet. Thus, to receive Quai rewards, miners must update their node regularly at the request of Quai developers.
Step 6: Reap The Rewards
While running a node is important to the network and node operators are rewarded as such, it takes additional effort to run a miner is recognized by our team. Miners will be awarded 1500 Mainnet $QUAI for setting up their miner, and will receive an additional 1 Mainnet $QUAI per block mined. Block rewards for miners throughout the duration of the testnet are uncapped.
Join us to build a better blockchain.
Quai Network is an open-source Proof-of-Entropy-Minima blockchain network utilizing the capabilities of merged mining to increase throughput and security. Users of Quai Network will enjoy fast transaction times without compromising decentralization and security. Miners will have competitive mining opportunities across the many blockchains within the network.
Capable of thousands of transactions per second, the Quai Network is a new solution to scalability that is soon to be ready for mainnet release.
Terms & Conditions / Disclaimer
The entirety of the Quai Genesis grants program, including the content of this article, is subject to the Terms and Conditions outlined here.
Opinions, ideas, and statements shared in this update are delivered with numerous assumptions, risks, and uncertainties which are subject to change over time. There are multiple risk factors, including those related to blockchain, cryptographic systems, and technologies generally, as well Quai’s business, operations and results of operations, that could cause actual results or developments anticipated not to be realized or, even if substantially realized, to fail to achieve any or all of the benefits that could be expected therefrom. We reserve the right to unilaterally, completely, or partially change plans, expectations, and intentions stated herein at any time and for any reason, in our sole and absolute discretion, and we undertake no obligation to update publicly or revise any forward-looking statement, whether as a result of new information, future developments, or otherwise. ACCORDINGLY, WE RECOMMEND THAT YOU DO NOT RELY ON, AND DO NOT MAKE ANY FINANCIAL DECISION OR INVESTMENT BASED ON, THE STATEMENTS CONTAINED IN THIS UPDATE OR ANY OF OUR UPDATES/ARTICLES — INCLUDING BUT NOT LIMITED TO ANY SELLING OR TRADING OF QUAI TOKENS, ETHER, OR ANY OTHER CRYPTOGRAPHIC OR BLOCKCHAIN TOKEN, OR THE SECURITIES OF ANY COMPANY.
The views, opinions, and statements made in this update are those of an individual author and not those of any institution, University, or legal entity operating within the jurisdiction of The United States or beyond. There is no association between these views, opinions, and statements and any for-profit or non-profit entity, particularly with Universities, Foundations, and other Agencies located within the United States. Any perception of such an association is purely accidental, and will be rectified immediately if brought to our attention by the reader.