Skip to content

Miner v0.0.4

Compare
Choose a tag to compare
released this 06 Sep 12:48
· 10 commits to main since this release

Quick Start Avis Miner

Follow this quick start guide to start miner on AVIS TestNet.

Please note that when the AVIS testnet is officially launched on September 7, it will be launched from the Genesis Block, so all previous mining rewards and transactions will be cleared.

1. Download Miner

Download in github release.

MacOS: miner-darwin.zip

Windows: miner-windows.zip

Linux: miner-linux.zip

MacOS

Download the file miner-darwin.zip and unzip the file.
Start terminal and go to the unzipped directory miner-darwin set executable permission with this command:

chmod 777 ./miner

Windows

Download the file miner-windows.zip and unzip the file.

Linux

Download the file miner-linux.zip and unzip the file.
Go to the unzipped directory miner-linux set executable permission with this command:

chmod 777 ./miner

2. Download ZKP ProveKey

Before starting to mine, you also need to download a ZKP ProveKey file.

Click this IPFS Download Link will download a file named QmNpJg4jDFE4LMNvZUzysZ2Ghvo4UJFcsjguYcx4dTfwKx.

Copy QmNpJg4jDFE4LMNvZUzysZ2Ghvo4UJFcsjguYcx4dTfwKx to the unzipped miner directory.

3.Set Keyfile

Note that miner works successfully only if the address from keyfile is staked. Staked mining in fortress wallet.

There are two ways to set the keyfile for miner:

First Way: Generate New Keyfile

The following command will generate a new keyfile named keyfile.jsonto derive you Miner Account. You can set a password for your keyfile and remember this password.

MacOS

Go to the unzipped directory miner-darwin in terminal and use this command:

./miner generate
Linux

Go to the unzipped directory miner-linux in command line and use this command:

./miner generate
Windows

Go to the unzipped directory miner-windows in command line and use this command:

./miner.exe generate

Second Way: Copy Existing Keyfile

If you have generated keyfile with fortress wallet, copy the keyfile into this directory (the same directory of the executable file miner).

4. Start Mining

The following command will startup miner with Miner Address derived from keyfile and set the Coinbase Address the same as Miner Address by default.

MacOS

Go to the unzipped directory miner-darwin in terminal and use this command:

./miner mine --key name_of_your_keyfile

Linux

Go to the unzipped directory miner-linux in command line and use this command:

./miner mine --key name_of_your_keyfile

Windows

Go to the unzipped directory miner-windows in command line and use this command:

./miner.exe mine --key name_of_your_keyfile

Enter keyfile password when the following prints:

Password: 

Then miner starts to initialize ZKP prover, includes compiling ZKP circuit and loading ZKP prove key. You can see the
followings in log:

INFO [08-24|15:56:41.152] Compiling ZKP circuit 
INFO [08-24|15:56:46.234] Loading ZKP prove key. This takes a few minutes

This may take 5 to 15 minutes, please wait. When the initialization success, the following prints in log:

INFO [08-24|16:02:46.363] Init ZKP Problem worker success! 
INFO [08-24|16:02:46.380] miner start

After miner starts, it waits for the new mining epoch, the following prints in log:

INFO [09-03|21:19:57.780] waiting for next mining epoch

Miners follow new blocks and keep working in the following process:

  1. Wait for new mining epoch. When it reaches a new epoch, log prints:
INFO [08-24|15:24:51.004] start new mining epoch
  1. Doing VRF and get the Challenged Height of this mining epoch. Log prints:
INFO [08-24|15:24:51.008] vrf finished                             challenge height=3015 index=15
  1. Wait till the blockchain reach Challenge Height.
    The waiting time is printed like the following. It will wait 420 seconds in this example.
INFO [09-03|21:21:13.180] waiting for challenge block              time duration (second)=420
  1. When reaches the Challenge height, miner start to solve the ZKP problem.
    It takes about 1 to 2 minutes, depending on your device.
INFO [09-03|21:28:13.140] start working ZKP problem
INFO [09-03|21:29:21.203] ZKP problem finished
  1. ZKP problem solved, miner submit result. Log prints:
INFO [08-24|15:27:25.153] submit work                              
miner address=<Your miner address>
coinbase address=<Your Coinbase address> 
score=114387952695245842542743197336030803861427527497199672381530456658266076847982
  1. Wait for the next epoch. Avis mining epoch interval is 100 blocks.
    The waiting duration is printed like the following.
    It will wait 294 seconds in this example.
INFO [09-03|21:36:24.472] waiting for next mining epoch            time duration (second)=294