Test your parachain with Chachacha relay network

Ramsey Ajram (Decentration)
4 min readJul 21, 2021

A quick set up guide to connect your parachain with Chachacha.

Chachacha is a test relay network (created by Kylin Network) for parachains that want to test their parachain before they integrate with Kusama or Polkadot. It is pretty much the same as Rococo, but it allows you more freedom to dynamically test and make upgrades.

My name is Ramsey and I am an engineer at Edgeware that is working on Edgeware’s parachain integration with Kusama. The parachain is called Kabocha!

Let’s get started…

The main difference between Rococo and Chachacha is that you need to run 2 validators for the relay network.

This post will show you how you can set up these validators on a remote server, then connect your parachain. We are going to use Digital Ocean to do this, but you can use any other cloud service.

Quick Setup of Remote Cloud Instance

  1. Signup or login to Digital Ocean.
  2. Click create Droplet.
  3. Enter the name of your project.
  4. Choose an Ubuntu x64 20.04 (LTS) server, select the basic plan, and then the Premium Intel $12/mo service, will do the trick.

5. Choose your ideal data centre, the nearest one to you is a good option.

6. Click SSH-key: either create a new SSH or maybe you already have one so you can use that. But we are going to click “New SSH Key”.

7. Create the SSH key on your local machine. Follow the instructions on the right hand side create the SSH key then paste it into the box on the left hand side.

8. Great your Droplet should be ready. Now on the main dashboard you should see your public IP address, take note of that because we will need it to connect to the remote instance from our local machine.

9. Now we are going to connect to the droplet with OpenSSH.

  • Open a terminal on your local machine and enter:
ssh root@<insert public ip>
  • Then enter your passphrase you made above, and you should be good connected to your remote server.

Great!

Now we need to clone the Chachacha repo on Github, as well as download Docker.

Download Docker

Follow the below to

$ sudo apt-get update$ sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg \
lsb-release
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg$ echo \
"deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Now we should be ready to install the Docker engine.

 $ sudo apt-get update
$ sudo apt-get install docker-ce docker-ce-cli containerd.io

Test it’s all working correctly:

sudo docker run hello-world

If that works, great let’s move on! (If not then follow this official Docker guide and try again).

Clone chachacha

Now let’s git clone the centrifuge/polkadot repo and “chachacha” branch on Github (or you can fork your own version):

git clone -b chachacha https://github.com/centrifuge/polkadot.git

Now just checkout into the correct branch just to make sure we’re in the right place

$ cd polkadot 
$ git checkout chachacha

Ok great, now we’re ready to run the Docker container and set up 2 validators. The Docker compose file does most of the work.

Run the Docker compose file

  • Make sure you are in the polkadot directory.
  • Now let’s run the Docker commands:
$ apt  install docker-compose$ docker-compose -f docker/docker-compose-chachacha.yml up -d

Now we need to get the session keys for both validator_1 and validator_2

curl http://127.0.0.1:9933 \-H “Content-Type:application/json;charset=utf-8” \-d ‘{ “jsonrpc”:”2.0", “id”:1, “method”:”author_rotateKeys” }

For example for validator_2 replace 9933 with 9934.

You should now have a large hash beginning with 0x…

Create a Cha account and get funded

Go to the Chachacha relay network and create an account in accounts/add-account.

https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Ffullnode-relay.chachacha.centrifuge.io#/

Save that information and then send Sam@Kylin a message so he can send you some Cha.

Create para_id

Once funded get your para id by going to parachains/parathreads and then add (+) paraid.

Set the session keys in Chachacha

Make an extrinsic transaction with both of the keys you generated with the validators you made above.

Now you can go to Kylin page to complete the process… https://kylinnetwork.medium.com/kylin-is-on-chachacha-and-partnered-with-centrifuge-5ce3b3ab73c8

I hope that helps!

All the best,

Ramsey

Kabocha
Edgeware’s parachain (soon to be) on Kusama

--

--

Ramsey Ajram (Decentration)

Decentralising the web. Stewarding new paradigms. Engineering and product.