Step #4: Setting up the Ethereum Blockchain Development Environment


Ethereum Blockchain Node Software

Install Ethereum Node Software – After installing Python, we need to install the Ethereum Node software which will allow us to develop smart contracts and decentralized applications on the Ethereum blockchain. We can download the latest version of the Ethereum software from https://ethereum.org. Once we have downloaded the installer, we need to run it and follow the instructions to install the Ethereum software on our computer.

  1. The first step in getting started with the Ethereum node installation is to pick a node or provider. There are two different types of nodes, a local one or a hosted one. For the sake of speed and simplicity, we’re just going to select a hosted node (since a local one would need to download the full history of the Ethereum blockchain to your machine, and this would be counterproductive to the goal of this guide). For our purpose, we will go ahead and utilize the Infura node host/provider.
  2. The second step is to create a free account. Once your free account is created, create a new project.  We’ll call our project “Robotics Swarm Blockchain
    “.

    AweRobotics.com - Step-by-Step Guide to Building a Python-Based Blockchain for Robotics Swarm Control - Infura - Create Project

  3. The 3rd step is to connect to the new node and test out the connection to make sure all is working well. In our case we will be utilizing the “mainnet” end-point. The format of the link to be used to connect to your new node is as follows:

    https://<endpoint>.infura.io/v3/<project_id>

    The end-point is shown in either HTML or WebSockets format. For our project, we will utilize the default HTML format.

2. Create a Blockchain Project Folder

Once we have installed both Python and the Ethereum software, we need to create a project folder for our blockchain project. We can name this folder anything we want, but for this tutorial, we will name it “blockchain-project”. Inside the “blockchain-project” folder, we need to create a file named “ blockchain.py”. This file will contain the code for our blockchain. You can do this with a text editor.

3. Import Required Libraries

Before we start coding our blockchain, we need to import some required libraries. For our project, we will be using the following libraries: “flask” library which will allow us to create a web application for our blockchain, the “ requests” library which will allow us to make HTTP requests, and the “ JSON” library which will allow us to work with JSON data.

To import the flask, requests and JSON libraries with python, you will need to first install these libraries. This can be done using pip:

pip install flask

pip install requests

pip install json

Once the libraries are installed, you can then import them in your python code:

import flask

import requests

import json

Now that you have set up your environment, it’s time to start coding. Take a look at step #5 to begin.



Dive into the World of Robotics – It's Absolutely FREE!

Unravel the secrets of robots with our FREE 10-Module "Introduction to Robotics" Course! Begin your exciting adventure into the world of robotics Today!

Just type in your name and email address and we'll send you a link to the course.

We respect your email privacy

[site_reviews assigned_posts=”post_id”]

Dive into the World of Robotics – It's Absolutely FREE!

Unravel the secrets of robots with our FREE 10-Module "Introduction to Robotics" Course! Begin your exciting adventure into the world of robotics Today!

Just type in your name and email address and we'll send you a link to the course.

We respect your email privacy