Aptos Incentivized Testnet Docker Guide Eng
May 15, 2022
AptosLabs Building the safest and most scalable Layer 1 blockchain
- Official Guide
- Incentivized Testnet Registration
- Check Node Status: https://node.aptos.zvalid.com/
- My discord: drawrowfly#4024
Latest Update on 15 May 2022
-Content
-Few Notes:
- This is not official guide
- Min hardware requirements: CPU: Intel Xeon Skylake or newer, 4 cores, 8GB RAM
- I have tested this guide on Ubuntu 20.04.4 LTS
-Linux Setup
Option 1 (Docker)
Run Validator/Full Node with one-line script. Tested on Ubuntu 20.04.4 LTS. In can take from 1-5 minutes to setup node through this option.
wget -q -O aptos_docker_ait1.sh https://api.zvalid.com/aptos_docker_ait1.sh && chmod +x aptos_docker_ait1.sh && sudo /bin/bash aptos_docker_ait1.shAfter node instal you will see output with keys that are required to register in to the Incentivized Testnet
==============VALIDATOR/FULL NODE DETAILS==========
VALIDATOR CONSENSUS KEY:
0x087f86764c8a077933061e81346e4740fc0039cceb613b9a9b524c91e0fdc3f9
VALIDATOR ACCOUNT KEY:
0x3267aa313e6b47e87ee9b3834e2c0e928892d5a5811d6a4b420d0fe775ab371e
VALIDATOR NETWORK KEY:
0xa0a52ff76c999888117c323a2713ca2c4595db25d62ae8f2c543df6ece8b0267
FULLNODE NETWORK KEY:
0x184713803d6ac5405c048ea75a9c841a04c93ea6d28d393c6d82879a64d81d09
==================================================View keys required to register in to the Incentivized Testnet
cat $HOME/.aptos/YOUR_NODE_NAME.yamlCheck full node sync status
curl 127.0.0.1:9103/metrics 2> /dev/null | grep aptos_state_sync_version | grep typeCheck validator node sync status
curl 127.0.0.1:9101/metrics 2> /dev/null | grep aptos_state_sync_version | grep typeFull node logs
docker logs -f aptos-fullnode-1 --tail 5000Validator node logs
docker logs -f aptos-validator-1 --tail 5000Stop validator/full node
cd ~/.aptos && docker compose stopRestart validator/full node
cd ~/.aptos && docker compose restartStart validator/full node
cd ~/.aptos && docker compose up -dRemove Node Option 1
cd $HOME/.aptosdocker compose down -vrm -rf $HOME/.aptosOld Guide: FullNode
Content
-Few Notes:
- This is not official guide
- One-line script will automaticaly generate a unique static identity for your node
- Aptos is in devnet stage - no rewards for now
- Incentivized testnet will start 2022 Q2
- Mainnet in 2022 Q3
- Production grade Fullnode min. recommended: CPU: Intel Xeon Skylake or newer, 4 cores, 8GB RAM
- Development or testing purpose Fullnode min. recommended: CPU: 2 cores, 4GB RAM
- I have tested this guide on Ubuntu 20.04.4 LTS
-Update peer list
If you have used our guide to setup the Aptos FullNode and started having synchronisation problems then you can use this one-line script to automatically update the list of peers. After execute script below your node will be automatically restarted. You can execute following script at any point of time. Eventually i will add more peers to the list.
wget -q -O aptos_renew_seeds.sh https://api.zvalid.com/aptos_renew_seeds.sh && chmod +x aptos_renew_seeds.sh && sudo /bin/bash aptos_renew_seeds.sh-View your identity details
If you have used our guide to setup the Aptos FullNode and have no idea how to view your peer_id, public_key and private_key details then you can use this one-line script to view them. And if you would like to share your upstream peer id with other users to support the network you can use same script to view the details.
wget -q -O aptos_identity.sh https://api.zvalid.com/aptos_identity.sh && chmod +x aptos_identity.sh && sudo /bin/bash aptos_identity.shExample output:

