Skip to content

Consensus Miners

hong edited this page Jul 25, 2023 · 55 revisions

Please refer to the most updated version!

Consensus miner operation manual

1. Mining equipment preparation and CESS wallet

Item Parameter
Recommended OS and Version Ubuntu_x64 18.04 or higher /CentOS 7.0 or higher
CPU Core ≥ 4
Memory (SGX encrypted memory) ≥ 64 GB
Bandwidth ≥ 5 M
Public network IP required
Intel SGX Enable required

Note:

  • The service CPU must support SGX (Software Guard Extensions) technology and FLC (Flexible Launch Control). The BIOS must support Intel SGX, and must enable the Intel SGX option. Please refer to the server manufacturer's BIOS guide to enable SGX functionality. Set the 'Intel Memory Size' in the BIOS: the maximum is 37.5% of the total memory, and the minimum is 5G. Check out the CPU models that support SGX: CPU models.

  • The machine must use a fixed public network IP. The traffic exit must be in the same network segment as the fixed public network IP. Execute the following command to confirm they are in the same network segment.

curl ifconfig.co

Detailed instruction of operating system installation is not given here because different operating systems have different installation methods and some basic software packages may not be found.

2. Create a CESS wallet account

  • Storage miner needs to create two accounts

    • Account 1 (Stash account): for consensus miner’s staking and it requires at least 1,000,001 TCESS.

    • Account 2 (Controller account): for paying gas fees and it requires at least 1 TCESS.

  • Please refer to the CESS Wallet section above for creating a CESS wallet. Please join CESS Discord miner support sub-channel to receive TCESS tokens for staking.

  • After the wallet account is created, navigate to CESS official blockchain explorer). Choose Network, click Staking > Account Actions > Stash under Network

  • Select both Stash Account and Controller Account.

Value bonded: 1,000,000 TCESS It is recommended to select the second option Stash Account as the reward receiving account (do not increase the amount at stake), which means that mining income will not automatically add to staking.

  • Click Bond > Sign and Submit to link between the Stash Account and the Controller Account

  • Wallet is created successfully:

3. Download and Install the cess-nodeadm

The cess-nodeadm is a CESS node deployment and management program. It can help deploy and manage storage nodes, consensus nodes and full nodes, lowering the operating threshold for CESS all miners.

wget https://github.com/CESSProject/cess-nodeadm/archive/v0.1.2.tar.gz
tar -xvf v0.1.2.tar.gz
cd cess-nodeadm-0.1.2
sudo ./install.sh

After executing the 'sudo ./install.sh' command and 'Install success' appears,the installation is successful.

If the following exception occurs, please execute the following commands, and all future CESS program commands must have sudo privileges.

sudo systemctl start docker

4. Add the consensus configuration

cess config set
root@aMUEwB1533:~/cess-nodeadm-0.1.1# cess config set
Enter cess node mode from 'authority/storage/watcher' (current: authority, press enter to skip): 
Enter cess node name (current: cess-739600, press enter to skip):
Enter external ip for the machine (current: 108.....215.27, press enter to skip): 
Enter cess chain ws url (current: ws://127.0.0.1:9944/, press enter to skip): 
Enter cess scheduler stash account (current: cXgAN.....aNK...cZj, press enter to skip): 
Enter cess scheduler controller phrase (current: venue symbol...... cheese, press enter to skip): 
Set configurations successfully

Start generate configurations and docker compose file
cess config generator
debug: Loading config file: config.yaml
info: Generating configurations done
info: Generating docker compose file done
872ce9fba8bccf1483581f1e5435e6315a361c03f3c2b6ee3c5ae5640f294658

Configurations generated at: /opt/cess/nodeadm/build
try pull images, node mode: authority
download image: cesslab/cess-scheduler:latest

If the following exception occurs, please execute the 'cess config set' command several times

'[ERROR] download image cesslab/cess-chain:latest failed, try again later'

5. Install consensus

 cess start

1) Generate Session Key

curl -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "author_rotateKeys", "params":[]}' http://localhost:9933

The field in the quotation marks after "result" is the Session Key(the highlighted part), which will be used in subsequent operations. "localhost:9933" is the default port.

  • Operation demonstration

