Aptos AIT2 Validator Install Guide

AIT2 is complete and closed down.

Please look at our guide for AIT3.

Prerequisites

We strongly recommend that you run your node from a cloud provider or from a data center. Under no circumstances should you attempt to run a node from your home. The vast majority of homes do not have redundant power and internet connectivity, which means that it is likely that your node will be disconnected from the network at some point in time and you will not earn rewards.

Hardware Requirements

As of the time of this writing, the hardware requirements for AIT-2 are quite small. Please check the official documentation for the most up to date information.

  • CPU: 4 cores (Intel Xeon Skylake or newer).
  • Memory: 8GiB RAM.
  • 300GB SSD

Operating System

This guide has been tested on Ubuntu 20.04 and does work. Please be aware that as of the time of this writing, the rust compiler will break if you run it from Ubuntu 22.04. The Aptos team is aware and is diagnosing.

Initial Setup

Once you have logged into your Ubuntu 20.04 virtual server as root, the first step is to update your OS and install two packages: git and fail2ban.

sudo apt-get update -y && sudo apt-get upgrade -y && sudo apt-get install git -y && sudo apt-get install fail2ban -y
sudo ufw allow proto tcp from any to any port 6180
sudo ufw allow proto tcp from any to any port 8080
sudo ufw allow proto tcp from any to any port 9101
sudo ufw enable
adduser aptosnode
usermod -aG sudo aptosnode
chown -R aptosnode:aptosnode /home/aptosnode/
rsync --archive --chown=aptosnode:aptosnode ~/.ssh /home/aptosnode

Compile Aptos

Now that you are logged in as aptosnode, the next step is to download the Aptos source code and compile it. This process does take a long time, be patient.

cd ~
git clone https://github.com/aptos-labs/aptos-core.git
cd aptos-core
./scripts/dev_setup.sh
source ~/.cargo/envgit checkout --track origin/testnet
export WORKSPACE=testnet
mkdir ~/$WORKSPACE
cargo run --release -p aptos -- genesis generate-keys --output-dir ~/$WORKSPACE
cargo run --release -p aptos -- genesis set-validator-configuration \
--keys-dir ~/$WORKSPACE --local-repository-dir ~/$WORKSPACE \
--username yourNodeName \
--validator-host your.server.ip.address:6180
----EXAMPLE COMMAND! DO NOT ACTUALLY RUN THIS!----
cargo run --release -p aptos -- genesis set-validator-configuration \
--keys-dir ~/$WORKSPACE --local-repository-dir ~/$WORKSPACE \
--username l33tNodes \
--validator-host 192.168.0.66:6180
sudo nano ~/$WORKSPACE/layout.yaml
---
root_key: "F22409A93D1CD12D2FC92B5F8EB84CDCD24C348E32B3E7A720F3D2E288E63394"
users:
- "<username you specified from previous step>"
chain_id: 40
min_stake: 0
max_stake: 100000
min_lockup_duration_secs: 0
max_lockup_duration_secs: 2592000
epoch_duration_secs: 86400
initial_lockup_timestamp: 1656615600
min_price_per_gas_unit: 1
allow_new_validators: true
---   EXAMPLE! DO NOT ACTUALLY USE THIS!!! ---
root_key: "F22409A93D1CD12D2FC92B5F8EB84CDCD24C348E32B3E7A720F3D2E288E63394"
users:
- "l33tNodes"
chain_id: 40
min_stake: 0
max_stake: 100000
min_lockup_duration_secs: 0
max_lockup_duration_secs: 2592000
epoch_duration_secs: 86400
initial_lockup_timestamp: 1656615600
min_price_per_gas_unit: 1
allow_new_validators: true
cargo run --release --package framework -- --package aptos-framework --output current
mkdir ~/$WORKSPACE/framework
mv aptos-framework/releases/artifacts/current/build/**/bytecode_modules/*.mv ~/$WORKSPACE/framework/
mv aptos-framework/releases/artifacts/current/build/**/bytecode_modules/dependencies/**/*.mv ~/$WORKSPACE/framework/
cargo run --release -p aptos -- genesis generate-genesis --local-repository-dir ~/$WORKSPACE --output-dir ~/$WORKSPACE
mkdir ~/$WORKSPACE/config
cp docker/compose/aptos-node/validator.yaml ~/$WORKSPACE/validator.yaml
cp docker/compose/aptos-node/fullnode.yaml ~/$WORKSPACE/fullnode.yaml
sudo nano ~/$WORKSPACE/validator.yaml
base:
role: "validator"
data_dir: "/home/aptosnode/testnet/data"
waypoint:
from_file: "/home/aptosnode/testnet/waypoint.txt"
consensus:
safety_rules:
service:
type: "local"
backend:
type: "on_disk_storage"
path: /home/aptosnode/testnet/data/secure-data.json
namespace: ~
initial_safety_rules_config:
from_file:
waypoint:
from_file: /home/aptosnode/testnet/waypoint.txt
identity_blob_path: /home/aptosnode/testnet/validator-identity.yaml
quorum_store_poll_count: 1
execution:
genesis_file_location: "/home/aptosnode/testnet/genesis.blob"
concurrency_level: 4
validator_network:
discovery_method: "onchain"
mutual_authentication: true
identity:
type: "from_file"
path: /home/aptosnode/testnet/validator-identity.yaml
full_node_networks:
- network_id:
private: "vfn"
listen_address: "/ip4/0.0.0.0/tcp/6181"
identity:
type: "from_config"
key: "b0f405a3e75516763c43a2ae1d70423699f34cd68fa9f8c6bb2d67aa87d0af69"
peer_id: "00000000000000000000000000000000d58bc7bb154b38039bc9096ce04e1237"
api:
enabled: true
address: "0.0.0.0:8080"
cargo run -p aptos-node --release -- -f ~/$WORKSPACE/validator.yaml

Set up Aptos as a Service

This is a critical step, do not skip this.

cd ~/aptos-core
cargo build -p aptos-node --release
sudo nano /etc/systemd/system/aptosd.service
[Unit]
Description=Aptos Daemon
After=network-online.target
[Service]
User=REPLACE_WITH_YOUR_USERNAME
ExecStart=/home/REPLACE_WITH_YOUR_USERNAME/aptos-core/target/release/aptos-node --config /home/REPLACE_WITH_YOUR_USERNAME/testnet/validator.yaml
Restart=always
RestartSec=5
LimitNOFILE=infinity
[Install]
WantedBy=multi-user.target
sudo -S systemctl daemon-reload
sudo -S systemctl enable aptosd
sudo -S systemctl start aptosd
sudo journalctl -f -u aptosd
sudo -S systemctl stop aptosd

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Artifact Staking

Artifact Staking

105 Followers

Artifact Staking is a cutting edge, forward leaning blockchain infrastructure provider.