Testnet Node
How to Join the Testnet#
You can run an aelf node using Docker (recommended) or GitHub binaries. Before starting, install the necessary tools and frameworks. Detailed instructions are in the environment setup section.
Steps to Set Up a Node:#
Minimum Configuration:#
Recommended Configuration:#
Note: For testing or dApp deployment, run a SideChain node only. Use the same configuration for multiple nodes on both MainChain and SideChain.
Time Syncing: Ensure your server is time-synced via NTP to avoid syncing issues.
Setup the Database#
We support Redis and SSDB. For testnet, we use SSDB snapshots. Configure two SSDB instances: one for chain database and one for state database.
Import the Snapshot Data#
1mkdir snapshot2cd snapshot3curl -O -s https://aelf-node.s3-ap-southeast-1.amazonaws.com/snapshot/testnet/download-mainchain-db.sh4sh download-mainchain-db.sh
1tar xvzf aelf-testnet-mainchain-chaindb-*.tar.gz2stop your chain database instance (ssdb server)3cp -r aelf-testnet-mainchain-chaindb-*/* /path/to/install/chaindb/ssdb/var/4start your chain database instance5ssdb-cli info
1tar xvzf aelf-testnet-mainchain-statedb-*.tar.gz2stop your state database instance (ssdb server)3cp -r aelf-testnet-mainchain-statedb-*/* /path/to/install/statedb/ssdb/var/4start your state database instance5ssdb-cli info
Node Configuration#
Generate Node Account#
1npm i -g aelf-command
1aelf-command create
Prepare Node Configuration#
1cd /tmp/2wget https://github.com/aelfProject/aelf/releases/download/v1.0.0-rc1/aelf-testnet-mainchain.zip3unzip aelf-testnet-mainchain.zip4mv aelf-testnet-mainchain /opt/aelf-node
1{2"Account": {3"NodeAccount": "your-node-account",4"NodeAccountPassword": "your-password"5},6"ConnectionStrings": {7"BlockchainDb": "redis://chain-db-server:port",8"StateDb": "redis://state-db-server:port"9},10"Network": {11"BootNodes": [12"node-ip:6800"13],14"ListeningPort": 680015},16"CrossChain": {17"Grpc": {18"LocalServerPort": 500019}20}21}
Running a Full Node#
With Docker#
1docker pull aelf/node:testnet-v1.6.02cd /opt/aelf-node3sh aelf-node.sh start aelf/node:testnet-v1.6.0
1sh aelf-node.sh stop
With Binary Release#
1cd /tmp/2wget https://github.com/aelfProject/aelf/releases/download/v1.0.0-rc1/aelf.zip3unzip aelf.zip4mv aelf /opt/aelf-node/5cd /opt/aelf-node6dotnet aelf/aelf.Launcher.dll
Check the Node#
To check the node, query its current block height:
1aelf-command get-blk-height -e http://your-node-ip:port
Running Side-Chains#
1cd /tmp/2wget https://github.com/aelfProject/aelf/releases/download/v1.0.0-rc1/aelf-testnet-sidechain1.zip3unzip aelf-testnet-sidechain1.zip4mv aelf-testnet-sidechain1 /opt/aelf-node
1{2"CrossChain": {3"Grpc": {4"ParentChainServerPort": 5000,5"ParentChainServerIp": "mainchain-ip",6"ListeningPort": 50017},8"ParentChainId": "aelf"9},10"Network": {11"BootNodes": [12"sidechain-bootnode-ip:6800"13],14"ListeningPort": 680015}16}
Note#
Each side chain has its own P2P network, add the mainnet sidechain nodes as peer:
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: 18 July 2024 04:33:14 GMT+0