A hands-on approach to understanding the Ethereum Blockchain

What's a Blockchain and where can I get one?

  When people hear the term Blockchain, most people think of the cryptocurrencies Bitcoin or Ethereum. What most people don’t realize that cryptocurrency is just an implementation of blockchain technology. Bitcoin is pretty straight forward. Users can earn Bitcoins and transfer them to others using the Bitcoin network. Ethereum is similar where users can mine and transfer ether, but the network also has an extra feature. This extra feature is known as a smart contract. There have been proposals to utilize these smart contracts in various ways, such as using smart contracts to help with the creation, updating, and transfer of medical records. To put it simply: smart contracts allow programs to run using the Ethereum blockchain. Applications that use the Ethereum network are also known as Distributed Applications or dApps. The goal of this project is to create an environment where developers can automate the deployment and usage of smart contracts under a set of controlled conditions. This could also help researchers understand Ethereum blockchain interactions at a deeper level.

Nodes proposing new blocks on the blockchain

Network simulation components

  The network is set up by using Docker. Each Docker instance or container is a node based on a Linux Docker image. This image is running the Geth Ethereum client. One node is known as the boot node which allows other nodes on the network to find each other. Other nodes will be used to conduct transactions and deploy smart contracts. Nodes can be accessed and controlled via the Web3.py library with pre-made scripts. The smart contracts that are used on the network are developed in Solidity.

brownie

Deployment of a smart contract using Brownie

Previous iteration of the project

  The network can be set up, nodes can be told to start and stop mining, transactions can be looked up, and smart contracts can be deployed from a single node. This is project is being developed by myself under the guidance of Dr.Yingfei Dong. There are many challenges in regard to blockchain development. For example, there are tutorials, but many of them use IDEs that can’t connect to private networks easily. This glosses over the process of compilation and deployment of smart contracts. These IDEs also provide an environment to test your smart contracts,but as mentioned it’s difficult to emulate this behavior on the actual network. Although this project has been challenging it’s exciting to be going into somewhat uncharted territory.

Current iteration of the project

  The project no longer uses Brownie to compile and deploy smart contracts. It’s much easier to utilize the Web3.py library in combination with the Python Solidity Compiler to compile, deploy, and interact with smart contracts. This project highlights some “mysteries” of blockchain. For example, this project highlighted that blocks can be mined without any transactions in order to satisfy the longest chain rule. It was also through this project that the importance of the Bootstrap node or Bootnode, and how they’re utilized to connect various clusters of nodes around the network. This project is also able to see the Ethash algorithm in real time, wheres simulated networks such as Ganache don’t allow for the same experience.

interaction log

A detailed log of a smart contract deployment and interaction from two other nodes on the network.