Nodes-Astro / Clash-of-Nodes-Madara---Karnot-Appchains-Challenge

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Clash Of Nodes Madara Karnot Appchains Challenge

First install dependencies

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

Install Rust

curl https://sh.rustup.rs -sSf | sh
source $HOME/.cargo/env

Install Git & Docker

sudo apt install git-all
sudo apt install docker.io
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
docker-compose --version

Install CLI

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

Initialize a new app chain. Select Sovereign as Settlement and Avail as DA also fund the DA account

To use faucet follow these instructions:

https://docs.availproject.org/about/faucet/

./target/release/madara init

Run your app chain:

screen -S run
cd madara-cli
./target/release/madara run

After finished your logs will appear on the console

image

CTRL + A + D to exit

Let's match the data with explorer to view

./madara-cli/target/release/madara explorer --host=$(wget -qO- eth0.me)

Optionally, explore the StarkCompass explorer. Accessible at http://localhost:4000.

That's it, your madara app is running

Let's generate app id from Avail for the leaderboard

https://app-id-gen.vercel.app/

image

You can import your Avail wallet to Polkadot.js or Talisman extension wallet to continue.(Select wallet which you use for the "Clash Of Nodes" event)

After connect your wallet write your appname and wait for getting appid.

image

Copy your app id to notepad we'll need to write it on da-config file

Change your app id on config file

appname="Your appname goes here"
nano /root/.madara/app-chains/$appname/da-config.json
Delete quoation marks after you wrote your app id.

image

Change your app id 0 to Avail app id (CTRL X + Y Enter to save and exit)

Create a PR to Register Your Appchain

Generate a random uid from here first: (This id is only for pr different than Avail app id)

https://www.uuidgenerator.net/

You need to add "Your uid".json file in this format:

{
  "name": "my_app_chain",
  "logo": "https://placehold.co/400x400",
  "rpc_url": "http://ipv4:9944",
  "explorer_url": "http://ipv4:4000",
  "metrics_endpoint": "http://ipv4:9615/metrics",
  "id": "942ff35e-f048-4d10-ae61-6cb970cad2f0"
}

To create a json "Your id".json file run:

sudo touch "Your uid"
After created, add your app infos and download it on your desktop.

Details

name: The name of your app chain.

logo: A image link for the logo of your app chain

rpc_url: A public endpoint for your app chain to make RPC calls (port 9944 by default)

explorer_url: A public endpoint where your app chain explorer is visible

metrics_endpoint: A public endpoint for your prometheus metrics (port 9615 by default)

id: Your node id

logo: You can use this website to get png url:

https://im.ge/upload

rpc-url format: "http://ipv4:9944"
explorer_url: "http://ipv4:4000"
metrics_endpoint: "http://ipv4:9615/metrics"
id: The id is a randomly generated uuid.

To create a Pull Request follow these steps:

Fork this repository:

https://github.com/karnotxyz/avail-campaign-listing

image

Click on app_chains

image

Upload "your uid".json file

image

After upload create new pull request

image

This configuration file includes essential details about your appchain, such as its name, logo URL, RPC endpoint, explorer URL, metrics endpoint, and a unique identifier. Ensure all information is accurate and up-to-date to facilitate smooth registration and participation in the campaign. Once the PR is merged, the appchain will appear on the Clash of Nodes Leaderboard.

image

You may have trouble with the prettier, if you deal with the thats kind of issue:

image

Try to copy with CTRL + A and paste it, check unnecessary spaces and delete all.

TX Script (Quoted)

Install Golang

ver="1.21.6"
wget "https://golang.org/dl/go$ver.linux-amd64.tar.gz"
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf "go$ver.linux-amd64.tar.gz"
rm "go$ver.linux-amd64.tar.gz"
echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> $HOME/.bash_profile
source $HOME/.bash_profile
go version

Download

git clone https://github.com/sarox0987/avail-madara
cd avail-madara
nano rpc.json

Add your own ipv4 to json file.(CTRL X + Y Enter to save and exit)

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

CTRL A + D to exit from screen, screen -r tx to get in screen.

About