Running MultiNodes
Last updated
Last updated
Install multi-nodes can be illustrated as below:
watchTower: When there is a difference between the local storage node image and the official storage node image, watchtower will automatically pull the new official image, create a new miner, and then delete the old one.
storage node: A storage node communicate with each other via P2P. The ports configured in the config template are: 15001, 15002.
chain: A chain node. storage node query blockchain data through the chain node's 9944 port by default; chain nodes synchronize data among themselves through the default port: 30336.
watchdog: storage nodes monitor. can scrape node's data from different hosts and alert user when some exception occurs.
dashboard: The dashboard of storage node monitor. can display the storage node data in a web page.
Minimum Configuration Requirements:
Each storage node requires at least 4GB of RAM and 1 processor, and the chain node requires at least 2GB of RAM and 1 processor.
At least 10GB of RAM and 3 processors if running 2 storage nodes and 1 chain node at the same time
Installation operation has certain requirements on the storage environment in the current host, and different configurations are required based on the disk configuration.
As shown in the figure below, where /dev/sda
is the system disk, /dev/sdb
and /dev/sdc
is the data disk, users can directly partition and create file systems on the data disks, and finally mount the file systems to the working directory of the miner.
Repeat the above steps to partition /dev/sdc
and create a filesystem, then mount it to the file directory: /mnt/cess_storage2
In the case where a disk is divided into many partitions, when the disk is damaged, all storage nodes that use its partitions for work will be affected.
This procedure is suitable for environments with only one system disk.
As shown in the following example, if there is only one 50GB system disk, the Last sector value
of partition /dev/sda3
of disk /dev/sda
is already at its maximum value (50GB disk can not be partitioned anymore).
As shown above, the current system kernel is using this partition, so it can not modify the partition to build the running environment required for multi-nodes.
If the partition does not take up the entire disk and there is still storage space available for partitioning, you can configure the partition by referring to the configuration method of Multiple Disks.(In this situation, the running of multi-nodes will depend on this single disk)
As shown in the figure below, the current environment has only one /dev/nvme0n1
system disk with about 1.8T of storage space, which is partitioned three times, including /dev/nvme0n1p1
, /dev/nvme0n1p2
and /dev/nvme0n1p3
.
The current system relies on the virtual logical disk /dev/ubuntu-vg/ubuntu-lv
created in the third partition /dev/nvme0n1p3
. Since this virtual logical disk occupies only 100GB of storage space, you can configure a multi-nodes environment by using lvm
to create multiple virtual logical volumes on the remaining space.
Warning: If create multiple logic volumes on a single disk by lvm, then mount multiple logic volumes on different diskPath
, when the disk is damaged, all nodes relying on lvm will be affected!
After executing the above installation command, customize your own config file at: /opt/cess/mineradm/config.yaml
.
UseSpace: Storage capacity of the storage node, measured in GB.
UseCpu: Number of logical cores used by the storage node.
port: storage node use that port to communicat with each other, the port of each storage node must be different and not occupied by other process
diskPath: Absolute system path where the storage node run, requiring a file system to be mounted at this path.
earningsAcc: Used to receive mining rewards. Get earningsAcc and mnemonic
mnemonic: Account mnemonic, consisting of 12 words, with each storage node requiring a different mnemonic, set mnemonic as node's signatureAcc in /opt/cess/mineradm/config.yaml.
stakingAcc: Used to pay for staking TCESS. 4000 TCESS at least is required for stakingAcc(Get TCESS). SignatureAcc also can be a stakingAcc when delete property: stakingAcc or make it empty in /opt/cess/mineradm/config.yaml.
Storage Deposit: To keep the storage node in honoring its service commitment, the storage node account will have its native tokens locked for the storage amount pledged to offer. Current in testnet, it is 4,000 TCESS per TB. The pledged space is round up to the closest TB unit and locked for that amount multiply with 4,000 TCESS. The minimum locked token is also 4,000 TCESS.
chainWsUrl: As an RPC node for blockchain synchronization. The priority of miners[].chainWsUrl
is higher than node.chainWsUrl
in /opt/cess/mineradm/config.yaml.
backupChainWsUrls: Backup RPC nodes that can be official RPC nodes or other RPC nodes you know. The priority of miners[].backupChainWsUrls
is higher than node.backupChainWsUrls
in /opt/cess/mineradm/config.yaml.
watchdog.enable: enable watchdog to monitor the health of the storage node.
watchdog.apiUrl: a public url that can access to the watchdog service, user can set a dns resolution
and proxy service
to these watchdog server. default value: http://<host public ip>:$port
watchdog.port: watchdog server port
watchdog.hosts: watchdog server can scrape nodes data from these hosts, ip
is the host ip, port
is the port which docker daemon listen. TLS configuration must be set if scrape data from a host in a public network. how to set docker daemon tls
watchdog.alert: enable alert or not. Watchdog will send alert to the email address you set in watchdog.alert.email.receiver
and send webhook to the webhook url you set in watchdog.alert.webhook
if alert enable.
/opt/cess/mineradm/config.yaml Template as below:
The following command will generate config.yaml
for each storage node and generate docker-compose.yaml
based on the file located at: /opt/cess/mineradm/config.yaml
.
Generate each storage node configuration at $diskPath/miner/config.yaml
. For example, miner1's configuration generate at: /mnt/cess_storage1/miner/config.yaml
Generate docker-compose.yaml at /opt/cess/mineradm/build/docker-compose.yaml
If set enable watchdog service, its config will be generated at /opt/cess/mineradm/build/watchdog/config.yaml
Leave watchdog.apiUrl
empty in /opt/cess/mineradm/config.yaml
can set this value as http://<your public ip>:13081
automatically.
If you want access to the watchdog dashboard via a domain
, please set your domain in /opt/cess/mineradm/config.yaml
: watchdog.apiUrl and then re-run command: mineradm config generate
. Set your domain as apiUrl in /opt/cess/mineradm/build/docker-compose.yaml
: watchdog-web.environment.NEXT_PUBLIC_API_URL also has the same effect.
A nginx proxy example as below:
Install watchTower, rpc node, watchdog, watchdog-web and storage nodes services
If an official RPC node or other known RPC node is configured in the configuration file, you can skip starting a local RPC node with --skip-chain
.
Stop all services
Stop one or more specific service
Such as execute sudo mineradm stop miner1 miner2
to stop miner1
and miner2
Stop and remove all services
Stop and remove one or more specific service
Such as execute sudo mineradm down miner1
to remove miner1
Restart all services
Restart one or more specific service
Such as execute sudo mineradm restart miner1
to restart miner1
Get version information
Check services status
Pull and update images
Check local disk usage
View all storage nodes status
If you get the result of you are not registered as a storage miner yet...
, please allow several hours for the rpc node block synchronization when you first run.
Increase all storage nodes staking
Only all storage nodes signatureAcc(mnemonic) is the same as its stakingAcc can use this command, otherwise can only transfer staking to stakingAcc in browser manually.
Such as execute sudo mineradm miners increase staking 4000
to increase all storage nodes staking
Increase a specific storage node's staking
Make sure that the storage node's signatureAcc(mnemonic) is the same as its stakingAcc can use this command, otherwise can only transfer staking to stakingAcc in browser manually.
Such as sudo mineradm miners increase staking miner1 4000
Increase all storage nodes declaration space
space_amount unit: TiB, The declaration space
on chain is auto set by the value of UseSpace after round up to the closest TB
when the storage node first run
Before increase declaration space
, please make sure that the storage node have sufficient TCESS in stakingAcc
. For example, increase staking from 4000
to 8000
before increase declaration space
from 1 Tib
to 2 TiB
Execute: sudo mineradm miners stat
to check current declaration space
at first
After increase staking in stakingAcc, then execute sudo mineradm miners increase space 2
to increase all storage nodes staking declaration space to 2 TiB
Increase a specific storage node's declaration space
space_amount unit: TiB, command usage as same as above
Change all storage nodes UseSpace
UseSpace unit: GiB
The UseSpace
in each storage node is less or equal to declaration space
, the storage node can only use storage space less or equal to UseSpace
If set UseSpace to 2100 when storage node first run, that means the storage node declare 3 TiB space on the chain, if set UseSpace to 300 when storage node first run, that means declare 1 TiB space on the chain(at least 1 TB)
Example 1: The miner1's disk size is 1.5 TiB in current, but only set 800 GiB UseSpace for running, then you can run sudo mineradm tools set use-space miner1 1200
to increase UseSpace to 1200 GiB
Example 2: The miner1's disk size is 1.5 TiB in current, and set 1400 GiB UseSpace for running, so you can run sudo mineradm tools set use-space mienr1 1000
to decrease miner1's UseSpace to 1000 GiB if the result of used space
with mineradm miners stat
is less than 1000 GiB
If only declare 1 TiB on the chain, but set UseSpace greater than 1024 GiB, the additional UseSpace in storage node can not be used
Change a specific storage node's UseSpace
UseSpace unit: GiB, command usage as same as above
Query all storage nodes reward
Claim all storage nodes reward
Claim a specific storage node's reward
Such as sudo mineradm miners claim miner1
Update a storage node's earnings account
Such as change miner1's earningsAcc to $earnings_account: sudo mineradm miners update account miner1 $earnings_account
Update all storage nodes earnings account
The process of exiting the CESS network will last for hours, and forcing an exit in the middle of the process might make the storage node being punished.
Make all storage nodes exit the network of cess
Make a specific storage node exit the network of cess
Such as sudo mineradm miners exit miner1
Withdraw all storage nodes staking
After all storage nodes has exited CESS Network (see above), run
Withdraw a specific storage node's staking
After this node has exited CESS Network (see above), run
Remove the local chain data
Upgrade the mineradm client by execute command as below:
After the program update is completed, please regenerate your configuration as below:
Options help:
Resource | Specification |
---|---|