Updated instructions for mining in the QuarkChain test network (mining is available on graphics cards (GPU) and processors (CPU))
- Installing and running the cluster (on Docker)
- Getting a wallet for mining in the test network
- Running mining on processors CPU
- Start mining on NVIDIA and AMD graphics cards
Installing and running a cluster in Docker
Good day everyone! Let’s start installing and running the cluster, it will be necessary for successful mining on both processors and video cards….. write instructions for Docker (Start and Maining on Windows 10 Pro, it is also possible to run the cluster under Ubuntu\Linux)
- Download Docker (https://www.docker.com/products/docker-desktop) there are versions for Win and Mac
- Installing Docekr on Ubuntu\Linux (link to article)
- Install Docker.
- After installing and running Docker, you will have an icon in the bottom right corner of your main monitor.
- We need a console for management and monitoring, — portainer.io with its help we will be able to start and restart our container, sometimes it is necessary (Ubuntu\Linux does not require this).
Installed with a command from the command line (see the following paragraph for how to run the command line):
docker volume create portainer_data
docker run -d -p 9050:9000 --name portainer --restart always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer
- Later in portainer is accessed through the link: http://127.0.0.1:9000/#/home or http://127.0.0.1:9050/#/home
- Open the command line (WinKey+R-then write «cmd» and click run)
- Next will be the executive command line: C:\Users\User>
Now we create a container and pull up the image of the test network to run, write on the command line:
docker run --name qkctest -it -p 38291:38291 -p 38391:38391 -p 38491:38491 -p 38291:38291/udp ninjaahhh/pyquarkchain:testnet2.5.2
Then press Enter
- Your container is called qkctest – you can change its name to whatever you like
- Сurrent version 2.4.0 (it may change with the coming updates, it is necessary to monitor yourself, I hope that yet) — looking version here: https://hub.docker.com/r/ninjaahhh/pyquarkchain/tags/ (previous version 2.5.0) or here https://hub.docker.com/r/qcgg/pyquarkchain/tags/ (latest version 2.5.2)
Next, check the correctness of the container installation and its status
In command line:
docker ps -a
You will see:
My data differ from yours, as I have my own setup., you will see 2 containers and their data.
Next, go to our container qkctest — command from the command line:
docker exec -ti qkctest bash
Then you immediately get into the container and you will have the following view on the command line:
Getting a wallet for mining in the test network
Forth go on site, https://testnet.quarkchain.io/wallet and take out your Primary Wallet address (you need to run your Metamask, login there and get your address in the test network)
Next, we need to enter your wallet address in the miner, go to the command line
and I write here the command
and press Enter
In response, you will receive
you need to make your address received on the website https://testnet.quarkchain.io/wallet
As a result of your input you should see that:
PS: if you do not enter your address, the system after pressing Enter generates an address automatically, you only need to write your private key that you can confirm the right to this address.
We now have the important step of synchronization of the network (cluster).
To do this, run the command from the command line
python3 quarkchain/cluster/cluster.py --cluster_config /code/pyquarkchain/testnet/2.5/cluster_config_template.json
Or just from a new command line:
docker exec -it qkctest python3 quarkchain/cluster/cluster.py --cluster_config /code/pyquarkchain/testnet/2.5/cluster_config_template.json
You must have this:
After synchronization, you can run the miner. Synchronization of the cluster is not closed!
Check sync cluster test network QuarkChain 2.5.2
Check the synchronization with the command:
docker exec -it qkctest pypy3 quarkchain/tools/stats -i 2 --ip localhost
If you do not pass the synchronization, the launch of the miners will be useless. I remind You: first, run the cluster and its synchronization, then as in the terminal window with the cluster synchronization check you will have the «Syncing» column written «False» and the current block in the «ROOT» column will coincide with the ROOT block on the site https://testnet2.quarkchain.io/stats (see Root Chain — the Height string), only after that you can run the CPU and GPU miner.
Changes in test network (version 2.5.2) and mining
In this version of test network and mining, the network has undergone a change. Previously, we had shards from 0-7 (8 shards in total), now the network has changed a bit and looks like this.
We still have the main blockchain — RootChain:
So we still have 8 shards (but now they look a little different)
As you can see from the picture-the network now has 5 subnets (see column Chain 0 — 5) and each subnet has one or two shards see column Shards.
Also in this version of mining, we will have the opportunity to try mining with POSW (I do not have details how it will be activated yet, but we will also consider it and add it in this article, or publish a new one.
We will review the changes in more detail in the near future. And who is interested you can see the list of documentation on GitHub (link is at the bottom of the article)
Commands to run CPU miners
I recommend to open another command prompt window, to separate the cluster heartbeat and work of miners. Run the miner directly from the command line.
docker exec -it qkctest quarkchain/tools/external_miner_manager.sh -c /code/pyquarkchain/testnet/2.5/cluster_config_template.json -p 8 -h 220.127.116.11
Here are the parameters: -p 8 (it processes) — set it to the number of processor cores
Then the miner starts. (It won’t work if you don’t have a full sync)
Important: the command to start the miner is mining all the shards on all subnets from 0 — 5 and all the shards, here mining works on the processor, this command was relevant in previous versions of the network. If the current test network version 2.4.0 processor mining 4 (DSHA256) and 5 (QKCHASH) network, each network has a subnet of 0 and 1 is them shards. Mining on subnets 0 — 3 (ETHASH) is preferred to run on video cards, otherwise you will have a competition with the power launched by other miners, and will not be a very satisfactory result.
Commands to start mining on 4 and 5 networks and their shards
Mining on 4 networks shard 0 and 1 (in the last network is 4 and 5 shards)
docker exec -it qkctest pypy3 quarkchain/tools/external_miner.py --config /code/pyquarkchain/testnet/2.5/cluster_config_template.json --worker 2 --shard 262146 262147 --host 18.104.22.168
Mining 5 network 0 and shard 1 (the last of the network’s 6 and 7 shards)
docker exec -it qkctest pypy3 quarkchain/tools/external_miner.py --config /code/pyquarkchain/testnet/2.5/cluster_config_template.json --worker 2 --shard 327682 327683 --host 22.214.171.124
— worker-specifies the number of dedicated processes for mining.
— shard-indicates the shards selected for mining.
-- worker — specifies the number of dedicated processes for mining.
-- shard — indicates the shards selected for mining.
Start mining QuarkChain graphics cards (GPU mining test network QKC)
Mining in the test network 2.5.1 on video cards is possible on shards 0-3 with the ETHASH algorithm using the optimized miner Ethminer (you can download the latest version from GitHub — link to the miner)
Ethminer miner settings for NVIDIA cards
(an example of a launcher *.bat -file)
ethminer.exe -U http://126.96.36.199:38391 --shard-id 1 --farm-recheck 200
Ethminer miner settings for AMD cards
(an example of a launcher *.bat — file)
Setx GPU_FORCE_64BIT_PTR 0
Setx GPU_MAX_HEAP_SIZE 100
Setx GPU_USE_SYNC_OBJECTS 1
Setx GPU_MAX_ALLOC_PERCENT 100
Setx GPU_SINGLE_ALLOC_PERCENT 100
ethminer.exe -G http://188.8.131.52:38391 --shard-id 1 --farm-recheck 200 --cl-local-work 256 --cl-global-work 8192
For mining you will need to replace this parameter
http://184.108.40.206:38391 on Your, here is changing only IP worded. You put the IP address of your cluster.-
The choice of subnets (shard) for mining is made by replacing the —shard-id 1 parameter according to the shard id list below:
For your convenience, I unload my *.bat — file. you need to place them in the folder with the downloaded Ethminer.exe and change the cluster IP address. You can check the miner and configure the graphics cards on my cluster. Once you have your cluster synchronized, you can switch to it by simply replacing the IP address.
View the statistics of mining (temporary does not work)
as test tokens tQKC (1 block = 2.5 tQKC)
To view statistics in real time, I recommend to open a separate window with the command line,
They write the command line:
docker exec -it qkctest pypy3 quarkchain/tools/stats -i 5 -a YourWallet --ip localhost
Look like this:
A statistics output shows the following:
How is the calculation of the reward for mining in the test network — read this article.
I hope the manual will be useful, and everyone will take part in the test mining QuarkChain. We all will be happy.
All questions and recommendations we discuss in the English Quarkchain community: https://t.me/quarkchainio