Run a Mainnet Node
How to Join the Mainnet#
There are two ways to run an aelf node: using Docker (recommended) or running binaries from GitHub. Before starting, you need to install some tools and frameworks. Command line instructions are provided for most dependencies. For complex needs, see the Environment setup section.
Steps to Set Up a Node#
Configuration Requirements#
Minimum Configuration:#
Recommended Configuration:#
Note:
Time Syncing: Ensure your server is time-synced via NTP to avoid syncing issues.
Setup the Database#
We support Redis and SSDB for storing node data. For mainnet, we provide snapshots for SSDB only. Configure two SSDB instances: one for the chain database and one for the state database (run on different machines for better performance).
Import the Snapshot Data#
1mkdir snapshot2cd snapshot
1curl -O -s https://aelf-backup.s3.ap-northeast-2.amazonaws.com/snapshot/mainnet/download-mainchain-db.sh
1sh download-mainchain-db.sh
1tar xvzf aelf-mainnet-mainchain-chaindb-*.tar.gz2stop your chain database instance (ssdb server)3cp -r aelf-mainnet-mainchain-chaindb-*/* /path/to/install/chaindb/ssdb/var/4start your chain database instance5enter ssdb console (ssdb-cli) use the "info" command to confirm that the data has been imported)
1tar xvzf aelf-mainnet-mainchain-statedb-*.tar.gz2stop your state database instance (ssdb server)3cp -r aelf-mainnet-mainchain-statedb-*/* /path/to/install/statedb/ssdb/var/4start your state database instance5enter ssdb console (ssdb-cli) use the "info" command to confirm that the data has been imported)
Node Configuration#
Generating the Node's Account#
1npm i -g aelf-command
1aelf-command create
Prepare Node Configuration#
1cd /tmp/2wget https://github.com/aelfProject/aelf/releases/download/v1.6.0/aelf-mainnet-mainchain.zip3unzip aelf-mainnet-mainchain.zip4mv aelf-mainnet-mainchain /opt/aelf-node
1{2"Account": {3"NodeAccount": "2Ue31YTuB5Szy7cnr3SCEGU2gtGi5uMQBYarYUR5oGin1sys6H",4"NodeAccountPassword": "**"5},6"ConnectionStrings": {7"BlockchainDb": "redis://your chain database server ip address:port",8"StateDb": "redis://your state database server ip address:port"9},10"Network": {11"BootNodes": [12"xxx.xxxx.xxx.xxx:6800"13],14"ListeningPort": 680015},16"CrossChain": {17"Grpc": {18"LocalServerPort": 500019}20}21}
Running a Full Node with Docker#
1docker pull aelf/node:mainnet-v1.6.02cd /opt/aelf-node3sh aelf-node.sh start aelf/node:mainnet-v1.6.0
1sh aelf-node.sh stop
Running a Full Node with the Binary Release#
1cd /tmp/2wget https://github.com/aelfProject/aelf/releases/download/v1.6.0/aelf.zip3unzip aelf.zip4mv aelf /opt/aelf-node/5cd /opt/aelf-node6dotnet aelf/aelf.Launcher.dll
Running a Full Node with the Source#
Check the Node#
Run the following command to check the node's block height:
1aelf-command get-blk-height -e http://your node ip address:port
Running Side-Chains#
1cd /tmp/2wget https://github.com/aelfProject/aelf/releases/download/v1.6.0/aelf-mainnet-sidechain1.zip3unzip aelf-mainnet-sidechain1.zip4mv aelf-mainnet-sidechain1 /opt/aelf-node
1{2"CrossChain": {3"Grpc": {4"ParentChainServerPort": 5001,5"ParentChainServerIp": "your mainchain ip address",6"ListeningPort": 50117},8"ParentChainId": "aelf",9"Economic": {10"SymbolListToPayTxFee": "WRITE,READ,STORAGE,TRAFFIC",11"SymbolListToPayRental": "CPU,RAM,DISK,NET"12}13},14"Network": {15"BootNodes": [16"sidechain-bootnode-ip:6800"17],18"ListeningPort": 680019}20}
Note#
Ensure P2P ports are open and configured correctly for node communication.
1h2bootnode → ["xxx.xxxx.xxx.xxx:6800", "..."]3```45```json6{7"Network": {8"BootNodes": [9"Add the right boot node according to sidechain"10],11"ListeningPort": 680012}13}14```
Edited on: 17 July 2024 03:29:40 GMT+0