Docker

Install docker on your VPS

curl -fsSL https://get.docker.com | bash -s docker

Establish a directory and initial the config.json

Make a new directory and enter it

mkdir node && cd node

Create a JSON Configuration File

touch config.json

Then, open the file in a text editor. The vim editor is used here as an example:

vim config.json

Paste the content below (You need to adjust the content on your own.)

Change Your-Node-Name on your own

{
  "chain": "testnet",
  "log-dir": "/log",
  "enable-console-log": true,
  "no-mdns": true,
  "validator": true,
  "unsafe-rpc-external": true,
  "offchain-worker": "when-authority",
  "rpc-methods": "unsafe",
  "log": "info,runtime=info",
  "port": 30333,
  "rpc-port": 8087,
  "pruning": "archive",
  "db-cache": 2048,
  "name": "Your-Node-Name",
  "base-path": "/data",
  "telemetry-url": "wss://telemetry-testnet.bevm.io/submit 1",
  "bootnodes": []
}

Run the node with Docker

Fetch the docker image

sudo docker pull btclayer2/bevm:testnet-v0.1.4

Run a docker container

sudo docker run -d --restart always --name bevm-node \
  -p 8087:8087 -p 30333:30333 \
  -v $PWD/config.json:/config.json -v $PWD/data:/data \
  -v $PWD/log:/log -v $PWD/keystore:/keystore \
  btclayer2/bevm:testnet-v0.1.4 /usr/local/bin/bevm \
  --config /config.json

Check the logs from your container

tail -f log/bevm.log

Check it on the telemetry

here

Enter the Validator Election Process ( After syncing the network )

To become a validator on the BEVM TestNet, you must enter the validator election process following these steps:

Create an account on the BEVM TestNet network.

Download a Chrome extension from here, and finish the establishment of an account on the extension.

After that, open the page which is the wallet frontend of BEVM TestNet.

Get your BEVM Faucet on twitter

The URL is here.

Register your own Validator node using the path below

Network>>Staking>>Accounts

The initialBond value must be at least 1000 BEVM, and then submit the transaction

Get your session keys by curl

Replace the "bevm-node" with your container name

sudo docker exec -it bevm-node /bin/bash

Dowmload cURL

apt update && apt install curl

Get your session key in the result

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

(Example) Copy the object result

0xcf888ade403573be237e2af023c5b5ff1e4fd24cb96893b034ca8d616fe551c96cccd879274db47800e2a035adef9d7657ee2579ceaf25a3bc507931e5e5241558764dd425290713cb62101ca62edf2bcfbeedc38b3ed36db080d0bb9561ba507a14389a5dbd1b5708314fb1bc204c384c41b4389e7add1b6bec10490ff52b7b

Set your session keys

Check the session key setting

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

Remember to replace your address

Find your node election on the wallet frontend

Some interpretations on election and node requirements

Backup Nodes

Due to the fact that improper deployment of nodes can lead to block production anomalies, which may incur certain penalties, it is advisable to set up additional backup nodes. Copy the same config.json configuration file and keys, and simply change the option to "validator=false." Start the backup node in "pruning=archive" mode. This way, if the main node encounters issues, the backup node can take over the work to avoid penalty.

Block verification

The rotation period for validation nodes Era = 12 Session = 12 * 5 Minutes = 1 hour

This means that after the setup is complete, you have to wait up to an hour for the new validation nodes to start producing blocks.

After being elected as a validator, if you see Prepared block for proposing at ... in the logs, it indicates that the node has successfully produced a block.

2024-01-30 17:39:42:008 INFO tokio-runtime-worker sc_basic_authorship::basic_authorship  🙌 Starting consensus session on top of parent 0xe05e784c7198ff0719411ed75fe3a207f7fdc89b0ed5e3fbae75a3f2a7bf5504
2024-01-30 17:39:42:021 INFO tokio-runtime-worker sc_basic_authorship::basic_authorship  🎁 Prepared block for proposing at 4002 (13 ms) [hash: 0x236a33a2f071abb9f0f4ee31a367b509c560018807bf21b454ea0d368cd8812a; parent_hash: 0xe05e…5504; extrinsics (4): [0x8d22…b8ad, 0x9b60…0aa1, 0xccdc…3742, 0x56df…c0a3]
2024-01-30 17:39:42:027 INFO tokio-runtime-worker babe  🔖 Pre-sealed block for proposal at 4002. Hash now 0x4c4eec78a6f480a337f2ddd79c5f839959d8e082e3ec9f4adc7f640f70d66024, previously 0x236a33a2f071abb9f0f4ee31a367b509c560018807bf21b454ea0d368cd8812a.

Validator Node Election

Disqualified from running

When the validator node's reward pool is penalized to zero or subject to other penalties, the validator node is removed from the current validator set and becomes a candidate for re-election. To participate in staking again, they need to manually re-enter the election.

Opt out voluntarily

When you want to drop your node or do anything that will cause your node machine down, you need to drop your role on your own firstly to avoid the penalties.

After the signatures, you will find you are dropped.

Run for election manually

If you want to be in line for the node, you can click the "Candidate" here to unlock more operations.

After the signatures, you will find you are in waiting.

Key Points

Before the first halving (which occurs every 4 years), 625 BEVM are issued for every 5-minute session, with 20% going directly to validators and 80% temporarily stored in their reward pool.

Validator elections take place every 12 sessions (1 hour).

If a node's self-staked amount is less than 100 BEVM or the total number of votes received is less than 1000 BEVM, it will be forcibly retired from the validator election.

Validator nodes in candidate status are neither rewarded nor penalized.

Node Penalty

BEVM rewards each session but also penalizes nodes that may act maliciously. Typical penalties include penalties for double-signing and node offlining. If a node is discovered to be acting maliciously, the rewards due for that node in the session will be entirely penalized into the Treasury, and the node's reward pool will be penalized in accordance with the malice coefficient reported on the chain, which is:

penalty = max(session_bevm_reward + reward_pot_balance * F, minimum_penalty)

BEVM verification nodes, when found to be malicious, are not penalized by losing their principal investment nor the BTC gas in the prize pool; instead, the penalty is exacted from the BEVM in the node's prize pool.

Once the node's prize pool has been completely depleted by penalties, the node is forcibly deselected.

if penalty > reward_pot_balance {
// force the validator(offender) to be chilled
}

Last updated