Posts

Showing posts from July, 2021

Introduction to Truffle Framework

Image
Written by Dr. Amol Dhumane ----------------------------------------------------------------------------------------------------------------------------- Install truffle: Go to terminal Write a command ‘npm install –g truffle’                               (g is used for global installation)  Check truffle version using ‘truffle version’ command ---------------------------------------------------------------------------------------------------------------------- ‘truffle init’ command is used to setup the default structure of the truffle project ‘truffle init’ command creates 3 folders: ‘contracts’, ‘migrations’ and ‘test’ folder along with them two javascript files: truffle-config.js and truffle.js ‘contract’ folder is used to place the smart contracts that you have written using solidity language. ‘migration’ folder contains the in...

18 Points One Must Know about ERC20 (Ethereum Request for Comment 20)

Written By Dr. Amol Dhumane “ERC20 is an API that governs how the token should be built” ----------------------------------------------------------------------------------------------------------------------------- Why to use ERC20? We want our token to be built to be compliant and widely accepted e.g. we want this token to be able to be transferred from one account to the other, we want the token to be bought and sold on a cryptocurrency exchange, we want the token to be sold in an Initial Coin Offering (ICO).   ----------------------------------------------------------------------------------------------------------------------------- Exists on the Ethereum platform  These tokens live on Ethereum blockchain. They completely rely on Ethereum blockchain and platform. The native currency on Ethereum is Ether.  Ethereum platform also supports some tokens. These tokens can be created with smart contracts.  These contracts create, manages and keep the track ...

Remix Vs Truffle

Written by: Dr. Amol Dhumane -----------------------------------------------------------------------------------------------------------------------   Remix: 1.        It is an online IDE for solidity programming language 2.        You don’t have to do any installation. Just visit remix.ethereum.org 3.        It has a good visual interface 4.        It is easy to use. Preferred for beginners 5.        Sometimes, experienced smart contract developers also use remix to check some features of smart contract (or to check some functionalities) 6.        It is not extensible 7.        It is also difficult to use in case of real projects   Truffle: 1.        It is a javascript framework for developing smart contracts. 2....

Importance and Role of Gas in Transactions of Ethereum Blockchain

Image
Written By Dr. Amol Dhumane  ---------------------------------------------------------------------------------------------------------------------------  Gas Every time when you send a transaction to the blockchain, you have to pay ‘Gas’ The important thing is, you only need to pay the ‘gas’ when you modify the data on the blockchain. (If you are reading the data, there is no need to pay ‘gas’) In the solidity, all the functions with ‘view’ or ‘pure’ keywords are read-only functions. Execution of such functions do not use ‘gas’.  Gas payer: The sender of the transaction needs to pay the ‘gas’.  Gas receiver: The miner receives ‘gas’.   Here miners are the entities that add data to the blockchain. For the reward of their work, the gas is paid to them.  The gas is paid only when the transaction is included in the blockchain. If the miner does not include our transaction in the blockchain, then gas is not paid to the miners.  Gas is just a measurement. Ev...

Building "Smart Contract" on Ethereum Blockchain using Remix IDE

Image
Written By: Dr. Amol Dhumane Introduction of Smart Contract: ------------------------------------------------------------------------------------------------------------------------- Smart contract is a small program that runs on Ethereum blockchain A smart contract, once it is deployed on Ethereum block cannot be modified/changed. You can change the data of the smart contract, but only the code of smart contract can do that. You need not have to admin the smart contract once you deploy it. The Ethereum blockchain takes care of it. Deploying smart contract requires money (you can pay this using “Ether”). Using smart contract, you can do financial transfer as long as the financial assets that you transfer are native to the blockchain. Solidity is the most popular language to write smart contracts. Solidity is similar to javascript, but one difference is, we need to compile solidity code (in javascript, we write a code and run it in the browser) Solidity code is compiled ...

Setting up a private Ethereum node on Windows Operating System

Image
Written by Dr. Amol Dhumane -------------------------------------------------------------------------------------------------------------------------- Tasks done :  1. Create and configure the genesis block  2. Initialise the genesis block  3. Attach to the private blockchain using javascript console  4. Check the mining process  5. Transfer some ether from one account in to other account.   -------------------------------------------------------------------------------------------------------------------------- 1. Install Geth  2. Install Ganache (it is an Emulator)  3. Open powershell window  4. Create a ‘chainskill/private’ directory using ‘mkdir –p chainskill/private’  5. Chainskill will be the name of our network  6. Now we have to define a genesis block (starting block of blockchain). Creating a genesis block from scratch is painful and reusing an existing one can be a problem with if its version is older than that of you...