Polkadot. Parachains. Moonbeam

I think that each of you has heard about Polkadot, about its parachains, but I often come across the fact that people are limited only by the knowledge of the name of these terms. I would like to provide basic information in the abstract, as well as tell you how you can run your node.

Orangeclub
6 min readFeb 27, 2021

I will try to convey the information in simple words, so if you basically understand what a blockchain is, then everything will be clear to you.

If you are not familiar with the term blockchain at all, then I can advise you to go my way. Start here: https://en.wikipedia.org/wiki/Blockchain As soon as you see a word that is unfamiliar to you, Google it!

So, Polkadot is a blockchain platform that combines other blockchains into a common ecosystem. Within this ecosystem, blockchains can operate with each other: exchange messages, tokens, and share their unique functions, while maintaining overall security, due to the fact that the load on the network is distributed among all blockchains operating within the Polkadot ecosystem.

Parachains.

Globally, the entire ecosystem consists of three different components:

  • Parachains. One of the key terms in the Polkadot network. Parachains are exactly the blockchains that work in parallel, in one common Polkadot ecosystem. They solve both their own tasks and the general tasks of the entire chain. Each parachain is usually a blockchain (although not necessarily) that pursues its own goals and objectives. At the same time, it works in the overall Polkadot ecosystem, helping this system to work under any load.
  • Relay Chain. It is the center of the entire ecosystem. It ensures the exchange of transactions between the parachains, guarantees the achievement of consensus between them and the overall security of the system.
  • Bridges. Blockchain projects that have their own blockchain and for some reason cannot or do not want to transfer it to Polkadot, but want to work within the ecosystem — they can use special bridges for this.

I have briefly described the basic concepts so that you have an idea about the ecosystem as a whole. If you want to learn more here is all the information: https://wiki.polkadot.network/en/

Moonbeam is a blockchain platform for creating smart contracts. Developers can quickly create applications that work with users and assets on remote blockchains, using the compatibility of Moonbeam smart contracts with Ethereum web tools. One of the main features is that any DApp on solidity from the ethereum network can be transferred to the polkadot network. Thus, solidity developers, who are still the majority in the crypto industry at the moment, will be able to easily launch their applications in the polkadot ecosystem, using moonbeam. All this contributes to the development of the entire crypto industry as a whole. You can easily become a participant in this process, to begin with, you run your own node.

Among many validators with experience, you can often find the opinion that it is better for beginners not to do this. Like, they ask stupid questions and can generally ruin the entire network : — D. I strongly disagree with this, because the more nodes are launched, the more decentralization we can achieve and the more people will understand the work of the blockchain from the inside.
I will provide you with a basic FAQ, for beginners. Of course, if you want to do this further, you need to learn the basics of linux. But while we are in the test network — you can experiment as you like =).

So. If you have never encountered the launch of a node, then the first block of information is for you.
1. Register an account www.hetzner.com and create a new project.

Create server

As part of the testnet, this configuration will suffice.

You will receive an email with a password to access the server, and while we are waiting for it, we will install the Putty program to connect to the server: https://www.putty.org/

Install and run it. You will see such window:

It’s time to check our e-mail. There will be an IP address, which we will enter in the window that I highlighted in the previous picture.

A black window will open, where you will need to enter login: root, then the password that you received in the email. The password will not be displayed when you enter it — don’t worry, this is a linux security system :-)

After that, you will be asked to enter the password sent to the email again, and then come up with your own and repeat it.

Next, enter the following commands in turn, one at a time, and after each press “ Enter”.

  1. Install the necessary updates
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install build-essential -y
apt install git -y
apt install fail2ban -y

2. Install the substrate platform and directly compile the moonbeam sources.

git clone https://github.com/PureStake/moonbeam 
cd moonbeam
git checkout tags/$(git tag | tail -1)
curl https://getsubstrate.io -sSf | bash -s -- --fast
./scripts/init.sh

Log out and log back in to the server.

cd moonbeam
cargo build --release

When the process will finish, you’ll see something like this:

source $HOME/.cargo/env

Next, we will run the node in systemctl

adduser moonbase_service --system --no-create-home
mkdir /var/lib/alphanet-data
chmod 0755 /var/lib/alphanet-data
chown moonbase_service /var/lib/alphanet-data
cp ./target/release/moonbeam /var/lib/alphanet-data

Next, create the moonbeam.service file

nano /etc/systemd/system/moonbeam.service

Copy all this text there, after replacing the nickname with your own in two places <YOUR_USERNAME>:

[Unit]
Description="Moonbase Alpha systemd service"
After=network.target
StartLimitIntervalSec=0
[Service]
Type=simple
Restart=on-failure
RestartSec=10
User=moonbase_service
SyslogIdentifier=moonbase
SyslogFacility=local7
KillSignal=SIGHUP
ExecStart=/var/lib/alphanet-data/moonbeam \
--parachain-id 1000 \
--port 30333 \
--rpc-port 9933 \
--ws-port 9944 \
--pruning=archive \
--unsafe-rpc-external \
--unsafe-ws-external \
--rpc-methods=Safe \
--rpc-cors all \
--log rpc=info \
--base-path /var/lib/alphanet-data \
--chain alphanet \
--name "YOUR_USERNAME" \
-- \
--port 30334 \
--rpc-port 9934 \
--ws-port 9945 \
--pruning=archive \
--name="YOUR_USERNAME"
[Install]
WantedBy=multi-user.target

This is what it should look like:

Press “Ctrl+x”, “Y”, “Enter”

And now let’s start!

systemctl enable moonbeam.service 
systemctl start moonbeam.service

Check logs

journalctl -f -u moonbeam.service

You’ll see something like this:

The number of peers will increase, the node will synchronize. Now you are the part of Moonbeam!

For more information you can check official docs: https://docs.moonbeam.network/node-operators/networks/full-node/

Twitter: https://twitter.com/MoonbeamNetwork

Telegram: https://t.me/Moonbeam_Official

Discord: https://discord.com/invite/PfpUATX

--

--