Blockchain Certification Training
- 14k Enrolled Learners
- Live Class
Most commonly heard term across any Blockchain discussion is “Smart Contract”, this has been dubbed as the most compelling feature of Blockchain. A Smart Contract is the backbone of any Ethereum Applications. And setting up a Smart Contract development environment is a very important thing for a Blockchain Developer.
In this Setting up a Smart Contract Development Environment blog, I will be covering the following topics:
Well, doing a simple google search one ends up with multiple links.
Wikipedia definition “A smart contract is a computer protocol intended to digitally facilitate, verify, or enforce the negotiation or performance of a contract.”
Nick Szabo defines a smart contract as a general-purpose computation that takes place on a Blockchain or distributed ledger.
A smart contract, in essence, is a contract built into the code. For example, Purchase order is a contract that exists between a buyer and a seller, keeping it in the simplest form. Certain conditions have to be fulfilled for the purchase order to be executed successfully. Few of the conditions
These are a few of the simple conditions in the simplest of a purchase order.
A smart contract can be summarized as
This blog on Edureka, provides in-depth information about Smart Contracts.
The next big question which comes to mind is how to get started, what is required to build a smart contract. So let’s see how to get started.
In the previous section, we discussed what Smart Contracts are, in this section we are going to look at the following topics:
The choice of the language, to build smart contract is dependent on the blockchain platform. For this blog series, the blockchain platform of choice is Ethereum. Ethereum is the blockchain platform which has been dubbed as “Planetary level computer or world computer”– a huge public network of many private computers that facilitate running of internet applications (DApp – Distributed Applications) without any third parties.
A Smart Contract language (SCL) is a programming language that is either used to write a Smart Contract directly or is compiled to it. Smart Contract languages for Ethereum are:
For this blog series, we are going to focus on Solidity as the smart contract development language. Solidity is the most popular smart contract language for Ethereum. So now we have chosen our language for smart contract development, let us see what is required to get started.
In physics, we have often heard static friction is greater than dynamic friction. Getting started with smart contract requires setting up of development environment, which is the prerequisite. In this blog, we will look at the steps required to set up the development environment and what are the options available. Similarly, knowing about the development environment for Smart Contract development is a greater hurdle than actual development. There are a plethora of choices available, which overwhelm anyone new to building a Smart Contract. Simplifying the environment set up is the first step towards dwelling deeper into the blockchain world. In order to set up the environment for developing a Smart Contract, two choices are available.
The first choice is to use online remix IDE (integrated development environment) to build and test the smart contract. This is a quick, easy and recommended way for beginners.
An alternative to using Remix IDE is to set up a local machine for developing Smart Contracts.
Toolset required for smart contract development is as follows:
The latest version of the node can be downloaded here.
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | bash
nvm install 10.15.0
Visual Studio Code has been one of the best IDE provided by Microsoft for solidity smart contract development. Visual Studio code can be downloaded from here.
Truffle suite provides an excellent framework for Smart Contract. Installation of truffle is done via npm (node package manager), which is installed with node. In order to install truffle, open up the terminal window or command prompt window. In the terminal window run the following command,
npm install -g truffle
(g flag in the command stands for global)
Post installation of truffle is completed, run the following command to verify the version installed
In order to customize the ganache test Ethereum node running, please click on the gear icon on the right corner of the ganache tool, the following screen should be visible.
Port and network id can be customized, post customization, please click on the restart button on the top left corner.
Ganache installation is running and can be interacted with using the above-mentioned RPC endpoint.
The first step in any journey is to understand what path to take and what toolset are available. Now we are aware of what smart contracts are, what is required to build a smart contract. The option of language available and toolset available to build them. This is the first blog in a series which will focus on solidity and smart contract development. In the next blog, we are going to build our first smart contract and start looking into the basics of solidity.
Got a question for us? Please post it on Edureka Community and we will get back to you.
If you wish to learn Blockchain and build a career in Blockchain Technologies, then check out our Blockchain Certification Training which comes with instructor-led live training and real-life project experience. This training will help you understand what is Blockchain in an exhaustive manner and help you achieve mastery over the subject.