How to Join Autonity Incentivized Node and Validator (Game R5)

How to Join Autonity Piccadilly Game Round 5 (Incentivized Validator and Node Testnet)

Follow 0xMoei For more info

Round 5 is open!

  • Start Time : December 13th 2023 00:00:00 UTC

  • Duration : 7 weeks

  • Game 5 Link

  • 120 winners for Validator, more info

  • 50 winners for RPC Node, more info

We’ll cover in this tutorial:

  • Validator Node Task

  • RPC Node Task

  • If you want to register both of them, you need 2 seprate VPS servers

Validators Grafana

Validators Stakeflow committee

Game R5 Dashboard

Game R5 Leaderboard

Autonity Docs

__________________________________________

1- Install Dependecies

1.1- Install libraries

sudo apt update && sudo apt upgrade -y
apt install curl iptables build-essential git wget jq make gcc nano tmux htop nvme-cli pkg-config libssl-dev libleveldb-dev tar clang bsdmainutils ncdu unzip chrony libleveldb-dev liblz4-tool -y

1.2 Install Golang

#remove old versions

sudo apt-get remove golang-go
sudo apt-get remove --auto-remove golang-go
cd $HOME && rm -rf go

#install

VERSION="1.21.6"
ARCH="amd64"
curl -O -L "https://golang.org/dl/go${VERSION}.linux-${ARCH}.tar.gz"
wget -L "https://golang.org/dl/go${VERSION}.linux-${ARCH}.tar.gz"
wget -L "https://golang.org/dl/go${VERSION}.linux-${ARCH}.tar.gz"
curl -sL https://golang.org/dl/ | grep -A 5 -w "go${VERSION}.linux-${ARCH}.tar.gz"
tar -xf "go${VERSION}.linux-${ARCH}.tar.gz"
sudo chown -R root:root ./go
sudo mv -v go /usr/local
export GOPATH=$HOME/go
export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin
source ~/.bash_profile
go version

1.3 Install ethkey (to pull-out private key from seed files)

git clone https://github.com/autonity/autonity.git autonity1
cd autonity1
make all
mv build/bin/ethkey /usr/local/bin
ethkey --version
#ethkey version 0.13.0-rc-8b4a17c1-20240210

Important:

#Only if you have problems installing aut or other binaries, use these below commands or pass it.

export CGO_CFLAGS="-O -D__BLST_PORTABLE__" 
export CGO_CFLAGS_ALLOW="-O -D__BLST_PORTABLE__"
make clean

2. Install Autonity Utility (Aut)

2.1 install Python3

cd
sudo apt install python3-pip && sudo apt install python3.10-venv && sudo pip install pipx

2.2 Install Aut

pipx install --force git+https://github.com/autonity/aut
mv /root/.local/bin/aut /usr/local/bin/aut
aut --version
#aut, version 0.4.0
tee <<EOF >/dev/null $HOME/.autrc
[aut]
rpc_endpoint= ws://127.0.0.1:8546
EOF

3. Install Autonity RPC Node

#Recommended Specifications

3.1 Open ports

sudo ufw allow 8545 && sudo ufw allow 8546 && sudo ufw allow 6060 && sudo ufw allow 30303

3.2 Install Autonity

cd
git clone https://github.com/autonity/autonity && cd autonity
git checkout tags/v0.13.0 -b v0.13.0
make autonity
mv $HOME/autonity/build/bin/autonity /usr/local/bin/
autonity version
 #Version: 0.13.0

3.3 Create Keys

cd
mkdir -p $HOME/autonity-chaindata/autonity

We need to create nodekey, tresure.key and oracle.key

nodekey is the main key of the node, from which the validator address and enode are formed

tresure.key will be our treasury. Using this key we will register task forms, receive faucet, delegate to the validator and we will receive rewards for this key

oracle.key will be used as the cryptographic identifier of the Oracle server and will be used to sign price report transactions sent to Oracle Contract on-chain

Before we Deploy Oracle Node, we nee to Fund our oracle.key with at least 0.1 $ATN

