Skip to content

Instantly share code, notes, and snippets.

@sieemma
Last active February 2, 2021 21:08
Show Gist options
  • Save sieemma/0baa1b2b4c986a2cbd47eae079f6f7b5 to your computer and use it in GitHub Desktop.
Save sieemma/0baa1b2b4c986a2cbd47eae079f6f7b5 to your computer and use it in GitHub Desktop.
concordium testnet.
This document was prepared to help others with the concordium testnet3 set up.
Comments are welcomed to make this document a better one for us all.
# For the sake of people who might not be faimiliar with codes but would like to try their hands on this testnet, I have made it easy to follow.
# All statements beginning with a "#" are not part of the command.
# This guide was written and tested for ubuntu/debian distros of linux.Other OS can alter the code and use for their OS as well as found in the official docs of concordium.
Official Concordium guide link here: https://developers.concordium.com/testnet/docs/quickstart-node#enabling-inbound-connections
LET'S START:
If you haven't added a new user yet, you can do so with my guide at: https://gist.github.com/sieemma/ff71f320bb6a46d24d6e3f2c9ff13306
Also, if you have Host unable to resolve issues, check my guide at: https://gist.github.com/sieemma/4174f10c2cac0b50313b10afc317dd71
# Start by installing docker. If you already have it installed, move to the software installation part.
Install Docker as a root:
sudo su -
sudo apt-get update
# Copy all and paste:
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
# If you are still in the root mode, change to your user:
ctrl + d # i.e Keep pressing the combination until you are logged out of root user.
# Check if everything is working fine:
newgrp docker
sudo usermod -aG docker $USER
docker run hello-world
# You will see:
############################################################################################
~$ docker run hello-world
Hello from Docker!
This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
(amd64)
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.
To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash
Share images, automate workflows, and more with a free Docker ID:
https://hub.docker.com/
For more examples and ideas, visit:
https://docs.docker.com/get-started/
############################################################################################
# The above shows everything is working fine and you are ready to work in.
# Now let's start in:
cd
# download the recent concordium software:
wget https://client-distribution-testnet.concordium.com/concordium-software-linux-0.3.2.tar.gz
# If wget isn't installed by default, install it by: apt-get install wget then restart.
# view content of the archive:
gunzip -l concordium-software-linux-0.3.2.tar.gz
gunzip concordium-software-linux-0.3.2.tar.gz
tar -xvf concordium-software-linux-0.3.2.tar
mkdir Documents
mv $HOME/concordium-software/ $HOME/Documents/
# Now you can delete the empty archive:
sudo rm -rf concordium-software-linux-0.3.2.tar
If you have firewall enabled, then open the following ports. I opened them because I think they are supposed to. You can ask in the discord group for which to open:
sudo ufw allow 8099
sudo ufw allow 8888
sudo ufw allow 8082
OR if ufw isn't enabled and you would like to enable it: Note that it must be done with care.
sudo ufw enable # A must do is the next step. You can also do it as sudo ufw allow [port number] default port number is 22 so like: sudo ufw allow 22. Failure to do so means you can't log in to the vps again.
sudo ufw allow ssh
sudo ufw allow 8099
sudo ufw allow 8888
sudo ufw allow 8082
# As suggested by @koen84 let's close port 10000 if already opened:
sudo ufw deny 10000
Now check if you can log in to a new ssh session by opening a new window. If you have issues loging in, disable the firewall from the
old session
...
Let's continue...
#It is required that the node keeps running even if we exit. There are many ways of doing this. I will go for tmux (get started at https://linuxize.com/post/getting-started-with-tmux)
#Start by installing tmux:
sudo apt install tmux
cd Documents && cd concordium-software
#Open a new session called concordium_node:
tmux new -s concordium_node
# Continue with the installation process from the tmux session.
# Note: change [your_vps_ip_address] to your vps ip address. if your address is 195.34.34.45, change the command below to ./concordium-node --listen-middleware-address 195.34.34.45
# Check your_vps_ip_address with:
curl -sS v4.icanhazip.com
./concordium-node --listen-middleware-address [your_vps_ip_address]
# When asked for a name, choose a username.
name: your_username
# Wait for the setup to finish.
# you can detach from the tmux session and it will keep running.
#Detach from the tmux by using:
ctrl + b, then d # press and hold ctrl + b, release both keys, then press b. Wait for it to be detached.
#To return to the concordium session again, use:
tmux attach-session -t concordium_node
# Detach from the tmux again by using:
ctrl + b, then d # you can always come back and forth with the above commands.
# Seeing your node on the dashboards
# See your node on the Network Dashboard: https://dashboard.testnet.concordium.com/
# Access the node dashboard at http://your_vps_ip:8099
Baking:
Download the wallet app from their official site:
https://developers.concordium.com/testnet/docs/quickstart-baker
Note that the app supports only android versions 8 and above.
In the app, click on the middle tab(identities) and create an identity.
Choose a verification agent and wait for it to be verified.
Now, click on the accounts menu and create your account.
select the account and then request free tokens.
Click on the more tab and select export. Enter a password and download it taking care of the location/path to the file.
send this file to your pc or on the device you will access the node dashboard.
Now visit the node's dashboard at:
http://your_vps_ip:8099
In the next steps, I will use the guide at: https://developers.concordium.com/testnet/docs/quickstart-baker
You can follow it from there.
Click on the import tab and import your exported file and enter the password you used to during the download.
Select on your account
On the baking side, Enter your account password and click on the Start baking with "your account"
Wait for the transaction to be finalized, and then 2 epochs(~2 hours) to become active.
# From this point, you can access your account using the concordium-client.
To start using the concordium-client, you have to open the container where the software is running:
docker exec -it concordium-client /bin/bash
From this bash session, you can use all the commands at:
https://developers.concordium.com/testnet/docs/client
For e.g, to check your lottery power:
concordium-client consensus show-parameters --include-bakers
# Look for your public address for its lottery power.
For accessing the general concordium blockchain, use the set of commands from:
https://developers.concordium.com/testnet/docs/queries#account-state
e.g # replace [concordium_address] with your GTU address or public key.
concordium-client account show [concordium_address] --encrypted
# This will display the account info of that wallet address.
# i.e
concordium-client account show 4stdLq7RzgYqCfedGHdKB6wBuDXr8rDj41hUKtJweqHWBLPzJM --encrypted
# For some reasons, the command below gave a no accounts info. so our imported account info could not be displayed.
concordium-client config show
# You can navigate to the imported account info by:
cd /var/lib/concordium/config/accounts && ls
then
cd [your public address found in the output which should be the same as your wallet address]
Now, ls to show your account keys:
you will find:
encSecretKey.json keypair0.json
to check the info:
cat encSecretKey.json # for encryptedkey info
cat keypair0.json # for keypair info
Alternatively, you can navigate to the concordium software:
cd $HOME/Documents/concordium-software/
Now use the above commands for the concordium client.
# All types of transactions can be performed using concordium-client
Check here:
https://developers.concordium.com/testnet/docs/transactions
This work is still ongoing so more Updates coming soon...
@EK2503
Copy link

EK2503 commented Oct 12, 2020

Thank you so much for your work!

@koen84
Copy link

koen84 commented Oct 12, 2020

In firewall section there's a typo, it's port 8099. And please don't suggest to open port 10000, that's a security risk.

@sieemma
Copy link
Author

sieemma commented Oct 12, 2020

In firewall section there's a typo, it's port 8099. And please don't suggest to open port 10000, that's a security risk.

thanks for pointing this out. Corrected

@koen84
Copy link

koen84 commented Oct 13, 2020

Happy to help. Best of luck.

@ilkerkaan
Copy link

how to run logs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment