- Install dependencies and binaries
- Configure your node
- Configure public identity
- Run node
- Setup monitoring tool
# upgrade ubuntu
apt update && apt upgrade -y
# install yq:
sudo wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64
sudo chmod a+x /usr/local/bin/yq
# clone aptos repo
git clone https://github.com/aptos-labs/aptos-core.git
cd aptos-core
# install dependencies
./scripts/dev_setup.sh
# compile binaries
source ~/.cargo/env
git checkout --track origin/devnet
cargo build -p aptos-node --release
cargo build -p aptos-operational-tool --release
cp -t /usr/local/bin target/release/aptos-node target/release/aptos-operational-tool
# verify everything is installed
aptos-node --version
aptos-operational-tool --version
useradd -mU aptos -G sudo -s /usr/bin/bash
passwd aptos # set sudo password for aptos
# copy node config file
cp config/src/config/test_data/public_full_node.yaml /home/aptos/
chown aptos:aptos /home/aptos/public_full_node.yaml
# login as user
su - aptos
mkdir config && cd config
mv ../public_full_node.yaml .
# download genesis
wget https://devnet.aptoslabs.com/genesis.blob
# download waypoint.txt
wget https://devnet.aptoslabs.com/waypoint.txt
# configure config:
# set home directory to $HOME/.aptos
sed -i.bak "s|data_dir:.*|data_dir: \"$HOME/.aptos\"|" public_full_node.yaml
# set geensis.blob location
sed -i.bak "s|genesis_file_.*|genesis_file_location: \"$HOME/config/genesis.blob\"|" public_full_node.yaml
# set waypoint.txt location
sed -i.bak "s|from_file:.*|from_file: \"$HOME/config/waypoint.txt\"|" public_full_node.yaml
# make sure you're in config directory:
cd $HOME/config
mkdir keystore
# generate private key:
aptos-operational-tool generate-key --encoding hex --key-type x25519 --key-file keystore/private.key
# retrieve peer identity
aptos-operational-tool extract-peer-from-file --encoding hex --key-file keystore/private.key --output-file keystore/peer-info.yaml
# save values to variables:
PEER_ID=$(sed -n 2p keystore/peer-info.yaml | sed 's/.$//')
PRIVATE_KEY=$(cat keystore/private.key)
# set static identity
yq e -i '.full_node_networks[] += { "identity": {"type": "from_config", "key": "'$PRIVATE_KEY'", "peer_id": "'$PEER_ID'"} }' public_full_node.yaml
# allow others to connect
yq e -i '.full_node_networks[].listen_address="/ip4/0.0.0.0/tcp/6180"' public_full_node.yaml
You can run it in background using screen
or tmux
for example:
aptos-node -f $HOME/config/public_full_node.yaml
Or run this as a systemd service
sudo tee <<EOF >/dev/null /etc/systemd/system/aptosd.service
[Unit]
Description=Aptos Full Node
After=network-online.target
[Service]
User=$USER
ExecStart=$(which aptos-node) -f $HOME/config/public_full_node.yaml
Restart=on-failure
RestartSec=3
LimitNOFILE=4096
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl enable aptosd
sudo systemctl start aptosd
- free disk space is less than 20% and 10% - (low disk space notification)
- height is not changing - (network connection error notification)
- node proccess is not running - (node has been turned off)
- node hasn't peers - (no peers - no sync. It's important)
- Metrics port are not availabel - (just make sure you are geting metrics )
- root account on server
- telegram bot token .You can follow this instruction
- Reciever chat_id. Follow this guide to get your telegram id:
cd /root
apt install monit -y
# clone our repository:
git clone https://github.com/Validatrium/valmonit.git
# enable monitoring in monit configuration:
echo "
include /root/valmonit/conf/aptos-devnet/*
include /root/valmonit/conf/system
" >> /etc/monit/monitrc
# set your telegram.conf
cd $HOME/valmonit
cp telegram.conf.example telegram.conf
# enter your "telegram-id" and "bot-token"
nano telegram.conf
# verify that you can get notifications:
./bin/sendtelegram -m "hi there!" -c ./telegram.conf
# by default it's monitor metrics-port/9101
# if you run on other port you have to change it in:
nano sh/aptos/1rpc-conf.sh
# you can enable web interface for your monitoring tool:
# but it's not actually required
cat <<EOF >> /etc/monit/monitrc
set httpd port 2812 and # run on port 2812
use address 0.0.0.0 # run on internet interface
allow * # allow everyone connetc
allow admin:monit # user:password pair
EOF
# restart monitoring tool
systemctl restart monit
Tutorial created by Validatrium (more info on our projects at validatrium.com)
If you have any additional questions regarding this tutorial, please join Agoric official discord channel and tag Validatrium members.