-
Notifications
You must be signed in to change notification settings - Fork 4
Miner EN
When the address on the chain has real identity, it means that the address on the chain is rare.Constructing Forward-Related VRF by Miner Signature(Verifiable Random Function),Combining BFT moving checkpoint rule.Ensuring the efficiency of the main useChain,and endowed the final confirmation of the transaction.Final confirmation of the transaction within an average of 25s.Similar to POS ,the RPOW algorithm removes computing power competition,avoid resource waste and reduce the performance requirements of nodes.Since a real identity will only correspond to a mining address, ensuring the performance of the transaction, the decentralized blockchain system of "1 person 1 vote" was truly realized.
It should be noted that registration as a miner must be the primary address and the certification is approved.
> use.getCertifications(use.coinbase)
Unlock the account in the Keystore with the password.
The format of the unlock is as follows, the password and unlock time are optional.It should be noted that the unlock duration defaults to 300 seconds.If the unlock duration is not set, the account will be restored to the locked state after the duration expires.As a result, it is impossible to continue mining. At this time, it is necessary to re-unlock to continue mining.Therefore, if you can be sure that there are no security risks, the duration parameter is recommended to be set to a bigger number,param of duration set to 0 to permanently unlock(For security reasons, the miner node should not open the rpc external port).
Client | Method |
---|---|
Console | personal.unlockAccount(address, passphrase, duration) |
JSON-RPC | {"method": "personal_unlockAccount", "params": [address, passphrase, duration]} |
> personal.unlockAccount(use.coinbase, passphrase, 500)
true
Miner must pay 50USE as a miner’s deposit for registration. In the Mainnet, if you want to become a miner, you must send a miner registration application to the chain smart contract; after the registration is successful, the miner can be released.
Client | Method |
---|---|
Console | use.minerRegister({from: address}) |
JSON-RPC | {"method": "use_minerRegister", "params": [{from: address}]} |
> use.minerRegister({from:use.accounts[0]})
or
> use.sendTransaction({from:use.accounts[0],to:"0xfffffffffffffffffffffffffffffffff0000002",value:web3.toHui(50, "use"),data:"0x819f163a", gas:2000000, gasPrice:20000000000})
After the miner registers operation, you can check whether the registration is successful use the address.
Client | Method |
---|---|
Console | use.isMiner(address) |
JSON-RPC | {"method": "use_isMiner", "params": [address]} |
> use.isMiner(address)
if return 1,that the miner registered successfully;and if return 0,this indicates that the registration has not been completed or the registration failed.
Mining in the Mainnet requires the registration of a miner's identity, and in the moonet you donn't need that.
Start CPU mining, you can choose the number of threads to start mining.
Client | Method |
---|---|
Console | miner.start(threads number) |
JSON-PRC | {"method": "miner_start", "params": [number]} |
> miner.start()
If you need to unregister the miner operation,you should send a unregister request to the miner registration smart contract, it is also send a transaction.It should be emphasized that because the RPOW consensus mechanism has a penalty mechanism for miners who are not online or who are not involved in mining, that is detained half of the deposit paid by the miner at the time of the registration operation.Therefore, it is recommended to unregister the miner before you need to shut down the machine or stop mining.Now in the non-punishment state, the unregister operation will return the all deposit.
Client | Method |
---|---|
Console | use.minerUnRegister({from: address}) |
JSON-PRC | {"method": "use_minerUnRegister", "params": [{from: address}]} |
> use.minerUnRegister({from: address})
Stop CPU mining
Client | Method |
---|---|
Console | miner.stop() |
JSON-PRC | {"method": "miner_stop", "params": []} |
> miner.stop()
true
This is the Wiki for the official Usechain golang implementation.