Skip to content

Consensus Miners

Teddy Rogers edited this page Jul 15, 2022 · 55 revisions

Consensus miner operation manual

1. Mining equipment preparation and CESS wallet

Mining equipment configuration settings:



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. Clone cess-bootstrap

  • Clone cess-bootstrap with root privileges:
su

cd /root/

git clone https://github.com/CESSProject/cess-bootstrap.git
  • Enter the folder directory
cd /root/cess-bootstrap

4. Download executable files

1) Download the latest version of the cess-node executable. Click here to download

  • Move cess-node in the node directory
mv /root/cess-node /root/cess-bootstrap/node/

2) Download the latest version of the Scheduler executable files. Click here to download

  • Move cess-bootstrap/scheduler in the scheduler directory
mv /root/scheduler /root/cess-bootstrap/scheduler/

5. Modify the configuration file

  • Execute the following command to enter the interface for modifying the configuration file. Enter “i” to fill in your specific file information inside the quotation“ ”. Press ESC key to exit when done, then press colon ":" and enter “wq” to return to the operation interface.
vim /root/cess-bootstrap/scripts/config.sh
  • Operation demonstration
#------------------------------------------------#
# Please modify the scheduler configuration file #
#↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓#

# The ip address of this machine
ServiceAddr="127.0.0.1"

# The port of the scheduler service
ServicePort="8080"

# Scheduler data storage path
DataDir="/root/scheduler_data/"

# Controller account mnemonic is used to pay transaction gas fee
CtrlPrk="hello cess hello cess hello cess hello cess hello cess"

# Stash account address need to have one million TCESS
StashAcc="cXjhFfHZtzWXrW1xB9n5s2xAZbNzFAaDyvoxF4wAdcu4U5VyA"

#---------------------------------------------------#
# Please modify the configuration file of cess-node #
#↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓#
#This account is used to generate and confirm blocks
NodeSecretKey="hello cess hello cess hello cess hello cess hello cess"

6. Install cess-bootstrap

  • operation command
cd /root/cess-bootstrap/

sh cess_install.sh install
  • Operation demonstration

7. Run the consensus node

cess start
  • Query cess-node process
netstat -nlpt
  • Operation demonstration

8. Become a candidate consensus node

1) Generate Session Key

cd ..

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.

9. 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.

10. 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

11. Other operating instructions

  • Restart the consensus node
cess restart
  • Uninstall consensus node
cess uninstall
Clone this wiki locally