From 2ba9ead6a1512317229277359a83fe3fceea03f7 Mon Sep 17 00:00:00 2001 From: vasmohi Date: Wed, 19 Jun 2024 23:26:41 +0530 Subject: [PATCH 1/2] Added join aelf testnet content --- docs/getting-started/join-aelf-testnet.md | 205 ++++++++++++++++++++++ 1 file changed, 205 insertions(+) create mode 100644 docs/getting-started/join-aelf-testnet.md diff --git a/docs/getting-started/join-aelf-testnet.md b/docs/getting-started/join-aelf-testnet.md new file mode 100644 index 00000000..328893e0 --- /dev/null +++ b/docs/getting-started/join-aelf-testnet.md @@ -0,0 +1,205 @@ +# 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: + +1. Download and load the database snapshot. +2. Download template settings and Docker run script. +3. Modify appsettings as needed. +4. Run and check the node. + +## Minimum Configuration: + +- c5.large or N2 instance: 2 vCPU, 4GiB RAM, 800GiB storage, 5 Mbps internet bandwidth + +## Recommended Configuration: + +- c5.xlarge or N2 instance: 4 vCPU, 8GiB RAM, 800GiB storage, 100 Mbps internet bandwidth + +**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 + +1. **Download Snapshot:** + + ```sh + mkdir snapshot + cd snapshot + curl -O -s https://aelf-node.s3-ap-southeast-1.amazonaws.com/snapshot/testnet/download-mainchain-db.sh + sh download-mainchain-db.sh + ``` + +2. **Restore Chain Database:** + + ```sh + tar xvzf aelf-testnet-mainchain-chaindb-*.tar.gz + stop your chain database instance (ssdb server) + cp -r aelf-testnet-mainchain-chaindb-*/* /path/to/install/chaindb/ssdb/var/ + start your chain database instance + ssdb-cli info + ``` + +3. **Restore State Database:** + + ```sh + tar xvzf aelf-testnet-mainchain-statedb-*.tar.gz + stop your state database instance (ssdb server) + cp -r aelf-testnet-mainchain-statedb-*/* /path/to/install/statedb/ssdb/var/ + start your state database instance + ssdb-cli info + ``` + +## Node Configuration + +### Generate Node Account + +1. **Install aelf-command:** + + ```sh + npm i -g aelf-command + ``` + +2. **Create Account:** + + ```sh + aelf-command create + ``` + + Follow the prompts and save the account info. + +### Prepare Node Configuration + +1. **Download Settings Template and Docker Script:** + + ```sh + cd /tmp/ + wget https://github.com/AElfProject/AElf/releases/download/v1.0.0-rc1/aelf-testnet-mainchain.zip + unzip aelf-testnet-mainchain.zip + mv aelf-testnet-mainchain /opt/aelf-node + ``` + +2. **Update appsettings.json:** + + ```json + { + "Account": { + "NodeAccount": "your-node-account", + "NodeAccountPassword": "your-password" + }, + "ConnectionStrings": { + "BlockchainDb": "redis://chain-db-server:port", + "StateDb": "redis://state-db-server:port" + }, + "Network": { + "BootNodes": [ + "node-ip:6800" + ], + "ListeningPort": 6800 + }, + "CrossChain": { + "Grpc": { + "LocalServerPort": 5000 + } + } + } + ``` + +## Running a Full Node + +### With Docker + +1. **Run Node:** + + ```sh + docker pull aelf/node:testnet-v1.6.0 + cd /opt/aelf-node + sh aelf-node.sh start aelf/node:testnet-v1.6.0 + ``` + +2. **Stop Node:** + + ```sh + sh aelf-node.sh stop + ``` + +### With Binary Release + +1. **Install .NET Core SDK 6.0.** +2. **Download and Run Node:** + + ```sh + cd /tmp/ + wget https://github.com/AElfProject/AElf/releases/download/v1.0.0-rc1/aelf.zip + unzip aelf.zip + mv aelf /opt/aelf-node/ + cd /opt/aelf-node + dotnet aelf/AElf.Launcher.dll + ``` + +## Check the Node + +To check the node, query its current block height: + +```sh +aelf-command get-blk-height -e http://your-node-ip:port +``` + +## Running Side-Chains + +1. **Download and Restore Snapshot Data.** +2. **Run Side-Chain Node:** + + ```sh + cd /tmp/ + wget https://github.com/AElfProject/AElf/releases/download/v1.0.0-rc1/aelf-testnet-sidechain1.zip + unzip aelf-testnet-sidechain1.zip + mv aelf-testnet-sidechain1 /opt/aelf-node + ``` + +3. **Update appsettings.SideChain.TestNet.json with your node information:** + + ```json + { + "CrossChain": { + "Grpc": { + "ParentChainServerPort": 5000, + "ParentChainServerIp": "mainchain-ip", + "ListeningPort": 5001 + }, + "ParentChainId": "AELF" + }, + "Network": { + "BootNodes": [ + "sidechain-bootnode-ip:6800" + ], + "ListeningPort": 6800 + } + } + ``` + +### Note + +Each side chain has its own P2P network, add the mainnet sidechain nodes as peer: + + ```sh + bootnode → ["xxx.xxxx.xxx.xxx:6800", "..."] + ``` + + ```json + { + "Network": { + "BootNodes": [ + "Add the right boot node according to sidechain" + ], + "ListeningPort": 6800 + } + } + ``` \ No newline at end of file From 2327be4ca4e0894d048eea0937aba268f720c991 Mon Sep 17 00:00:00 2001 From: vasmohi Date: Wed, 19 Jun 2024 23:53:13 +0530 Subject: [PATCH 2/2] Updated aelf keyword --- docs/getting-started/join-aelf-testnet.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/getting-started/join-aelf-testnet.md b/docs/getting-started/join-aelf-testnet.md index 328893e0..7d908662 100644 --- a/docs/getting-started/join-aelf-testnet.md +++ b/docs/getting-started/join-aelf-testnet.md @@ -1,6 +1,6 @@ # How to Join the Testnet -You can run an AElf node using Docker (recommended) or GitHub binaries. +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: @@ -81,7 +81,7 @@ We support Redis and SSDB. For testnet, we use SSDB snapshots. Configure two SSD ```sh cd /tmp/ - wget https://github.com/AElfProject/AElf/releases/download/v1.0.0-rc1/aelf-testnet-mainchain.zip + wget https://github.com/aelfProject/aelf/releases/download/v1.0.0-rc1/aelf-testnet-mainchain.zip unzip aelf-testnet-mainchain.zip mv aelf-testnet-mainchain /opt/aelf-node ``` @@ -137,11 +137,11 @@ We support Redis and SSDB. For testnet, we use SSDB snapshots. Configure two SSD ```sh cd /tmp/ - wget https://github.com/AElfProject/AElf/releases/download/v1.0.0-rc1/aelf.zip + wget https://github.com/aelfProject/aelf/releases/download/v1.0.0-rc1/aelf.zip unzip aelf.zip mv aelf /opt/aelf-node/ cd /opt/aelf-node - dotnet aelf/AElf.Launcher.dll + dotnet aelf/aelf.Launcher.dll ``` ## Check the Node @@ -159,7 +159,7 @@ aelf-command get-blk-height -e http://your-node-ip:port ```sh cd /tmp/ - wget https://github.com/AElfProject/AElf/releases/download/v1.0.0-rc1/aelf-testnet-sidechain1.zip + wget https://github.com/aelfProject/aelf/releases/download/v1.0.0-rc1/aelf-testnet-sidechain1.zip unzip aelf-testnet-sidechain1.zip mv aelf-testnet-sidechain1 /opt/aelf-node ``` @@ -174,7 +174,7 @@ aelf-command get-blk-height -e http://your-node-ip:port "ParentChainServerIp": "mainchain-ip", "ListeningPort": 5001 }, - "ParentChainId": "AELF" + "ParentChainId": "aelf" }, "Network": { "BootNodes": [