2) Set up session key

  • Fill in the Session Key in the red box

  • Click Sign and Submit

3) Become a validator

  • Enter “100” in Reward Commission Percentage, indicating that the reward will not be distributed to others.

  • Select “No, block all nominations” in Allows New Nominations, indicating that no nominations will be accepted.

    • Again, click Sign and Submit

  • After completing the steps above, open the blockchain explorer and click Network > Staking > Waiting to see that the node has appeared in the candidate node list.

6. Other common commands

1) Inquiry miner status

cess status

Operation demonstration:

-----------------------------------------
    Service                    Status
-----------------------------------------
    chain                      running
    scheduler                  running
-----------------------------------------
  1. Examine config information
cess config show
  1. Update scheduler ip port
cess scheduler update_address ip port

7. Rewards redemption for consensus node

  • In Payouts, click Payout to initiate a payment. Any account can initiate a transaction.

Note: Please claim the reward within 84 era (each era of the test network is 6 hours), and those who have not claimed the reward in this period will not be able to claim it.

8. Instruction for exiting consensus mining operation

  • Execute the following command to stop the consensus mining operation.

1) Cooling consensus

  • Navigate to blockchain explorer: Network > Staking > Account Actions > Stop

2) Clear session keys

  • Blockchain explorer: Developer > Submission

  • Enter controller account in Using the Selected Account Controller. Then in Submit the At the Following Extrinsic, enter "session" and choose "purgeKeys()" in the box next to it.

  • Click Submit Transaction, enter password and click Sign and Submit to clear session keys!

3) Stake redemption

  • Blockchain explore: Network > Staking > Account Actions > Unbond Funds

4) Stop consensus miner server

cess stop

9. New version upgrade

1) stop consensus

cess stop

2) update the cess-nodeadm

wget https://github.com/CESSProject/cess-nodeadm/archive/v0.1.2.tar.gz
tar -xvf v0.1.2.tar.gz
cd cess-nodeadm-0.1.2
sudo ./install.sh --update --retain-config 

After executing the 'sudo ./install.sh' command and 'Install success' appears,the installation is successful.

If the following exception occurs, please execute the following commands, and all future CESS program commands must have sudo privileges.

sudo systemctl start docker

3) update config

cess config set
root@aMUEwB1533:~/cess-nodeadm-0.1.1# cess config set
Enter cess node mode from 'authority/storage/watcher' (current: authority, press enter to skip): 
Enter cess node name (current: cess-739600, press enter to skip):
Enter external ip for the machine (current: 108.....215.27, press enter to skip): 
Enter cess chain ws url (current: ws://127.0.0.1:9944/, press enter to skip): 
Enter cess scheduler stash account (current: cXgAN.....aNK...cZj, press enter to skip): 
Enter cess scheduler controller phrase (current: venue symbol...... cheese, press enter to skip): 
Set configurations successfully

Start generate configurations and docker compose file
cess config generator
debug: Loading config file: config.yaml
info: Generating configurations done
info: Generating docker compose file done
872ce9fba8bccf1483581f1e5435e6315a361c03f3c2b6ee3c5ae5640f294658

Configurations generated at: /opt/cess/nodeadm/build
try pull images, node mode: authority
download image: cesslab/cess-scheduler:latest

4) update images

cess tools upgrade-image chain
cess tools upgrade-image scheduler
cess tools upgrade-image config-gen
cess purge
cess config generate

5) start consensus

cess start

6) Generate Session Key

curl -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "author_rotateKeys", "params":[]}' http://localhost:9933

The field in the quotation marks after "result" is the Session Key(the highlighted part), which will be used in subsequent operations. "localhost:9933" is the default port.

  • Operation demonstration

7) Set up session key

  • Fill in the Session Key in the red box

  • Click Sign and Submit

8) Become a validator

  • Enter “100” in Reward Commission Percentage, indicating that the reward will not be distributed to others.

  • Select “No, block all nominations” in Allows New Nominations, indicating that no nominations will be accepted.

    • Again, click Sign and Submit

  • After completing the steps above, open the blockchain explorer and click Network > Staking > Waiting to see that the node has appeared in the candidate node list.