How to set up an Ethereum Parity node in DigitalOcean – Ubuntu 14.04.4

in #ethereum8 years ago

Introduction
At this time, Ethereum is the second Blockchain with more market cap worldwide, and also the most used to develop and test Smart Contracts.  

Sometimes, developers don’t have time to wait for their computer to synchronize the entire Ethereum Blockchain, or need to have a server running an Ethereum node to feed their site or DAPP.

In this guide, we’ll focus on getting an Ethereum node set up using the Ethereum Light Client, Parity, on Ubuntu 14.04.

Prerequisites
Before you begin this guide, there are some important steps that you need to complete on your server, which needs to have more than 20GB of hard disk to be sure that will be able to hold all the Ethereum Blockchain in the future.

We will be proceeding through these steps as a non-root user with sudo privileges, so you will need to have one available. You can find out how to create a user with sudo privileges by following steps 1-4 in this Ubuntu 14.04 initial server setup guide.

When you are finished with these steps, you can continue with this guide.

Step One — Install Rust

In oder to be able to build Parity (The Ethereum Light Client that we’re going to use) we will need to install Rust in our droplet.Rust is a systems programming language that runs blazingly fast, prevents segfaults, and guarantees thread safety.We will install it with just one line of code:

curl https://sh.rustup.rs -sSf | sh

Step Two — Install Parity

Parity is the world’s fastest and lightest Ethereum client and is integrated directly into any web browser. Using it you can access all the features of the Ethereum network including powerful Decentralised applications and the multitude of cryptocurrencies issued on Ethereum. 

The source code under the GPLv3 licence and you can use it for any of your Ethereum needs.To install Parity you just need to write one line of code in your console:

bash <(curl https://get.parity.io -Lk)

Step Three — Synchronise the Ethereum Blockchain
To run Parity in background, you just need to execute the following command:

nohup parity 2>&1 &

Then, you’ll node will be up, but you’ll still need to sync your node with the Ethereum Blockchain, which will take a while.

You can check the state of the synchronisation following the next optional steps.

(Optional) Step Four — Install Node.js

Node.js is a Javascript platform for server-side programming that allows users to build network applications quickly. By leveraging Javascript on both the front-end and the back-end, development can be more consistent and be designed within the same system.

With Node.js we’ll be able to execute a script to see the state of the synchronisation.To install it, you just need to write this command in your console:

sudo apt-get update
sudo apt-get install nodejs

Then, we’ll install npm, which is the Node.js package manager, with this simple command:

sudo apt-get install npm

This will allow you to easily install modules and packages to use with Node.js, just like Web3.js, the Ethereum Compatible JavaScript API which we’ll be using.

(Optional) Step Five — Install Web3.js

As said before, Web3.js is the Ethereum Compatible JavaScript API which we’ll be using to check the status of the Ethereum Blockchain Synchronization in our node.

To install it, we only will need to type this in our terminal:

npm install web3

Then, we’ll be ready to check our Blockchain synchronization status.

(Optional) Step Six — Check the Ethereum Blockchain synchronization status

Right now, we are ready to initialize a node console and check the status of the Blockchain, so we’ll start this console just typing:

node

Then, we’ll write this few lines to start a valid instance of Web3.js:

var Web3 = require('web3');
var web3 = new Web3();
web3.setProvider(new Web3.providers.HttpProvider('http://localhost:8545'));

Now that we have correctly instantiated the web3 object, we can now execute this line of code the times we want to check the state of our Ethereum Blockchain:

web3.eth.syncing

If our copy of the Ethereum Blockchain is not completed yet, we’ll get a sync object, which look like this:

{
startingBlock: 300,
currentBlock: 312,
highestBlock: 512
}

When our copy of the Blockchain is complete, we’ll get a false as a result of this check, and then, our own Ethereum Node will be up and running in our DigitalOcean Droplet.

Remember, at Atraura we are experts in Blockchain Technology, and can help you in any sense related, if you have some doubt or project idea, do not hesitate to contact us!

Sort:  

Congratulations @anrodon! You have received a personal award!

2 Years on Steemit
Click on the badge to view your Board of Honor.

Do not miss the last post from @steemitboard:
SteemitBoard World Cup Contest - Semi Finals - Day 1


Participate in the SteemitBoard World Cup Contest!
Collect World Cup badges and win free SBD
Support the Gold Sponsors of the contest: @good-karma and @lukestokes


Do you like SteemitBoard's project? Then Vote for its witness and get one more award!

Congratulations @anrodon! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 3 years!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Vote for @Steemitboard as a witness to get one more award and increased upvotes!

Coin Marketplace

STEEM 0.17
TRX 0.13
JST 0.027
BTC 58309.71
ETH 2617.30
USDT 1.00
SBD 2.42