Everyone seems to know what blockchain technology is but very few have actually seen the back end of one or been involved in the hands on components to getting one running. For people like myself, who are hands on or visual learners, being able to physically complete tutorials and tasks help us learn 10 times as fast as if we were to read dozens of articles. And yet here I am writing an article about it. The irony…
The purpose of this article is to show you just how easy it is to build a blockchain (Part 1), run a smart contract and dApp (part 2), even with no developer knowledge through the aelf BYOB challenge. Once you’ve read these posts, I hope you will give it a shot yourself.
What is the BYOB Challenge?
As part of aelf’s development, they launched a fully functional enterprise ready blockchain beta platform 1 month ago. Synchronous to this, they have designed tutorials which allow individuals to build their own blockchain on the enterprise platform and run a simple ‘HelloWorld’ Smart Contract and ‘Bingo’ dApp.
Over the last 2 years, aelf has been developing an extremely robust and customizable blockchain ecosystem, doing all the heavy lifting from the development end. As a result enterprises and developers who build on aelf, can spend their valuable resources and time focusing on building the application just as if they were building it on windows or android systems.
On Monday, 10th of June, aelf launched a competition within this challenge to encourage users to test the network, and released a $20,000 prize pool. For more information on this please visit the official announcement
How to Build the Blockchain
To follow along with the tutorial guide see here.
1. Setup the environment
For the majority of users, including myself, we have never done any coding on our personal computers and as such will likely not have the right environment setup. I first had to get a few programs and extensions installed before I could start the build process.
The program we use to run the blockchain and editing the code is Visual Studio. This is called an Integrated development environment (IDE), and since the blockchain will be written in C# language we also need to download the C# extension. The other programs we’ll need are git and Dotnet core SDK. All of these are very simple to download and install as they are executables which install themselves.
2. Get the tutorial ready
Now that we have a basic environment ready, we need to get the files we’ll use in the tutorial, within the command terminal in your computer there is a clone function which basically downloads all the files from github and puts them in a corresponding folder, called ‘aelf-boilerplate’
“git clone https://github.com/AElfProject/aelf-boilerplate”
So far the process is really simple and now we need to open the boilerplate folder in VS (Visual Studio)
Now comes the part that caused me so much stress! Protobuf is a love hate relationship for many of our windows users. It is critical but also can be the point where you run into an error if you are using a windows machine. There are about 3 or 4 different solutions depending on the error you may run into — I won’t go through all the solutions here but you can simply join the telegram group and someone there will direct you with a specific fix since people have already resolved them there. But push through this part if you do have an error. Protobuf, or Protocol Buffer is something which will facilitate network communication and is really important for the future interoperability with other languages and systems in the future, and thus is why our team have incorporated it into the system.
3. Build and run the Blockchain
Now we get to the fun part and you will realize just how simple it is to build a blockchain on aelf!
You should still be in the VS terminal and with two simple lines the blockchain will be automatically built:
Once you run these codes it may take a few seconds to build but that is literally all you will need to do. Then to run a node simple input this command:
“dotnet run bin/Debug/netcoreapp2.2/AElf.Boilerplate.Launcher”
In the next part I will go through the process of running the Smart Contract and dApp. But you can see for someone who already has the environment setup (most enterprises will have someone with a developer background), the blockchain can be built before you even finish your cup of coffee! This will be a game changer for on boarding enterprises to use blockchain. Hopefully, you will have learnt how simple a blockchain is if it is designed well with the correct support.
One of the key hurdles which is creating inhibitions with enterprises making the leap is the amount of resources and time needed to get a dapp running on their own blockchain. This is something aelf is resolving with technology developments like that of the system above. They have also developed the network to be broken down in a modular fashion such that it is quick and simple to customize even once built.