3.4 Generate nodekey

autonity genAutonityKeys $HOME/autonity-chaindata/autonity/nodekey --writeaddress
#Node address: 0xac16454f6D7B5725F4221f86D935963C87Dae7F5
#Node public key:0x1988dee846c92a7a95b5ddc62a808f6a34eb13aa567bcc9caf6ef7a5
#Consensus public key:0x87f764f47664b635290ffaa567bcc9caf6ef7a51116cafc7c0

3.5 Create a separate directory for tresure.key and oracle.key

mkdir -p $HOME/.autonity/keystore

3.6 Create an oracle wallet and save the created file

aut account new -k $HOME/.autonity/keystore/oracle.key

3.7 Create a tresure wallet and save the created file

aut account new -k $HOME/.autonity/keystore/tresure.key
  • If you are an existing user of Game R4 you need to import your last round tresurekey which was registered in the R4 form

  • Make a wallet.priv file in your root directory and paste your previous wallet privatekey in it

aut account import-private-key ./wallet.priv -k $HOME/.autonity/keystore/tresure.key

IMPORTANT: save your key files, addresses and your passphrase in a safe place

3.8 Add tresurekey to .autrc file

nano $HOME/.autrc

add this in the next line keyfile=/root/.autonity/keystore/tresure.key

Ctrl+X Y Enter

3.9 Create your Node service file

tee  << EOF > /dev/null /etc/systemd/system/autonity.service
[Unit]
Description=autonity node
After=network.target
[Service]
User= $USER
Type=simple
ExecStart= $( which autonity ) --datadir $HOME/autonity-chaindata --syncmode full --piccadilly --http --http.addr 0.0.0.0 --http.api aut,eth,net,txpool,web3,admin --http.vhosts * --ws --ws.addr 127.0.0.1 --ws.api aut,eth,net,txpool,web3,admin --autonitykeys $HOME/autonity-chaindata/autonity/nodekey --nat extip:$( wget -qO- eth0.me )
Restart=on-failure
LimitNOFILE=65535
--bootnodes enode://48a10db920251436ee1d7989db6cbab734157d5bd3ec9d534021e4903fdab51407ba4fd936bd6af1d188e3f464374c437accefa40f0312eac9bc9ae6fc0a2782@34.105.239.129:30303
[Install]
WantedBy=multi-user.target
EOF

3.10 Run your Autonity RPC Node

systemctl daemon-reload
systemctl enable autonity
sudo systemctl restart autonity && journalctl -u autonity -f  -o  cat

CTRL + C

4- FORM 1 - REGISTRATION

IMPORTANT - register only if you did not participate in round 4 (R4)

Now is the time to register your participation in the test network to receive test tokens. To do this, go to the website and fill out the data - https://game.autonity.org/getting-started/register.html

  • In the autonity address field , insert the tresure address

  • In the Signature hash field , insert the hash of the signed transaction after this command below:

    aut account sign-message "I have read and agree to comply with the Piccadilly Circus Games Competition Terms and Conditions published on IPFS with CID QmVghJVoWkFPtMBUcCiqs7Utydgkfe19wkLunhS5t57yEu"

After registration, you will receive a confirmation email and tokens should be credited to your balance. You can check your balance in Explorer or with the command:

aut account info

************* READ CAREFULLY ***********

Okay now we deployed an Autonity RPC Node successfully.

You can continue from step 11 and register your Autonity RPC Node for RPC Node Task

If you want to Deploy a Validator node, Continue from step 5 and ignore step 11

For doing both RPC Node task & Validator Task you'll need 2 seprate VPS servers with 2 seprate Nodekeys and 1 same Tresurekey

************* READ CAREFULLY ***********

5- Install Oracle

#Recommended Specifications

5.1 Install

cd
git clone https://github.com/autonity/autonity-oracle && cd autonity-oracle
git fetch --all 
git checkout v0.1.6 
make autoracle
mv build/bin/autoracle /usr/local/bin
autoracle version
#v0.1.6

