Aptos Incentivized Testnet Guideline based on aptos source

Part01: Preparation

Update packages:

sudo apt update && sudo apt upgrade -y

Intall dependencies:

sudo apt-get install jq unzip -y

Screen installation

when he asks you to press Y and then ENTER on your keyboard

Install git:

Press Y and Enter

Install cargo:

Press Y and Enter

Part02: Download Aptos Core/ prepare your developer environment/Install Aptos Cli

Clone the Aptos Repo:

git clone https://github.com/aptos-labs/aptos-core.git

And

cd aptos-core

Prepare your developer environment:

./scripts/dev_setup.sh

Press y and Enter

Update your current shell environment

source ~/.cargo/env

install aptos cli:

cargo install --git https://github.com/aptos-labs/aptos-core.git aptos --branch testnet

Part05: Setup Your Validator Node

Checkout the testnet:

git checkout --track origin/testnet

Create a directory for your Aptos node composition:

export WORKSPACE=testnet
export USERNAME=XXXXXXXX
mkdir ~/$WORKSPACE

Remplace XXXXXX by a username libe below for example

export WORKSPACE=testnet
export USERNAME=jackal
mkdir ~/$WORKSPACE

Generate key pairs

aptos genesis generate-keys --output-dir ~/$WORKSPACE/keys

This will create 4files: public-keys.yaml,private-keys.yaml, validator-identity.yaml, validator-full-node-identity.yaml for you. IMPORTANT: Backup your key files somewhere safe. These key files are important for you to establish ownership of your node, and you will use this information to claim your rewards later if eligible. Never share those keys with anyone else.

Open “public-Keys.yaml” with this command:

sudo nano /root/testnet/keys/public-keys.yaml

Save all information in a notepad and Press CTRL+X to quit

Open “private-Keys.yaml” with this command:

sudo nano /root/testnet/keys/private-keys.yaml

Save all information in a notepad and Press CTRL+X to quit

Open “validator-identity.yaml” with this command:

sudo nano /root/testnet/keys/validator-identity.yaml

Save all information in a notepad and Press CTRL+X to quit

Open “validator-full-node-identity” with this command:

sudo nano /root/testnet/keys/validator-full-node-identity.yaml

Save all information in a notepad and Press CTRL+X to quit

I save the all information in a notepad like below:

Part3: Configure your Validator

aptos genesis set-validator-configuration \
    --local-repository-dir ~/$WORKSPACE \
    --username xxxxxxxxx \
    --owner-public-identity-file ~/$WORKSPACE/keys/public-keys.yaml \
    --validator-host 35.232.235.205:6180 \
    --full-node-host 34.135.169.144:6182 \
    --stake-amount 100000000000000

Replace xxxxxx by your “node name” like the example below:

aptos genesis set-validator-configuration \
    --local-repository-dir ~/$WORKSPACE \
    --username jackal \
    --owner-public-identity-file ~/$WORKSPACE/keys/public-keys.yaml \
    --validator-host 35.232.235.205:6180 \
    --full-node-host 34.135.169.144:6182 \
    --stake-amount 100000000000000

This will create a YAML file in your working directory with your username

Please check with this command:

sudo nano /root/testnet/xxxxxxx/operator.yaml

Replace xxxxxxx by your username like below:

sudo nano /root/testnet/jackal/operator.yaml

And this command:

sudo nano /root/testnet/xxxxxxx/owner.yaml

Replace xxxxxxx by your username like below:

sudo nano /root/testnet/jackal/owner.yaml

Save all information in your notepad!!! Please CTRL+X to quit

Create layout YAML file, which defines the node in the validator:

aptos genesis generate-layout-template --output-file ~/$WORKSPACE/layout.yaml

And

vi ~/$WORKSPACE/layout.yaml

Delete all information and Paste the following information into this window:

---
root_key: "D04470F43AB6AEAA4EB616B72128881EEF77346F2075FFE68E14BA7DEBD8095E"
users: ["xxxxxxxxxx"]
chain_id: 43
allow_new_validators: false
epoch_duration_secs: 7200
is_test: true
min_stake: 100000000000000
min_voting_threshold: 100000000000000
max_stake: 100000000000000000
recurring_lockup_duration_secs: 86400
required_proposer_stake: 100000000000000
rewards_apy_percentage: 10
voting_duration_secs: 43200
voting_power_increase_limit: 20

Replace xxxxxx by your “node name” like the example below:

---
root_key: "D04470F43AB6AEAA4EB616B72128881EEF77346F2075FFE68E14BA7DEBD8095E"
users: ["jackal"]
chain_id: 43
allow_new_validators: false
epoch_duration_secs: 7200
is_test: true
min_stake: 100000000000000
min_voting_threshold: 100000000000000
max_stake: 100000000000000000
recurring_lockup_duration_secs: 86400
required_proposer_stake: 100000000000000
rewards_apy_percentage: 10
voting_duration_secs: 43200
voting_power_increase_limit: 20

For save write only “**: w*” without move and press Enter*

Output

For quit write “: q” and finally press Enter

Part4: Framework

Build AptosFramework Move bytecode and copy into the framework folder:

cargo run --package framework -- release
cp head.mrb ~/$WORKSPACE/framework.mrb

Part5: Compile genesis

Compile genesis blob and waypoint with this comand:

aptos genesis generate-genesis --local-repository-dir ~/$WORKSPACE --output-dir ~/$WORKSPACE

This will create two files, genesis.blob and waypoint.txt, in your working directory.

And now copy the validator.yaml, fullnode.yaml files into this directory with thos command:

mkdir ~/$WORKSPACE/config
cp docker/compose/aptos-node/validator.yaml ~/$WORKSPACE/validator.yaml
cp docker/compose/aptos-node/fullnode.yaml ~/$WORKSPACE/fullnode.yaml

Part6: Modify the Config

Open your config file:

sudo nano /root/testnet/validator.yaml

And now modify the config file to update the key path, genesis file path, waypoint path:

Before modification

Replace the blue areas with the information below:

/root/testnet/

Replace the yellow areas with the information below:

/root/testnet/keys/

After the modification:

After modification

Now press CTRL+X

Press Y

Press Enter

Part7:Open ports

Go to the root:

cd $home

And use this command

apt install ufw -y 
ufw allow ssh 
ufw allow https 
ufw allow http 
ufw allow 6180 
ufw allow 80 
ufw allow 9101 
ufw allow 181 
ufw allow 182 
ufw allow 8080 
ufw allow 9103 
ufw enable

Press enter

Press y and Enter

Part8: Launch your validator node

Start your local Validator by running the below command:

cd aptos-core

Create a screen session called “aptos-core”:

screen -S aptos-core
cargo run -p aptos-node --release -- -f ~/testnet/validator.yaml

Please Wait…

Press Ctrl+A then D

Now you can close Putty

Part9: Check your Validator Node Status

Please click here

Congratulation Everything it’s OK!

Part13: Register your validator node

Please click here

Warning: If you have a problem with the consensus pop format it’s because you didn’t copy all the consensus pop info, go to the right and you will understand

sudo nano /root/testnet/keys/public-keys.yaml

If you have a error message. refresh the page and click and second time “Validate node” button.

Best of luck.