# Aptos Incentivized Testnet Guideline based on aptos source

By [Zara](https://paragraph.com/@mehrbanoo) · 2022-08-30

---

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**](https://ait.aptos-node.info/)

Congratulation Everything it’s OK!

**Part13: Register your validator node**

Please click [**here**](https://community.aptoslabs.com/)

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.

---

*Originally published on [Zara](https://paragraph.com/@mehrbanoo/aptos-incentivized-testnet-guideline-based-on-aptos-source)*