-Linux Setup
Option 1 (systemctl)
Compile from source code and run FullNode as systemctl service + generate a unique static node identity with one-line script. Tested on Ubuntu 20.04.4 LTS. In can take from 10 minutes to few hours to setup node through this option. This option is good in case if setup through Docker didn’t worked then you can use this option to run the node.
Installation time from 10 minutes to few hours
If there was a new release update you can use same one-line script to renew your node. Your private key will stay the same!
wget -q -O aptos.sh https://api.zvalid.com/aptos2.sh && chmod +x aptos.sh && sudo /bin/bash aptos.shAll node identity related files will be saved to your hdd
To view private key
cat $HOME/aptos/identity/private-key.txtTo view public identity details
cat $HOME/aptos/identity/peer-info.yamlView logs
journalctl -u aptos-fullnode -fStop node
systemctl stop aptos-fullnodeStart node
systemctl start aptos-fullnodeDelete Node Option 1
systemctl stop aptos-fullnodesystemctl disable aptos-fullnoderm /etc/systemd/system/aptos-fullnode.servicerm -rf $HOME/aptosrm -rf /opt/aptosOption 2 (Docker)
Run FullNode + generate a unique static node identity with one-line script. Tested on Ubuntu 20.04.4 LTS. In can take from 5-10 minutes to setup node through this option.
Installation time from 5-10 minutes
If there was a new release update you can use same one-line script to renew your node. Your private key will stay the same!
wget -q -O aptos.sh https://api.zvalid.com/aptos.sh && chmod +x aptos.sh && sudo /bin/bash aptos.shAll node identity related files will be saved to your hdd
To view private key
cat $HOME/aptos/identity/private-key.txtTo view public identity details
cat $HOME/aptos/identity/peer-info.yamlView logs
cd $HOME/aptosdocker compose logs -f --tail 1000Stop node
cd $HOME/aptosdocker compose stopStart node
cd $HOME/aptosdocker compose startDelete Node Option 2
cd $HOME/aptosdocker compose down -vrm -rf $HOME/aptosOption 3 (Docker - diy)
Do it yourself. Tested on Ubuntu 20.04.4 LTS.
Installation time from 10-30 minutes
- Install docker (if not installed)
sudo apt updatesudo apt install ca-certificates curl gnupg lsb-release wget jq sed -ycurl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpgecho "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/nullsudo apt updatesudo apt install docker-ce docker-ce-cli containerd.io -yTesting
docker version
## If there are no errors in terminal then you are good to go
Client: Docker Engine - Communityю...- Install docker compose v2 (if not installed)
mkdir -p ~/.docker/cli-plugins/curl -SL https://github.com/docker/compose/releases/download/v2.2.3/docker-compose-linux-x86_64 -o ~/.docker/cli-plugins/docker-composechmod +x ~/.docker/cli-plugins/docker-composesudo chown $USER /var/run/docker.sockTesting
docker compose version
## If there are no errors in terminal then you are good to go
Docker Compose version v2.2.3- Create aptos folder where we will download all config files
mkdir $HOME/aptoscd $HOME/aptoswget https://raw.githubusercontent.com/aptos-labs/aptos-core/main/docker/compose/public_full_node/docker-compose.yamlwget https://raw.githubusercontent.com/aptos-labs/aptos-core/main/docker/compose/public_full_node/public_full_node.yamlwget https://devnet.aptoslabs.com/genesis.blobwget https://devnet.aptoslabs.com/waypoint.txt- Create identity folder where we will save a static node identity details(files)
mkdir $HOME/aptos/identity- Generate a unique static node identity
docker run --rm --name aptos_tools -d -i aptoslab/tools:devnetdocker exec -it aptos_tools aptos-operational-tool generate-key --encoding hex --key-type x25519 --key-file $HOME/private-key.txtdocker exec -it aptos_tools cat $HOME/private-key.txt > $HOME/aptos/identity/private-key.txtdocker exec -it aptos_tools aptos-operational-tool extract-peer-from-file --encoding hex --key-file $HOME/private-key.txt --output-file $HOME/peer-info.yaml &> /dev/nulldocker exec -it aptos_tools cat $HOME/peer-info.yaml > $HOME/aptos/identity/peer-info.yamlPEER_ID=$(sed -n 5p $HOME/aptos/identity/peer-info.yaml | sed 's/ - \(.*\)/\1/')PRIVATE_KEY=$(cat $HOME/aptos/identity/private-key.txt)docker stop aptos_tools- Set node identity
cd $HOME/aptossed -i '/ discovery_method: "onchain"$/a\
identity:\
type: "from_config"\
key: "'$PRIVATE_KEY'"\
peer_id: "'$PEER_ID'"' public_full_node.yamlAll node identity related files will be saved to your hdd
To view private key
cat $HOME/aptos/identity/private-key.txtTo view public identity details
cat $HOME/aptos/identity/id.json- Start FullNode
docker compose up -d- Verify the correctness of your FullNode
curl 127.0.0.1:9101/metrics 2> /dev/null | grep aptos_state_sync_version | grep typeExample output
- To view docker logs (not required)
docker logs -f aptos-fullnode-1 --tail 5000Update Option 3
In case there was a new node release and you’ve used Option 3 to install the node, then you can update your node this way
Go to aptos config folder
cd $HOME/aptosStop Docker and remove all volumes
sudo docker compose down -vCheck if there is an updated version of aptos-validator Docker image
sudo docker pull aptoslab/validator:devnetCheck if there is an updated version of aptos-tools Docker image
sudo docker pull aptoslab/tools:devnetStart aptos-tools to renew peer id
sudo docker run --rm --name aptos_tools -d -i aptoslab/tools:devnetRenew peer id
sudo docker cp $HOME/aptos/identity/private-key.txt aptos_tools:/rootsudo docker exec -it aptos_tools aptos-operational-tool extract-peer-from-file --encoding hex --key-file $HOME/private-key.txt --output-file $HOME/peer-info.yamlsudo docker exec -it aptos_tools cat $HOME/peer-info.yaml > $HOME/aptos/identity/peer-info.yamlStop aptos-tools Docker
sudo docker stop aptos_toolsGet the new peer id
PEER_ID=$(sed -n 2p $HOME/aptos/identity/peer-info.yaml | sed 's/..$//')Set new peer id
sed -i -e "s/peer_id:.*/peer_id: \"$PEER_ID\"/" $HOME/aptos/public_full_node.yamlDelete old file genesis.blob
rm $HOME/aptos/genesis.blobDownload new file genesis.blob
wget -P $HOME/aptos https://devnet.aptoslabs.com/genesis.blobDelete old file waypoint.txt
rm $HOME/aptos/waypoint.txtDownload new file waypoint.txt
wget -P $HOME/aptos https://devnet.aptoslabs.com/waypoint.txtSet new waypoint.txt value in public_full_node.yaml
sed -i.bak 's/\(from_config: \).*/\1"'$(cat $HOME/aptos/waypoint.txt)'"/g' $HOME/aptos/public_full_node.yamlStart the node
sudo docker compose up -dDelete Node Option 2
cd $HOME/aptosdocker compose down -vrm -rf $HOME/aptosTwo ways to verify initial synchronization
1.Through terminal:
curl 127.0.0.1:9101/metrics 2> /dev/null | grep aptos_state_sync_version | grep typeCheers