Ethereum Client – Parity Features

We are often required to develop websites which incorporate the usage of Web3 in the system. We need an Ethereum node which helps us interact with the Ethereum database to access data and transactions across the blockchain.

Parity has been an excellent choice for us due to the following reasons:

Parity Pruning Algorithm: It’s beneficial if you don’t have a server which massive storage space. With Geth, you’re looking forward to using 20 GB or more disk-space every week. However, Parity does a better job of pruning the data.

Syncing is Fast: If you’d like to quick start with the work, Parity’s warp syncing option is advantageous. Instead of waiting for days and days, you can now have a complete node running in an hour or more.

Passive Mode: It also incorporates a passive mode which helps in reduction of CPU usage. Overall, it also reduces the bandwidth consumption.

Compiling and Installing Ethereum (Geth) on Ubuntu or Debian

In our last post, we wrote a tutorial on how to install Bitcoin Core on your system. In this post, we’re going to write the instructions to install Ethereum at your server.

While, installing Geth is certainly not a PITA, but maintaining it is surely a daunting task, but worth it if you’re looking for the safety and ownership of the funds.

Before we start, it’s very noteworthy to mention that Geth doesn’t run well on HDD. It’s advised that you use a SSD drive with a storage space of 256 GB at minimum to be covered for some time. Our experience with Geth installation on HDD was horrific as it would rarely get in sync with the latest block, many times stop syncing itself and other times crash.

Installing Dependencies

To begin with the installation, we’ll be required to install build-essential and golang at our server.

apt-get update;
apt-get install git build-essential -y;
wget https://storage.googleapis.com/golang/go1.9.1.linux-amd64.tar.gz;
tar -xvf go1.9.1.linux-amd64.tar.gz;
mv go /usr/local;
export GOROOT=/usr/local/go;
export GOPATH=$HOME/Projects/Proj1;
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH;

Compiling and Installing Geth

You can now execute the following commands at your server to download the source files and compile them. Once the process is done, the generated executable file is automatically moved to the root folder.

git clone https://github.com/ethereum/go-ethereum.git;
cd go-ethereum;
make geth;
mv /root/go-ethereum/build/bin/geth /root/;
rm -rf /root/go-ethereum;
rm -rf /root/go1.9.1.linux-amd64.tar.gz;
cd /root;

Example Commands (Bonus!)

Here are few example commands to get Get running at your server.

./geth --rpc
./geth -attach

Compiling and Installing Bitcoin Core on Debian/Ubuntu

There are many events in which you have to run your Bitcoin node. Last time we were developing an application where the client had to accept Bitcoin payments without relying on a third-party API provider, so in that case, usage of Bitcoin Core was essential.

While it’s not totally necessary to use Bitcoin Core, there are other projects which offer the same functionality such as Bitcore and Electrum. In this tutorial, we’re going to cover the installation of Bitcoin Core.

Installing Dependencies

Before you install these dependencies, it would be wise to run the following commands and then the command to install the dependencies.

apt-get update;
apt-get upgrade;
apt-get install git pkg-config libevent-dev build-essential autoconf libssl-dev libboost-dev libboost-chrono-dev libboost-filesystem-dev libboost-program-options-dev libboost-system-dev libboost-test-dev libboost-thread-dev libtool libdb5.3++-dev libdb5.3-dev -y;

Fetching Bitcoin Core Files

Now, we’ll get the latest release (currently: 0.15) from official Bitcoin GitHub account.

cd /root;
git clone -b 0.15 https://github.com/bitcoin/bitcoin.git;
cd bitcoin;

Configuring to Compile Bitcoin Core

We are now configuring the compilation process for the Bitcoin Core.

./autogen.sh;
./configure --without-gui --with-incompatible-bdb;

Compiling & Installing

Now, this is the last major step and it will require a considerable amount of time, so don’t worry and let it continue without any interruptions.

make;
make install;

After you’re done with all the stuff above, Bitcoin Core should be available at your server. You can launch it using the following command: bitcoind and access the JSON-RPC functions using bitcoin-cli, for example: bitcoin-cli listaccounts