5.2 Edit Plugin-conf.yml

nano $HOME/autonity-oracle/build/bin/plugins-conf.yml

You now need to remove # from bottom lines, Register in the data-feed websites and add your custom API to the lines

Websites:

5.3 Fund oracle.key

Add oracle.key privatekey to metamask

ethkey inspect --private /root/.autonity/keystore/oracle.key

Add tresure.key privatekey to metamask

ethkey inspect --private /root/.autonity/keystore/tresure.key

Add Piccadilly Network to Metamask

Send 0.1 ATN from tresure.key to oracle.key

5.4 Create service Oracle Node service file

change PASSWORD in -key.password argument and run the command

tee <<EOF >/dev/null /etc/systemd/system/antoracle.service
[Unit]
Description=Autonity Oracle Server
After=syslog.target network.target
[Service]
Type=simple
ExecStart=$(which autoracle) -key.file="/root/.autonity/keystore/oracle.key" -plugin.dir="/root/autonity-oracle/build/bin/plugins/" -plugin.conf="/root/autonity-oracle/build/bin/plugins-conf.yml" -key.password="PASSWORD" -ws="ws://127.0.0.1:8546"
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
EOF

5.4 Run Oracle

systemctl daemon-reload
systemctl enable antoracle
systemctl restart antoracle && journalctl -u antoracle -f  -o  cat
It's okay if you have
It's okay if you have

CTRL + C

6. Register Validator

6.1 Create proof of node ownership

Replace privatekey_oracle and tresure_account_address with your values

autonity genOwnershipProof --autonitykeys $HOME/autonity-chaindata/autonity/nodekey --oraclekeyhex privatekey_oracle tresure_account_address

!! Save Signature Hash

6.2 Get your enode

aut node info

# For example my enode is: enode://8f8656b34583911dcd9cdbff4b1dertyb472f7c48ea2456456beb1044930c83yrtbyrt59@22.125.458.10:30303

6.3 Get your Validator address

#Replace <enode>

aut validator compute-address <enode>

6.4 Get the consensus public key

ethkey autinspect $HOME/autonity-chaindata/autonity/nodekey

6.5 Send Validator Registration Transaction

Replace ENODE ORACLE_ADDRESS CONSENSUS_KEY PROOF

Proof: Node ownership Signature Hash

aut validator register ENODE ORACLE_ADDRESS CONSENSUS_KEY PROOF | aut tx sign - | aut tx send -

6.6 Find your validator address in the validators list

aut validator list

6.7 Check validator info

#Replace VALIDATOR_ADDRESS

aut validator info --validator VALIDATOR_ADDRESS

7. Bond NTN stake to your Validator

#Replace VALIDATOR_ADDRESS

aut validator bond --validator VALIDATOR_ADDRESS 1 | aut tx sign - | aut tx send -

8. Form 2 - Validator Registeration

Now is the time to register your validator. To do this, go to the website and fill out the data - https://game.autonity.org/awards/register-validator.html

On the node, you need to sign a message with your validator nodekey instead of your tresurekey (we signed with tresurekey in form 1)

8.1 Get private key of nodekey

head -c 64 $HOME/autonity-chaindata/autonity/nodekey

our default signing key is tresure key, we need to sign a message specifically with our nodekey so we need to create a nodekey2 file which contains our nodekey privatekey

8.2 Enter your Private key in the file

nano $HOME/nodekey2

Ctrl+X Y Enter

8.3 Add nodekey file to our account lists

aut account import-private-key $HOME/nodekey2
mv $HOME/.autonity/keystore/UTC* $HOME/.autonity/keystore/nodekey.key

8.4 Sign ”Validator Onboarded” message with our nodekey

aut account sign-message "validator onboarded" -k $HOME/.autonity/keystore/nodekey.key

As soon as the validator is selected to the committee, we should see similar logs on the node

***CAUTIOS***

  • Now we have our validator registered on the network with 1 NTN stake bonded to it but if we want to get Testnet Points, we need to be in committee

  • There’s a limited room in committee and it depends on the NTN staked on your validator. So you need more NTN

  • Check committee leaderboard here

