Running MultiNodes

Architecture

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

Multi-miner Architecture

System requirements

Minimum Configuration Requirements:

Resource
Specification

Recommended OS

Linux 64-bit Intel / AMD

# of CPU Cores

≥ 4

Memory

≥ 8 GB

Bandwidth

≥ 20 Mbps

Public Network IP

required

Linux Kernel Version

5.11 or higher

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

Storage environment requirements

Installation operation has certain requirements on the storage environment in the current host, and different configurations are required based on the disk configuration.

Multiple Disks

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.

Multi Disk

Repeat the above steps to partition /dev/sdc and create a filesystem, then mount it to the file directory: /mnt/cess_storage2

Single Disk

This procedure is suitable for environments with only one system disk.

Scene 1

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)

Scene 2

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.

Single Disk

1. Download and install multi-nodes client

2. Customize your own configuration

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.

  • TeeList: The public key of tee node, storage node will not use public tee nodes on chain if set custom tee nodes in config.yaml.

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

  • apiendpoint: An external IP address or domain which can be accessed by internet, default value: hostPublicIP:port.

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

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

  • Timeout: Timeout about storage miner transaction with chain.

  • 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 listen at this 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.

  • watchdog.auth: Auth Configuration for web

/opt/cess/mineradm/config.yaml Template as below:

3. Generate configuration

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:

4. Installation

Install all services

Install watchTower, rpc node, watchdog, watchdog-web and storage nodes services

Skip install rpcnode

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.

5. Common Operations

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

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

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

6. Upgrade mineradm client

Upgrade the mineradm client by execute command as below:

After the program update is completed, please regenerate your configuration as below:

Options help:

Last updated

Was this helpful?