Guide: Launch your Denali node with AWS from A to Z

1 — Amazon Web Service

First of all, you will have to log in or create an account on AWS if you don’t have one. The registration is fast.

  • CPU: 2 GHz
  • RAM: 3 GB
  • Storage: 250 MB free space
  • CPU: > 2 GHz
  • RAM: > 3 GB
  • Storage: > 5 GB free space on SSD
  • CPU : 2 vCPU
  • RAM : 4 GB
  • Storage : 8 GB SSD

2 — Bootstrap

Once your putty is configured to connect to your Amazon instance via SSH, it looks like this.
Your default login is: ubuntu

sudo apt-get update
wget https://dl.google.com/go/go1.13.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.13.linux-amd64.tar.gz
export PATH=$PATH:/usr/local/go/bin
source ~/.profile
go version
Go install
sudo apt-get install libssl-dev libuv1-dev cmake make curl g++
sudo apt install git
go get -v -d github.com/ava-labs/gecko/...
cd go/src/github.com/ava-labs/gecko
./scripts/build.sh
nohup ./build/ava &
tail -f nohup.out
ps -ef

3 — Stake your AVA

Step 1 — Create a User and Addresses

In order to become a validator, a user must be created. The following API call will create a user with the username and password we specify.

curl -X POST --data '{
"jsonrpc": "2.0",
"id": 1,
"method": "keystore.createUser",
"params": {
"username": "YOUR USERNAME",
"password": "YOUR PASSWORD"
}
}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/keystore
curl -X POST --data '{
"jsonrpc":"2.0",
"id" :2,
"method" :"avm.createAddress",
"params" :{
"username": "YOUR USERNAME",
"password": "YOUR PASSWORD"
}
}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/X
{
"jsonrpc": "2.0",
"result": {
"address": "YOUR X-CHAIN ADDRESS"
},
"id": 1
}
curl -X POST --data '{
"jsonrpc": "2.0",
"method": "platform.createAccount",
"params": {
"username": "YOUR USERNAME",
"password": "YOUR PASSWORD"
},
"id": 1
}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/P
{
"jsonrpc": "2.0",
"result": {
"address": "YOUR P-CHAIN ADDRESS"
},
"id": 1
}

Step 2 — Acquire Funds

Alright! Now we have some accounts, let’s put some funds in them. To start, we’re going to get some funds from the AVA Testnet Faucet. We put our X-Chain address into the form, confirm we’re human, and request 20,000 nAVA (nano-AVA).

curl -X POST --data '{
"jsonrpc":"2.0",
"id" :7,
"method" :"avm.getBalance",
"params" :{
"address":"YOUR X-CHAIN ADDRESS HERE",
"assetID" :"AVA"
}
}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/X
{
"jsonrpc":"2.0",
"id" :2,
"result" :{
"balance":20000
}
}

Step 3 — Send it to the Platform

We’re funded! Now time to do something with it. To do this, we’re going to put AVA from our X-Chain onto our P-Chain. The P-Chain controls all staker accounts and validator sets. It is where platform coordination occurs, and like the X-Chain, it is run by default across all nodes on the AVA platform.

curl -X POST --data '{
"jsonrpc":"2.0",
"id" :1,
"method" :"avm.exportAVA",
"params" :{
"username": "YOUR USERNAME",
"password": "YOUR PASSWORD",
"to":"YOUR PLATFORM ADDRESS HERE",
"amount": 10000
}
}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/X
curl -X POST --data '{
"jsonrpc": "2.0",
"method": "platform.importAVA",
"params": {
"username": "YOUR USERNAME",
"password": "YOUR PASSWORD",
"to":"YOUR PLATFORM ADDRESS HERE",
"payerNonce":1
},
"id": 1
}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/P
{
"jsonrpc": "2.0",
"result": {
"tx": "1117xBwcr5fo1Ch4umyzjYgnuoFhSwBHdMCam2wRe8SxcJJvQRKSmufXM8aSqKaDmX4TjvzPaUbSn33TAQsbZDhzcHEGviuthncY5VQfUJogyMoFGXUtu3M8NbwNhrYtmSRkFdmN4w933janKvJYKNnsDMvMkmasxrFj8fQxE6Ej8eyU2Jqj2gnTxU2WD3NusFNKmPfgJs8DRCWgYyJVodnGvT43hovggVaWHHD8yYi9WJ64pLCvtCcEYkQeEeA5NE8eTxPtWJrwSMTciHHVdHMpxdVAY6Ptr2rMcYSacr8TZzw59XJfbQT4R6DCsHYQAPJAUfDNeX2JuiBk9xonfKmGcJcGXwdJZ3QrvHHHfHCeuxqS13AfU"
},
"id": 1
}
curl -X POST --data '{
"jsonrpc": "2.0",
"method": "platform.issueTx",
"params": {
"tx":"THE ISSUE TRANSFER TX HERE"
},
"id": 1
}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/P
curl -X POST --data '{
"jsonrpc": "2.0",
"method": "platform.getAccount",
"params":{
"address":"YOUR PLATFORM ADDRESS HERE"
},
"id": 1
}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/P

