Namada Self Host - Part 1
Namada
Namada

Namada is a privacy focused block chain which can interpolate with many other block chain. it's vision to make a privacy as a public good . there are many official and unofficial documentations and blogs describing it's features inside out. from very beginner to advanced technical posts. there are two good website aggregated these resources in one place, Namada-awesome and Namada-resources . yet many people (including myself) prefer to learn by doing first, then read the theories. when you have no idea what a product is, it is very overwhelming to read it's specifications. this is exactly what this blog series are about. in these posts we try to run a local fork of Namada blockchain on our machines with the minimum technical knowledge requirement. yet the target audience is not only end-users, but also developers who want get a head start over Namada so they can brain storm their ideas for integrating their application with Namada can benefit from these series.

in the first post we try to run local blockchain with 3 Validators. you have control over everything, even you can alter the protocol genesis state(running your own blockchain sounds exciting, right ?). we do some basic and advanced things that are possible on Namada with a brief description about each concept and link to documents for more details. this post is only focused on using CLI to interact with blockchain, if CLI or Docker intimidate you , i highly recommend to do not skip it, this is your chance to face your fears and at the end you find it how Docker and CLI apps in general are convenient to work with, even for non technical users . In the Upcoming posts we add the guide to work official Namada-interface and it's wallet Extension , all running on our machine

The code used for this guide is heavily based on Knowable Campfire Testnet, their work is just incredible , i tried to removed some complexity (really? or maybe i added some more xD) and tweaked it in way to be easily consumed by the end-user with a step by step tutorial.

Shall we begin ?

Requirements

You need a PC or Laptop with Docker & Docker Compose and Git installed on it. As Docker image's are used in this repository are Linux Based, If you are a Mac or Windows user, you should install Docker Desktop . as it will run the docker engine inside a Linux VM. so no comparability issues should arise. i won't cover installing Docker, because there are tons of tutorials to do it correctly and it's really easy to do. If you already have Docker on your machine, make sure it's not too old.

Installing Git is not a requirement but it come's handy nowadays for many. If you need a guide, check [Atlassian Tutorial] (https://www.atlassian.com/git/tutorials/install-git) , just install the git and Ignore the Atlassian Sourcetree part

Getting Started

After installing docker and git, open a command line, then clone this repository

git clone https://github.com/0x4r45h/namada-selfhost.git

then move to projects directory

cd namada-selfhost

copy the .env.sample file into .env
in this file you can change some configuration if you prefer, otherwise keep the default values.

cp .env.sample .env

You have two options, Use already built images or build it yourself. using an image is faster but you have to trust the one who has built the image. building it yourself is more secure, but it takes more time and some low end machines can't even compile it due to resource limitations. if you decided to use images :

docker compose pull

otherwise to build your own images:

docker compose build

now run this launch Namada blockchain with 3 Validators in background

docker compose up -d

then monitor the logs

docker compose logs -f

it takes a while when you run the chain for the first time. when you see a lot of logs like this, that means your local blockchain is ready and it is producing blocks

Interact with Namada using CLI

You have to run commands inside one the three Validators to access Namada binaries, so for example to enter namada-1 container:

docker compose exec namada-1 bash

from so on every command i run is executed inside validator-1 container. run this to see the Namada binary version

namada --version

Generate a new Keypair & Send Some NAM to it

alias can be anything

namada wallet key gen --unsafe-dont-encrypt --alias alice
Transfer funds

Transfer some NAM from faucet-1 account to Alice

namada client transfer   --source namada-1-wallet   --target alice   --token NAM   --amount 10   --signing-keys namada-1-wallet
Check accounts balance
namada client balance --owner alice

This was just a glimpse of what Namada can do. For a comprehensive list of commands, refer to the Official Documentation , or check out the handy cheat sheets created by the community.

Tear Down everything

When you are done with testing, remove all containers and volumes

docker compose down -v

What's Next?

In the next blog we will cover how to run your own Namada Interface and Extension, and connect them to your local blockchain

Subscribe to Namada Nerds
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.