Blocknet Decentralized Full Node Services Are Coming to Ethereum

The Blocknet Protocol
7 min readJan 15, 2020

--

At Blocknet, we specialize in interoperability and inter-chain communication, and we are proud to bring these services to the Ethereum ecosystem. For quite some time now, full ETH archival nodes and services alike have posed a major problem to the Ethereum ecosystem — a problem the Blocknet Protocol is happy to solve. Through our network of fully decentralized Service Nodes spread across the world leveraging our very own XRouter technology, we are able to provide decentralized access to the Ethereum blockchain in its entirety to developers, organizations, DeFi, smart contracts, and more. Heavily centralized systems and services like Infura carry extremely high risks related to centralized designs including and not limited to quality of service, downtime, anonymity, and attacks. Because the Blocknet Protocol doesn’t have any single point of failure, we are able to remove all the issues that come along with centralized designs.

If you would like to find out more about this technology (including testing and building on our services), please feel free to visit blocknet.co and stop by the Blocknet Discord server to get in touch with us:

Ethereum Setup Guide For Blocknet Service Nodes

The following guide will help get Blocknet Service Nodes staged to support decentralized Ethereum services on the Blocknet Protocol. We recommend staging in Docker containers, but users can leverage whatever environment they’re most comfortable with in order to get a full ETH archival node in sync.

In this guide we’ll cover getting both Parity and Go-Ethereum ( geth) full nodes in sync - we don't have one in particular that we prefer, so feel free to use whichever one you like most and are most comfortable with. We'll cover getting both Parity and geth setup in Docker as well as built from source and setup using an install script. These guides will be based on Ubuntu 18.04.

Things to Note

  • It is recommended to run ETH on a Linux-based machine or VM. For example, Parity is single-threaded when run on Windows! We’ve also seen issues related to port consumption on Windows (WSL included) which lead to all ports being consumed causing a mess!
  • SSDs are required! There are hundreds of transactions each Ethereum block — you will likely never get a full archival node synced up with a HDD and it’ll struggle to stay caught up if ever synced.
  • The Ethereum blockchain is quite large and currently is about 3.6 TB in size! Please plan accordingly as the blockchain’s size is increasing by about 1.6 TB/year!
  • Although we’ve found Ethereum to be extremely durable (has a fair amount of resistance to ungraceful shutdowns and such), you’re going to want to make sure you have regular backups just in case something disastrous happens that corrupts your block database.
  • Patience is required! On a decent machine it can still take over 2 months to get Ethereum synced.

geth Docker Setup Guide

If you don’t have Docker installed, there are various guides you can follow including this one here

Staging

For an easy way to persist your blockchain data outside of your Docker container on your host machine, you should leverage the docker -v functionality for your geth container.

Step 1

Choose a location you plan on using for your geth volume. For this example we'll use /opt/geth/.ethereum

Step 2

Create the directory and enter it

  • mkdir -p /opt/geth/.ethereum
  • cd /opt/geth/.ethereum

Step 3

Create your geth configuration file named config.toml and paste the following in it and save the file:

config.toml

Done!

Setup

Now that you’re properly staged, we can pull the image and run the geth Docker container.

Step 1

Pull the official geth Docker Image:

  • docker pull ethereum/client-go

Step 2

Run your container:

  • docker run -d -p 8545:8545 -p 8546:8546 -p 8547:8547 -p 30303:30303 -v /opt/geth/.ethereum:/root/.ethereum --name geth ethereum/client-go --config /root/.ethereum/config.toml

Done!

if you run into permission denied issues related to leveraging docker -v, please research chown such as chown -R 1000:1000 /opt/geth

Controlling Your geth Container

The docker run command from the Setup section is used to first run and start your container. After this, you'll be leveraging the docker attach,docker stop, and docker start commands.

To gracefully shutdown geth running in your container, follow these steps:

Step 1

Enter your container

  • docker attach geth

Step 2

Gracefully shutdown geth

  • ctrl+c or
  • pkill -SIGINT geth

Done!

After geth shuts down, you should automatically exit the container - if for some reason you do not, make sure geth is indeed shutdown by checking top. When you confirm geth is shut down, you can then proceed to type and enter exit to exit the container and subsequently stop it with docker stop geth.

Warning: Stopping a container with geth actively running in it can lead to database corruption issues!

Starting, Entering, and Exiting the Container

  • To start the container: docker start geth
  • To enter the container: docker attach geth
  • To exit the container and keep it running: ctrl+p+q

Removing the Container

  • With the container stopped, docker rm geth

Reading your geth Container Logs

From outside the container:

  • docker logs -f geth where -f will follow the console output