4 — Validation

Success! Now that we have funds on the P-Chain, we’re ready to register to become a validator on the network. Each node has a “nodeID” which is used to uniquely identify the node on the network. In order to become a validator, we need to commit this nodeID to be the node that does the work. The first thing to do, is to get our nodeID and jot it down so we can use it later.

curl -X POST --data '{
"jsonrpc": "2.0",
"method": "admin.getNodeID",
"params":{},
"id": 1
}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/admin
curl -X POST --data '{
"jsonrpc": "2.0",
"method": "platform.addDefaultSubnetValidator",
"params": {
"id":"YOUR NODEID HERE",
"payerNonce":2,
"destination":"YOUR PLATFORM ADDRESS HERE",
"startTime":'$(date --date="15 minutes" +%s)',
"endTime":1592265599,
"stakeAmount":10000
},
"id": 1
}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/P
{
"jsonrpc":"2.0",
"id" :1,
"result" :{
"unsignedTx": "1115K3jV5Yxr145wi6kEYpN1nPz3GEBkzG8mpF2s2959VsR54YGenLJrgdg3UEE7vFPNDE5n3Cq9Vs71HEjUUoVSyrt9Z3X7M5sKLCX5WScTcQocxjnXfFowZxFe4uH8iJU7jnCZgeKK5bWsfnWy2b9PbCQMN2uNLvwyKRp4ZxcgRptkuXRMCKHfhbHVKBYmr5e2VbBBht19be57uFUP5yVdMxKnxecs"
}
}
curl -X POST --data '{
"jsonrpc": "2.0",
"method": "platform.sign",
"params": {
"username": "YOUR USERNAME HERE",
"password": "YOUR PASSWORD HERE",
"tx":"THE VALIDATION UNSIGNED TX HERE",
"signer":"YOUR PLATFORM ADDRESS HERE"
},
"id": 2
}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/P
{
"jsonrpc": "2.0",
"result": {
"Tx": "111Bit5JNASbJyTLrd2kWkYRoc96swEWoWdmEhuGAFK3rCAyTnTzomuFwgx1SCUdUE71KbtXPnqj93KGr3CeftpPN37kVyqBaAQ5xaDjr7wVBTUYi9iV7kYJnHF61yovViJF74mJJy7WWQKeRMDRTiPuii5gsd11gtNahCCsKbm9seJtk2h1wAPZn9M1eL84CGVPnLUiLP"
},
"id": 1
}
curl -X POST --data '{
"jsonrpc": "2.0",
"method": "platform.issueTx",
"params": {
"tx":"YOUR VALIDATION SIGNED TX HERE"
},
"id": 3
}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/P
curl -X POST --data '{
"jsonrpc": "2.0",
"method": "platform.getPendingValidators",
"params": {},
"id": 4
}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/P
curl -X POST --data '{
"jsonrpc": "2.0",
"method": "platform.getCurrentValidators",
"params": {},
"id": 1
}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/P
AVA Explorer

You also want to know for how many hours has you node been running ?

Use the command below :

ps -eo etime,args | grep ava

Restart your node

Execute the following command:

curl -s  https://raw.githubusercontent.com/ablockio/Auto-AVA-Denali-node-deployment/master/reboot_node.sh | bash

Update your node

To update your node to the latest version, execute the following command:

curl -s https://raw.githubusercontent.com/ablockio/Auto-AVA-Denali-node-deployment/master/reboot_node_update.sh | bash

Issue #1:

If you’re trying to export your P-Chain wallet private key and you’re getting this result :

systemctl status avanode
ps -ef
kill -9 1914
curl -s  https://raw.githubusercontent.com/ablockio/Auto-AVA-Denali-node-deployment/master/reboot_node.sh | bash

ablock links :

ablock is a staking service provider with a focus on community engagement. We build software, tools, and other cool stuff.
Check us out!

About AVA Labs:

AVA Labs makes it simple to launch finance applications using blockchain technolog - with highly scalable and efficient networks, customizable public and private blockchains, the capability to create any digital asset, and more. We are empowering people to build an open, simple, and democratic internet of finance.

--

--

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
ablock

ablock

Staking validator for PoS blockchains | community tools | services for blockchain networks & validator nodes. Website: ablock.io