Dependencies
Build the Node binary
Clone the AvalancheGo repository
git clone https://github.com/ava-labs/avalanchego.git
cd avalanchego
./scripts/build.sh
Create AvalancheGo service directory
sudo mkdir /var/lib/avalanchego
Copy executable to binary directory
sudo cp avalanchego/build/avalanchego /usr/local/bin/
sudo chmod 755 /usr/local/bin/avalanchego
Create AvalancheGo working directory
sudo mkdir /root/.avalanchego
sudo mkdir -p /root/.avalanchego/plugins
wget https://github.com/ava-labs/subnet-evm/releases/download/v0.7.3/subnet-evm_0.7.3_linux_amd64.tar.gz
tar -xzvf subnet-evm_0.7.3_linux_amd64.tar.gz
Copy subnet EVM to AvalancheGo working directory
sudo cp subnet-evm_0.7.3_linux_amd64/subnet-evm /root/.avalanchego/plugins/mDVK6hF1rcPB2e7ftmYbMQgnYMnQSnnk7cUfu8dENAYqH9XJA
mDVK6hF1rcPB2e7ftmYbMQgnYMnQSnnk7cUfu8dENAYqH9XJA
is the VMID of DERA chain.
Create chainConfigs directory
sudo mkdir -p /root/.avalanchego/chainConfigs/2XCTEc8CfNK9MtQWYMfgNt32QjZsZqq92LH7eTV5xY8YjY44du
2XCTEc8CfNK9MtQWYMfgNt32QjZsZqq92LH7eTV5xY8YjY44du
is blockchain ID of DERA chain.
sudo touch /root/.avalanchego/chainConfigs/2XCTEc8CfNK9MtQWYMfgNt32QjZsZqq92LH7eTV5xY8YjY44du/config.json
with content.
{
"database-type": "leveldb",
"log-level": "debug",
"warp-api-enabled": true,
"eth-apis": [
"eth",
"eth-filter",
"net",
"admin",
"web3",
"internal-eth",
"internal-blockchain",
"internal-transaction",
"internal-debug",
"internal-account",
"internal-personal"
]
}
Create config.json
for AvalancheGo
sudo touch /root/.avalanchego/config.json
with content.
{
"chain-config-dir": "/root/.avalanchego/chainConfigs",
"http-allowed-hosts": "*",
"http-host": "0.0.0.0",
"network-allow-private-ips": "true",
"public-ip": "YOUR_PUBLIC_IP",
"track-subnets": "B7hA9WibSJu2fKdHT2XZs2RYg1rZTtxwg6cMYBKYjvcJjbqsp"
}
Create systemd startup scripts
sudo touch /etc/systemd/system/avalanchego.service
with content.
[Unit]
Description=AvalancheGo node
After=network.target
[Service]
User=root
ExecStart=/usr/local/bin/avalanchego --config-file /root/.avalanchego/config.json
WorkingDirectory=/var/lib/avalanchego
Restart=always
RestartSec=3
LimitNOFILE=65535
LimitNPROC=65535
LimitMEMLOCK=infinity
[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
Start and enable the AvalancheGo service
sudo systemctl start avalanchego
sudo systemctl enable avalanchego
Tracking the bootstrap process, until the node is fully bootstrapped
sudo journalctl -u avalanchego
Verify node is fully bootstrapped
curl -X POST --data '{
"jsonrpc":"2.0",
"id" :1,
"method" :"info.isBootstrapped",
"params": {
"chain":"2XCTEc8CfNK9MtQWYMfgNt32QjZsZqq92LH7eTV5xY8YjY44du"
}
}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/info
curl -X POST --data '{
"jsonrpc":"2.0",
"id" :1,
"method" :"info.isBootstrapped",
"params": {
"chain":"P"
}
}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/info
Ensure that both requests response are
{"jsonrpc":"2.0","result":{"isBootstrapped":true},"id":1}
Then your node is ready to work to secure DERA chain consensus.