Full Stack Hello World Voting Ethereum Dapp Tutorial — Part 1
In the last post, we explained the high level architecture of Ethereum platform comparing it to a web application. As a developer, the best way to learn any new technology is by diving in and building toy applications. In this post, let’s build a simple ‘Hello World!’ application which is a Voting application.
The application is extremely simple, all it does is initialize a set of contestants, let anyone vote for the candidates and display the total votes received by each candidate. The goal is not to just code an application but to learn the process of compiling, deploying and interacting with it.
We have deliberately avoided using any DApp frameworks to build this application because the frameworks abstract away lot of the details and you fail to understand the internals of the system. Also, when you do use a framework, you will have more appreciation for all the heavy lifting the framework does for you!
In the last section we learned that the software and apps executed by Ethereum Virtual Machine are called smart contracts. A human being and a smart contract are both seen as users on Ethereum. Whatever a human user can do, a smart contract can do too, and then some.
Smart contracts act exactly like any other human user in the network. Both of them can send and receive ether just like any other currency.
To democratize and further boost decentralization of mining Ethereum, apart from introducing the Ethash algorithm, Ethereum has endeavored to remove mining altogether by introducing Proof of Stake for block creation and confirmation of transactions.
What is Proof of Stake?
As a recap, Proof of Work involves supercomputers carrying out complex hashing to discover valid blocks in the hopes of obtaining the reward in the form of new coins.
Proof of Stake is different because it allows anyone who is operating in the blockchain to set up a master node, and stake an amount of ether to be allowed to become a validator. The community will then agree on a way of assigning the rights to create and update new blocks using any consensus algorithm to those who hold these master validator nodes, thereby eliminating mining altogether.
Some of the advantages associated with this change are that