Wasm Operation
1. Prerequisite
1.1 VPS Requirements
The simplest way is to use a cloud server. You can freely choose any hosting provider.
1.1.1 Mainnet Hardware Configuration
Taking AWS as an example, BEVM mainnet recommended configuration should not be lower than:
CPU: 4 cores
Memory: 16GB
Bandwidth: 50Mbps
Disk: SSD 300GB+
Operating System: Ubuntu 22.04+
Cloud servers need to open p2p port (default port=30333) to increase connectivity
1.2 Installing BEVM Using Docker
1.2.1 Configuration File
For validator nodes, we recommend the following configuration:
Replace "Your-Node-Name" with your node name
After the node starts successfully, you can see your node on BEVM Telemetry.
For Docker installation, refer here.
1.2.2 Using Docker Image
Place the above configuration file in the current directory, named config.json
. Run the following command:
Chain options:
chain=mainnet: BEVM mainnet
chain=testnet: BEVM-testnet (no longer maintained, may stop operation)
chain=signet: BEVM-signet (new test network started with BEVM v0.3.0)
Run the following command to start the node in the background:
Enter the container:
The parameters correspond to those in the configuration file. For background running Docker, you can check logs with:
When the logs show block synchronization starting, it indicates the node has started successfully:
If you need to use RPC service externally, add rpc-external: true
to the configuration file.
When configuring, it's recommended to change the name
item in the configuration file.
Port mapping must be consistent with config.json
, otherwise RPC will not work normally.
1.3 Direct Binary Download
Download the compiled binary from GitHub releases.
Sync to Latest Chain State
Start syncing the blockchain with this command:
Or start directly in validator mode for syncing:
Note: Make sure to wait for synchronization to complete and set up Session Keys before letting the node participate in election.
If synchronization is abnormal, ensure system time matches network time, delete the database, and resync.
1.4 Creating BEVM Account
You can create a BEVM account on wallet.bevm.io and transfer BEVM to this account for transaction fees and future staking costs.
2. Registering Validator Node
After creating a BEVM account, you can register as a validator node on wallet.bevm.io
Note:
(1) Validator node names only support numbers and letters (case-sensitive)
(2) Register transaction will charge 100 BEVM whether successful or not
(3) Each BEVM account can only register once.
(4) Before registering, ensure you have sufficient balance for transaction fees and self-voting amount (1000 BEVM in the example).
(5) Newly registered nodes are automatically nominated for election, no additional operation needed.
(6) Besides initial staking during registration, you can stake more through voting.
(7) After the election period ends, the top 40 nodes (parameter set through governance) by total stake will become validators participating in consensus.
Chain Account Registration:
router: identity -> setIdentity
3. Setting Session Keys
You can generate Session Keys by executing this command on your node machine:
Install curl: apt install curl
Where YOUR_RPC_PORT
is the port specified by rpc-port
when starting the node, default is 8087.
Example response:
The result
field is your Session Keys. Set them through setKeys
in Developer>Extrinsic:
Currently,
proof
can be set to0x
.
4. Binding EVM Address (Optional)
Binding an EVM address is prerequisite for becoming an L-BTC staking mining validator node (can accept LBTC token staking, participate in BEVM mining).
Validator nodes not participating in L-BTC staking mining (i.e., without bound EVM address) can still receive BTC gas rewards and BEVM transaction fee rewards(Different from the BEVM assigned with the Mother Consensus).
5. Checking Validator Node Setup
Four "true" values in response indicate complete setup:
These four values represent:
Whether nominated (validator.isChilled is false)
Whether meeting minimum voting amount (self-vote at least 100 BEVM and total votes at least 1000 BEVM)
Whether Session Keys are set
Whether participating in LBTC staking mining
5. Backup Node
Since improper node deployment causing block anomalies will be penalized, you can deploy backup nodes.
Copy the same config.json configuration and keys, just change "validator=false".
Start backup node in "pruning=archive" mode.
This way, when the main node has issues, the backup can take over to avoid penalties.
6. Verifying Block Production
Validator rotation period: Era = 4 Session = 4 * 1 hour = 4 hours
After setup, it takes up to 4 hours for new validators to produce blocks.
After being elected validator, seeing Prepared block for proposing at ...
in logs indicates successful block production:
7. Validator Withdrawal
7.1 Forced Withdrawal
When a validator's reward pool is penalized to 0 or other penalties occur, the validator is kicked out of the current validator set and becomes withdrawn. To rejoin staking, manual nomination is required.
7.2 Voluntary Withdrawal
7.3 Manual Nomination
8. Important Notes
Before first halving (every 4 years), each session (1 hour) issues 7500 BEVM, 20% directly to validators, 80% stored in their reward pool
Validator election occurs every 4 sessions (4 hours)
If node self-stake is less than 100 BEVM or total votes less than 1000 BEVM, will be forced to withdraw during validator election
Candidate status validators neither receive rewards nor penalties
9. Node Penalties
BEVM issues rewards each session while penalizing potentially malicious nodes. Penalty types generally include double-signing and node offline. Once malicious behavior is detected, the BTC gas rewards in the offending node's reward pool will be penalized to the Treasury according to the reported malicious coefficient:
penalty = max(reward_pot_balance * F, minimum_penalty)
Where:
penalty
: BTC gas amount to be penalizedreward_pot_balance
: Node's BE reward pool amountF
: Penalty coefficient, calculated by babe and im-online modules:im-online: Node offline penalty details
minimum_penalty
: Minimum penalty value, meaning each penalty is at leastminimum_penalty
.
BEVM validator node misconduct does not penalize BEVM principal and BEVM transaction fees, only penalizes BTC gas in the reward pool.
When a node's reward pool is completely penalized, the node will be forced to withdraw.
10. Validator Rewards Withdrawal (BTC and BEVM)
10.1 Wallets
For wasm account: https://wallet.bevm.io/ (need to install https://polkadot.js.org/extension/)
For evm account: Metamask Quick Add: https://chainlist.org/?search=BEVM+Mainnet
10.2 Query BTC and BEVM Balance
To query BTC balance and BEVM balance, use the respective interfaces in the wallet.
Query BTC Balance
Query BEVM Balance
10.3 Claim BTC and BEVM from Validator Spot to Wasm Account
Use the claim function in the wallet interface to transfer rewards from validator spot to your wasm account.
10.4 Deposit BTC from Wasm to EVM
Use the deposit function to transfer BTC from your wasm account to EVM account.
10.5 Deposit BEVM from Wasm to EVM
10.6 Bridge BTC to Bitcoin Mainnet
Visit https://www.bevm.io/bridge-mainnet to bridge your BTC to Bitcoin mainnet.
11. Multi-signature Account as Validator Node
The validator node operations for multi-signature accounts are the same as for regular accounts, with the difference being in multi-signature account interactions.
Multi-signature Account Reference Documents
Creating a multi-signature account: https://wallet.bevm.io/ (need to install https://polkadot.js.org/extension/)
Last updated