Skip to content

Instantly share code, notes, and snippets.

@ninjaahhh
Created October 14, 2019 15:09
Show Gist options
  • Save ninjaahhh/6192de94637e270b5329dd091fbc4d4f to your computer and use it in GitHub Desktop.
Save ninjaahhh/6192de94637e270b5329dd091fbc4d4f to your computer and use it in GitHub Desktop.

Now you can use QuarkChain explorer's PoSW page to mine root chain with lower difficulty if you stake enough QKC. Following is a quick start.

To begin with, root chain miners need to meet two requirements to be able to mine with PoSW in effect:

  1. having enough stakes (1,000,000 QKC for 1 block allocation, with maximum allocation size 512);
  2. signing the submitted root block work with the correct signer specified by the root chain staking system contract (by default, it's the miner him/herself).

With this in mind, go to the explorer's PoSW page, you should find your staking information showing locking status, staking amount and corresponding mineable block allocation, signer and withdrawable time (if unlocked) right in the middle of the page. Their meanings are straightforward, with following notes:

  1. Locking status: stakes are effective only during LOCKED status (which is the default status). It will become UNLOCKED if you send an unlocking transaction.
  2. Withdrawable time: this will show up if you send an unlocking transaction, which will be 3 days + the moment you unlock the stakes.

To know more about the fundamental mechanism, please refer to QCEP-001.

The actions you can take as a stakes are:

  1. Add stakes
  2. Change signer: will be discussed in a later section. By default this should be the same as the miner him/herself
  3. Lock / Unlock: change the lock status
  4. Withdraw: after the withdrawable timestamp

Now comes to the signer part.

As outlined before, to make use of PoSW in root chain, the submitted root block needs to have a correct signature matching the staker's signer, which can by done by either setting ROOT_SIGNER_PRIVATE_KEY field in the cluster config (as shown in this commit); or setting up your own signing server which controls your signer's private key and signs the incoming mining work hash and submits back to the network.

And if you update the signer (say, using the web tool), the signature also needs to be updated, hence the private key. So, don't forget to make sure the miner/staker's PoSW setting is in sync with your cluster or signing server.

@jyouyj
Copy link

jyouyj commented Oct 14, 2019

If you download the binary code from release and use the CUDA GPU, please use the following command line,

ethminer -U http://$CLUSTER_IP:38391 --shard-id $SHARD_ID --cuda-devices $GPU_ID --farm-recheck $TIME --coinbase $COINBASE_ADDRESS
  • CLUSTER_IP defines the IP for the Quarkchain cluster.
  • --shard-id defines one specify shard to mine. shard id 9999 is for the root chain PoSW mining.
  • --cuda-devices defines specify GPUs to mine.
  • --farm-recheck defines check interval in milliseconds for changed work. For example 1000.
  • --coinbase defines your staker coinbase address. Please use 20 bytes address generated the same way as an Ethereum address.
  • -U is for the CUDA GPU and -G is for the AMD GPU.

One example for root chain PoSW is

ethminer -U http://fullnode.quarkchain.io:38391 --shard-id 9999 --farm-recheck 1000 --coinbase 0x1000000000000000000000000000000000000000

mainnet GPU mining shardID

Chain Shard Hash Algo Parameter for Ethminer shard ID
Root --- Ethash 9999

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