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.
- 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.
- 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
- 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:
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:
Now that you have set up your environment, it’s time to start coding. Take a look at step #5 to begin.