AIT3 Incentivized Testnet 节点搭建

机器要求一台 ubuntu 服务器 (AWS Ubuntu 22.04),最低配置如下

  • CPU:
    • 8 cores, 16 threads
    • 2.8GHz, or faster
    • Intel Xeon Skylake or newer
  • Memory: 32GB RAM.
  • 硬盘: 320 GB

节点安装流程

1. Ubuntu打补丁 22.04

sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install wget -y
sudo apt-get install unzip -y
sudo wget http://nz2.archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.16_amd64.deb
sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2.16_amd64.deb

2 安装 docker 和 docker-compose

sudo wget -O get-docker.sh https://get.docker.com &&sudo sh get-docker.sh && sudo rm -f get-docker.sh
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose && sudo chmod +x /usr/local/bin/docker-compose

3 安装aptos cli v0.3.1

wget https://github.com/aptos-labs/aptos-core/releases/download/aptos-cli-v0.3.1/aptos-cli-0.3.1-Ubuntu-x86_64.zip
unzip aptos-cli-0.3.1-Ubuntu-x86_64.zip
mkdir -p ~/bin
mv aptos ~/bin
chmod +x ~/bin/aptos
export PATH=~/bin:$PATH

4 check aptos 成功安装

aptos help

5 创建工作目录 和 用户名

export WORKSPACE=testnet
export USERNAME=l1l
mkdir ~/$WORKSPACE
cd ~/$WORKSPACE

6 下载validator.yaml 和 docker-compose.yaml

wget https://raw.githubusercontent.com/aptos-labs/aptos-core/main/docker/compose/aptos-node/docker-compose.yaml
wget https://raw.githubusercontent.com/aptos-labs/aptos-core/main/docker/compose/aptos-node/validator.yaml

7 修改docker-compose.yaml

  • 把端口 80:8080 改成 8080:8080
  • expose 这里 也改成8080

8. 生成重要的 公钥 私钥 以后 注册节点要用

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

四个 key files under ~/$WORKSPACE/keys 目录(如果CPU不支持指令集就会报非法指令的错误

  • public-keys.yaml
  • private-keys.yaml
  • validator-identity.yaml
  • validator-full-node-identity.yaml

9. 配置 validator 信息

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

在 ~/$WORKSPACE/$USERNAME目录下 会产生2个YAML files

  • owner.yaml
  • operator.yaml

10. 创建layout template 文件

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

修改 layout template

root_key: "D04470F43AB6AEAA4EB616B72128881EEF77346F2075FFE68E14BA7DEBD8095E"
users: ["username you specified from previous step"]
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

下载 AptosFramework Move package

wget https://github.com/aptos-labs/aptos-core/releases/download/aptos-framework-v0.3.0/framework.mrb -P ~/$WORKSPACE

编译 genesis blob 和 waypoint

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

确认在工作目录下有所有的文件

启动

sudo docker-compose up -d

查看进程

sudo docker ps -a
sudo docker logs $container_id -f

官网填表信息从这个里面找 ~/$WORKSPACE/keys/public-keys.yaml

  • OWNER KEY: 之前的步骤连上钱包 从钱包里面自己会填写.
  • CONSENSUS KEY: consensus_public_key from public-keys.yaml
  • CONSENSUS POP: consensus_proof_of_possession from public-keys.yaml
  • ACCOUNT KEY: account_public_key from public-keys.yaml
  • VALIDATOR NETWORK KEY: validator_network_public_key from public-keys.yaml
Subscribe to NET.APT
Receive the latest updates directly to your inbox.
Mint this entry as an NFT to add it to your collection.
Verification
This entry has been permanently stored onchain and signed by its creator.