Avail ClashOfNodes Task Guide: Karnot x Madara Appchain

The "Madara x Karnot Appchain Challenge" is a part of the Clash of Nodes Incentivized Testnet which people earn points in the leaderboard and I think it will exchange with real $AVL at mainnet launch🪂

  • In this task we just deploy a Madara appchain using Avail as the data availability (DA) layer and submit a github PR to get into the clash of nodes leaderboard

  • Chain usage and user engagement of your Appchain earns you Avail POINTS which we will discuss about it in the last part

Follow my Twitter 🧡

System Requirements

CPU = 4

Ram = 8

SSD = 160

1- Install Dependecies

Install Git

sudo apt-get install git

Install rust

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source "$HOME/.cargo/env"

Install Docker

sudo apt-get update && sudo apt-get install ca-certificates curl gnupg && sudo install -m 0755 -d /etc/apt/keyrings && curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg && sudo chmod a+r /etc/apt/keyrings/docker.gpg
echo \ "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y

Update packages

sudo apt update && sudo apt upgrade -y && sudo apt install build-essential && sudo apt install pkg-config && sudo apt install libssl-dev && sudo apt install clang && sudo apt install protobuf-compiler

Press Y

2- Install Madara Appchain

1- Install and initiate

git clone https://github.com/karnotxyz/madara-cli
cd madara-cli
cargo build --release
./target/release/madara init

Press Enter and choose a name and Avail as DA

2- Fund your DA wallet

Send $AVL from your Avail account to your DA wallet

https://goldberg.avail.tools/#/accounts

Get $AVL faucet from discord time to time in order nodes consume a lot of $AVL

https://discord.com/invite/availproject

Discord faucet access

Connect your MM wallet and verify your Gitcoin Passport ( need >20 points ) to get access to the user faucet in the discord

https://passport-verifier.avail.tools/

Appchain Faucet

You can get more than 25 AVL/day or 200 AVL/week by going to #appchain-builders channel in discord

3- Start Appchain

Install screen

This helps you to keep a screen running even if you closed the terminal

sudo apt install screen
screen -S madara
./target/release/madara run
  • Wait until loading is finished Then it asks you to Enter Y to run the appchain
Your node starts after 15-45 mins
Your node starts after 15-45 mins

Minimize the screen

If appchain is running you can minimize it now and let it running in the background

  • Press Ctrl + A + D

4- Open Ports

sudo apt install ufw
sudo ufw enable
sudo ufw allow ssh
sudo ufw allow 9944
sudo ufw allow 4000
sudo ufw allow 9615
sudo ufw allow 30333

4- Start explorer

./target/release/madara explorer
  • Wait until finish

You are done and you can check your explorer with: http://YourIP:4000

3- Submit Github Pull Request

Fork this repository

Create your .json file

Go to app_chains folder of your repository > Add File > Create new file

Create a uid here and replace with the name of your file: uid.json

For example my file name is:

213id2e0-0492-4aa5-3jee-5fif86b38fje.json

Copy paste below code into it and replace placeholders with your appchain details

Replace Your_app_chain , YourLogoURL , YourIP, uid

{
  "name": "Your_appchain_name",
  "logo": "Your_Logo_URL",
  "rpc_url": "http://Your_IP:9944",
  "explorer_url": "http://Your_IP:4000",
  "metrics_endpoint": "http://Your_IP:9615/metrics",
  "id": "uid"
}

• Commit changes… and save

Submit Pull Request

Contribute > Open pull request

• Add your Appchain name to your title

✨️Adding Your_appchain_name

• Create pull request and done

*CAUTIONS*:

You need to get “All checks have passed” with a green verified tick if you were successful

  • There is a github bot which verify and auto-merge your PR to list it in the leaderboard

  • You have to pass 4 verify checks

Error Verifying PR?

  • If you keep getting error in verifying your PR, you are doing smth wrong, you can correct your .json file by uploading it in the root directory of your server and run:

  • Replace file name with your .json file name in the command

    npx prettier --check 7s0dgb7fsd-asdtfgtvvr-b28fg-fhpdrxrnreahdhed.json
    
    npx prettier --write 7s0dgb7fsd-asdtfgtvvr-b28fg-fhpdrxrnreahdhed.json
    

Fill in the form

https://docs.google.com/forms/d/e/1FAIpQLSdxqFdvI4iGewNL_N-8q8gEdJdtCeBMl9QSHp-uxnbN0RtfKA/viewform

Check Leaderboard

When your PR gets verified by the github bot, you'll get your rank in leaderboard, Madara tab

Interact with DAPP (Points)

  • Madara points calculation is not stable, for example if your node stops, your DA Updates resets and Points decreases

  • The team didn’t respond clearly as the testnet is totally buggy, but better to bear with it and try your best to do txs and keep the node running healthy until we see an optimization from the team

There are several ways to interact with your Appchain described in Karnot Mirror

Interact with Automatic script

  • Make sure your appchain node is running in your server

1- Install Golang

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

2- Install and Run Script

git clone https://github.com/sarox0987/avail-madara
cd avail-madara
nano rpc.json
  • add your Appchain RPC (server IP)

    Ctrl+X Y Enter

go mod tidy
screen -S tx
go run main.go

Ctrl+A+D

  • Check your Transactions in ** leaderboard or your Appchain Explorer**

Avail discord is the best place for your questions

FOLLOW ME

You can get in touch with me in twitter

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.