Cover photo

Part 2 - Creating an Avail appchain and deploying with Madara cli

If you are reading this article, then I believe you are coming from the part 1 of this. If not checkout previous article:

https://mirror.xyz/pnokn.eth/bd1i3oCnv2HAUgZm16NJ8kzl0SIrzoNoQYEuSX5ArIw

Welcome to Part 2 - A simple guide to help you deploy your avail appchain:

Now that you’ve created your VM you can SSH into your terminal and install these dependencies:

Play Video

Install git

Press Y when needed

sudo apt update && sudo apt upgrade -y
sudo apt-get install git-all
sudo apt-get install curl

Install Rust

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Choose option 1 by pressing 1 and enter
Choose option 1 by pressing 1 and enter
source "$HOME/.cargo/env"

Install Necessary 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 Docker

Docker installation guide for Ubuntu can be found here:

https://docs.docker.com/engine/install/ubuntu/

Run the following command to uninstall all conflicting packages:

for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-
docker containerd runc; do sudo apt-get remove $pkg; done

Set up Docker's apt repository.

# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

# Add the repository to Apt sources:
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] 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

To install the latest version, run:

sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

Verify that the Docker Engine installation is successful by running the hello-world image.

sudo docker run hello-world

Install Madara CLI

Clone git repo

git clone https://github.com/karnotxyz/madara-cli

Cd into Madara CLI and run build

cd madara-cli
cargo build --release

Install Screen and start new screen session

sudo apt install screen
screen -S madara

Initialize your Appchain and get Avail Address

Press Y when needed for yes

./target/release/madara init

Fund your wallet here:

https://discord.com/invite/availproject

To access the faucet you need to verify that your gitcoin passport has a score of > 20. Click the link below to verify:

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

After verification you have access to the discord channel. Now go to #appchain-builders and click on Agree to get access to the faucet:

Click Agree to get access to faucet
Click Agree to get access to faucet

Request faucet from #goldberg-faucet channel with command:

/deposit-rollup <Avail Address>
Enter address to get faucet
Enter address to get faucet

Run the Appchain

./target/release/madara run

To detach screen whilst running in background press Ctrl + A + D

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

Start explorer

./target/release/madara explorer

Record your IP and access explorer with your IP and port number:

http://YourIP:Port