If you have quite a large output because geth has been running for a while, you can choose to only check back a few lines from the current spot by:

  • docker logs -f --tail 10 geth where 10 is how many lines you wish to display backwards from the current spot.

If you wish to look for something specific (for example Imported), you can leverage grep:

  • docker logs -f --tail 10 geth | grep Imported
  • To exit the logs, simply ctrl+c

Enter the container in a system shell

  • docker exec -ti geth /bin/sh

To exit:

  • exit or ctrl+p+q

Building geth From Source

The following script will install all required dependencies, build and install geth, and generate the required config files.

Step 1

Create geth.sh and paste the following contents into the file and save it:

geth.sh

Step 2

Run the script

  • chmod +x geth.sh
  • ./geth.sh

Done!

Starting geth

After the install script is finished, you can now navigate to and start geth:

  • cd ~/go-ethereum/build/bin
  • ./geth --config ~/.ethereum/config.toml

Stopping geth

To stop geth, you can ctrl+c the active console or you can pkill --signal SIGINT geth until you see it shut down and subsequently disappear in top

Parity Docker Setup Guide

If you don’t have Docker installed, there are various guides you can follow including this one here.

Staging

For an easy way to persist your blockchain data outside of your Docker container to your host machine and desired location, you should leverage the docker -v functionality for your parity container.

Step 1

Choose a location you plan on using for your parity volume. For this example we'll use /opt/parity

Step 2

Create the directory and enter it

  • mkdir -p /opt/parity
  • cd /opt/parity

Step 3

Create your parity configuration file named config.toml and paste the following in it and save it:

config.toml

Done!

if you run into permission denied issues related to leveraging docker -v, please research chown such as chown -R 1000:1000 /opt/parity

Setup

Now that you’re properly staged, we can pull the image and run the parity Docker container.

Step 1

Pull the official parity Docker Image:

  • docker pull parity/parity

Step 2

Run your container:

  • docker run -d -p 5001:5001 -p 30303:30303 -v /opt/parity:/root/.local/share/io.parity.ethereum --name parity parity/parity

Done!

if you run into permission denied issues related to leveraging docker -v, please research chown such as chown -R 1000:1000 /opt/parity

Controlling Your Parity Container

The docker run command from the Setup section is used to first run and start your container. After this, you'll be leveraging the docker attach,docker stop , and docker start commands.

To gracefully shutdown parity running in your container, follow these steps:

Step 1

Enter your container

  • docker attach parity

Step 2

Gracefully shutdown parity

  • ctrl+c or
  • pkill --signal SIGINT parity

Another trick you can use to gracefully shutdown your parity container is:

  • docker kill --signal=SIGINT parity from outside the container

Done!

After parity shuts down, you should automatically exit the container - if for some reason you do not, make sure parity is indeed shutdown by checking top. When you confirm parity is shut down, you can then proceed to type and enter exit to exit the container and subsequently stop it with docker stop parity.

Warning: Stopping a container with parity actively running in it can lead to database corruption issues!

Starting, Entering, and Exiting the Container

  • To start the container: docker start parity
  • To enter the container: docker attach parity
  • To exit the container and keep it running: ctrl+p+q

Removing the container

  • With the container stopped, docker rm parity

Reading your parity Container Logs

From outside the container:

  • docker logs -f parity where -f will follow the console output

If you have quite a large output because parity has been running for a while, you can choose to only check back a few lines from the current spot by:

  • docker logs -f --tail 10 parity where 10 is how many lines you wish to display backwards from the current spot

If you wish to look for something specific (for example, Imported), you can leverage grep:

  • docker logs -f --tail 10 parity 2>&1 | grep Imported

Enter the container in a bash shell

  • docker exec -ti parity /bin/bash

To exit:

  • exit or ctrl+p+q

Building parity From Source

The following script will install all required dependencies, build and install parity, and generate the required config files.

Step 1

Create parity.sh and paste the following contents into the file and save it:

parity.sh

Step 2

Run the script

  • chmod +x parity.sh
  • ./parity.sh

Done!

Starting parity

After the install script is finished, you can now navigate to and start parity:

  • cd ~/parity-ethereum/target/release
  • ./parity

Stopping parity

To stop parity, you can ctrl+c the active console or you can pkill --signal SIGINT parity until you see it shut down and subsequently disappear in top

Gist version of guide: Ethereum Setup Guide

--

--

The Blocknet Protocol
The Blocknet Protocol

Written by The Blocknet Protocol

Blocknet is a 2nd layer blockchain interoperability protocol that enables communication, interaction & exchange between different blockchains.

No responses yet