9. Buy NTN in CAX

CAX is a centralized automated exchange. If you have already registered in the Form 1, then your CAX account is automatically funded with 1 MILLION USD . It's linked to your registered member account so you can easily move assets between internal and external networks

The exchange uses API keys for authentication, so you must create an API key for your account before you start trading

9.1 Install httpie

sudo apt install snapd
sudo apt install httpie

9.2 Get API KEY

MESSAGE=$(jq -nc --arg nonce "$(date +%s%N)" '$ARGS.named')
aut account sign-message $MESSAGE message.sig -k $HOME/.autonity/keystore/tresure.key > message.sig
echo -n $MESSAGE | https https://cax.piccadilly.autonity.org/api/apikeys api-sig:@message.sig

9.3 Now you can trade NTN

# Replace apikey

KEY=API_KEY
# View your tresure.key wallet balance

aut account info -k $HOME/.autonity/keystore/tresure.key
# View off-chain CAX balance

https GET https://cax.piccadilly.autonity.org/api/balances/ API-Key:$KEY
# View orderbooks


https GET https://cax.piccadilly.autonity.org/api/orderbooks/ API-Key:$KEY
# Getting current price of NTN-USD

https GET https://cax.piccadilly.autonity.org/api/orderbooks/NTN-USD/quote API-Key:$KEY
# Getting current price of ATN-USD

https GET https://cax.piccadilly.autonity.org/api/orderbooks/ATN-USD/quote API-Key:$KEY
# Buy NTN with limit-order (Replace x with an amount of your favor)

https POST https://cax.piccadilly.autonity.org/api/orders/ API-Key:$KEY pair=NTN-USD side=bid price=x amount=x
# view order status (you need the "order_id" number, which you will receive in response to the previous request)

https GET https://cax.piccadilly.autonity.org/api/orders/order_id API-Key:$KEY
# Cancel open order

https DELETE https://cax.piccadilly.autonity.org/api/orders/313469 API-Key:$KEY
# Send X amount of NTN from off-chain CAX to tresurekey wallet

https POST https://cax.piccadilly.autonity.org/api/withdraws/ API-Key:$KEY symbol=NTN amount=X

Now check your NTN balance again

aut account info

10. You can now bond NTN to your validator again with step 7 command, but increase the amount from 1

11. Form 3 - Node Registeration

************* READ CAREFULLY ***********

Go for this step, Only if you want to register for RPC Node Task and deploy it in a new and a second server

For doing both RPC Node task & Validator Task you'll need 2 seprate VPS servers with 2 seprate Nodekeys and 1 same Tresurekey

************* READ CAREFULLY ***********

On the node, you need to sign a message with your RPC Node nodekey instead of your tresurekey

11.1 Get your enode

aut node info

# For example my enode is: enode://8f8656b34583911dcd9cdbff4b1dertyb472f7c48ea2456456beb1044930c83yrtbyrt59@22.125.458.10:30303

11.2 Get RPC Node Endpoint

http://YourIP:8545

11.3 For “public rpc” message

#Get private key of nodekey

head -c 64 $HOME/autonity-chaindata/autonity/nodekey

#Enter your Private key in the file

nano $HOME/nodekey2

Ctrl+X Y Enter

#Add nodekey file to our account lists

aut account import-private-key $HOME/nodekey2
mv $HOME/.autonity/keystore/UTC* $HOME/.autonity/keystore/nodekey.key

#Sign ”public rpc” message with our nodekey

aut account sign-message "validator onboarded" -k $HOME/.autonity/keystore/nodekey.key|

#copy & paste the signature hash in the form

___________________________________________________________________________________________

********Follow 0xMoei For more info********

Validators Grafana

Validators Stakeflow committee

Game R5 Dashboard

Game R5 Leaderboard

Autonity Docs

___________________________________________________________________________________________

** Thanks lesnik13utsa & zuka_116 for their detailed guide **

Subscribe to Moei
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.