Ravi Valecha
4 min readJul 20, 2020

--

Ethereum for web developer

Ethereum is a distributed public block chain, before understanding the decentrealized apps we should know what a blockchain is

A blockchain is a growing list of records, called blocks, which are linked using cryptography. Each block contains a cryptographic hash of the previous block, a timestamp, and transaction data. First block in Block chain is genesis block, whose previous hash value is 0. Blockchain is used for secure transactions. It is a immutable ledger , once a data is record on the block its very difficult to change it.

Now What is Ethereum —Ethereum is a distributed public block chain network that focuses on running programming code in the form of smart contract of any decentralized application known as DApps. In simple, its a platform to share the information across the globe, which can not be altered. Ethereum network are formed by one or more nodes, each node is a machine or a physical device which runs Ethereum client. Each node contain full copy of block chain. Block chain run inside the Ethereum virtual machine.

Smart contracts are the lines of code that can execute any time inside block of block chain if sufficient condition met.

Each node in Ethereum network has —

history of all smart contracts

history of all transactions

current state of all smart contracts

Decenteralized apps -

Decentralized applications are a piece of software that communicates with the blockchain. This includes a frontend, backend and database to store the information. The interface of the decentralized applications does not look any different than any website or mobile app today. The smart contract represents the core logic of a decentralized application. Smart contracts are integral building blocks of blockchains, that process information from external sensors or events and help the blockchain manage the state of all network actors.

The frontend of a decentralized application represents what you see, and the backend represents the entire business logic. This business logic is represented by one or several smart contracts interacting with the underlying blockchain.

Decentralized applications are similar to a traditional Web application. The frontend uses the exact same technology to render the page. It contains a “wallet” that communicates with the blockchain.

Interface to Ethereum Network

Web3 is a JavaScript library that can be used to communicate with an Ethereum node via RPC communication. Web3 works by exposing methods that have been enabled over RPC. This allows the development of user interfaces that make use of the web3 library in order to interact with the contracts deployed over the blockchain. Web3 use Ganache provider to connect with ethereum network. Ganache CLI, part of the Truffle suite of Ethereum development tools, is the command line version of Ganache, your personal blockchain for Ethereum development.

MetaMask is a Google Chrome, Vivaldi, Opera and Firefox extension for the browser which makes it easy for web applications to communicate with the Ethereum blockchain. In other words, MetaMask is a wallet for your browser.

Smart Contract are implemented using Solidity language. Solidity compiler build smart contract and generate

1. Byte code which is ready for deployment, you can use any blockchain test network like Ropsten or Rinkeby to deploy smart contracts

2. Application Binary Interface ( ABI ) — interface for Web3 to communicate with deployed contracts.

Smart Contract can be test using Metamask(Chrome plugin ) or front end application using Web3 provider.

Next part2 is biolerpart code using nodeJS to communicate with smart contract.

--

--