Blog_Banner_Asset
    Homebreadcumb forward arrow iconBlogbreadcumb forward arrow iconBlockchain Technologybreadcumb forward arrow iconDeveloping Ethereum DApps: Everything That You Need to Know

Developing Ethereum DApps: Everything That You Need to Know

Last updated:
2nd Sep, 2020
Views
Read Time
6 Mins
share image icon
In this article
Chevron in toc
View All
Developing Ethereum DApps: Everything That You Need to Know

Ever since its release, Ethereum Blockchain has become the talk of the town due to its two USPs, Smart Contracts and Decentralized Applications (DApps). The blockchain network allows businesses and developers to create any number of smart contracts and DApps they want. DApps are decentralized applications that run on smart contracts.

To create these DApps or smart contracts, developers must first write scripts in Solidity Programming Language (used for smart contracts’ coding) and then call various functions to deploy them. An alternative way to run smart contracts is to write bash scripts that would compile and deploy them. Ethereum Truffle suite was introduced to make this process seamless. Apart from the Truffle framework, the suite has several components and features that make it a natural fit for your DApps development needs.

Check out our free courses to get an edge over the competition

Learn Online Software Engineer Courses online from the World’s top Universities. Earn Executive PG Programs, Advanced Certificate Programs or Masters Programs to fast-track your career.

Ads of upGrad blog

Components of Truffle Suite

The Truffle framework suite provides developers with everything that they would want to build an Ethereum blockchain DApp. It allows them to create contracts, compile them, deploy them, test them, and create front-end UI for DApps, making it one of the best frameworks for developing DApps. Truffle suite has three significant components, which are:

  • Truffle Framework: The actual development framework that brings everything right from creating smart contracts to testing and deploying them to a single framework.
  • Ganache: It is a simulator that allows developing and testing Graphical User Interface (GUI) for DApps.
  • Drizzle: It is a front-end library that simplifies the process of developing web applications for DApps.

Check out upGrad’s Advanced Certification in Blockchain

Must Read: Tools For Ethereum Development

Features of Truffle Suite

Truffle suite is equipped with various features that make it a boon for Ethereum DApps developers and one of the most popular IDEs. Here’s what all you get within the framework:

  • A one-stop solution with built-in support for creating, compiling, deploying smart contracts
  • Allows seamless smart contracts linking with web applications
  • Offers automated contract testing
  • Supports console and web apps with its configurable pipeline
  • Built-in support for network and package management
  • Easily compatible with JavaScript, CoffeeScript, ES6, and other front-end languages
  • Enables direct communication with smart contracts

Check out upGrad’s Advanced Certification in DevOps 

Prerequisites for developing DApps on Ethereum Truffle Framework

Before beginning with developing Ethereum DApps, there are a few requisites that we need to take care of. Firstly, we will need to set up the NPM (Node Package Manager) on our computer. 

NPM will help us install the Truffle framework. Secondly, we will need to download and install the Ganache simulator from its official site, which will give us the GUI development 

environment. Lastly, we will need to add a MetaMask extension for our browser. MetaMask is a plugin that allows us to access Ethereum DApps through a browser without becoming an actual blockchain node.

Installing the Truffle Framework

Now that we know about all the prerequisites, it’s time to install the Truffle framework and develop our DApp. To install Truffle, insert the following command in the NPM terminal.

$ npm install -g truffle

Also Read: What is Truffle Suite 

Developing Ethereum DApp using Truffle Framework

The next step is to create a directory for our project. Create a directory and then access it by inserting the following commands:

  1. Create directory: $ mkdir directory_name
  2. Access directory: $ cd directory_name

Once we have installed the Truffle framework, there are two different ways to start a project. 

The first way is to use the command:

$ truffle init

This command will start a bare project. However, there is another way to create a project by unboxing Truffle boxes. These projects have all the necessary configurations and some default code to launch the DApp projects quickly. To initiate such a project, use the following command:

$ truffle unbox metacoin

The next step is to install the Ganache simulator that we downloaded. Ganache simulator runs on localhost by default and provides some default accounts with pre-funded Ethers (meant for testing and don’t have real-world value). These Ethers will help us perform test transactions for our DApp. To install Ganache and then test it, use the following two commands:

Install: $ npm install -g ganache-cli

Test run: $ npm ganache-cli

This test run code will output the default accounts and their private key credentials. We can also use MetaMask mnemonic phrases for testing. All we need to do is add the mnemonic phrase with -m. The command is:

$ npm ganache-cli -m “mnemonic phrase”

Now we need to compile and migrate the smart contracts from our directory to the network. The following commands do this:

$ truffle compile

$ truffle migrate

Ads of upGrad blog

Once these commands are executed, our app will be up and running. Now we can create multiple accounts from the MetaMask plugin and initiate transactions to test our DApp.

Check out: Best Ethereum Wallets

Wrapping Up

That’s how you can develop and test Ethereum DApps using the Truffle framework. DApps are just one of the many utilities of the Ethereum Network. Ethereum has a lot more to offer, thanks to the decentralized blockchain technology. upGrad can help you learn everything about blockchain. If you want to develop smart contracts & DApps and pursue a career in blockchain, checkout IIIT-B & upGrad’s Advanced certificate program in blockchain technology.

Profile

Mayank Sahu

Blog Author
Mayank Sahu is the Program Marketing Manager with upGrad for all emerging technology vertical. His past experience is in analytics industry extensively in healthcare Domain. Mayank has completed his Graduation from IIT Delhi.
Get Free Consultation

Select Coursecaret down icon
Selectcaret down icon
By clicking 'Submit' you Agree to  
UpGrad's Terms & Conditions

Our Popular Blockchain Course

Frequently Asked Questions (FAQs)

1What is the difference between Ethereum DApps and normal apps?

Ethereum DApps differ from regular applications in that they are constructed on the blockchain, but regular apps are not. Ethereum DApps are decentralized, which means they aren't controlled by a single body, and transparent, which means anyone can see what they're up to. Because they are stored on the blockchain, they are also impossible to alter with. They are also secure since they employ encryption to prevent hacking. Ethereum DApps can also be used to create money by charging customers for the services they deliver. On the other hand, Standard apps are neither decentralized, transparent, nor secure.

2What are some applications of DApps?

By removing the need for intermediaries, DApps can help to streamline the banking and financial services industry. This can help lower transaction costs and improve the efficiency of the process. They can also control the supply chain by tracking shipments and ensuring that the information is secure. This can help increase the supply chain's efficiency and lower the cost of doing business. They can also secure the voting process by keeping track of votes and avoiding fraud. This can serve to improve the voting process' accuracy and boost voter confidence in the system. Finally, it may manage the healthcare industry by recording patients' medical histories and assuring patient data protection. This can help increase the healthcare sector's efficiency and lower the cost of providing healthcare services.

3What is the difference between a smart contract and a DApp?

A smart contract is a self-executing contract embedded in the blockchain. A decentralized application built on blockchain technology is known as a DApp. It makes use of smart contracts to make an application that is more safe and efficient. Smart contracts allow parties to make and execute agreements without the involvement of a third party. Because they are run on a blockchain platform, they are also transparent and secure.

Explore Free Courses

Suggested Blogs

Top 12 Highest Paying Blockchain Jobs in India [A Complete Report]
900282
Blockchain is an emerging job skill in the IT industry. Technological advancements are gradually bringing this distributed ledger technology to the ma
Read More

by Mayank Sahu

19 Feb 2024

Skills Needed to Become a Blockchain Developer
53713
Blockchain development is one of the fastest-growing sectors. Companies are looking for blockchain developers to make new implementations, advance the
Read More

by Mayank Sahu

Prerequisites to Learn Blockchain Technology: It’s Not What You Think It Is
53959
There has been a massive development in the field of Blockchain technology in the last decade. Many people and companies came to know about Blockchain
Read More

by Mayank Sahu

16 Feb 2024

Blockchain Developer Salary in India 2024 [For Freshers & Experienced]
901935
The Blockchain Era is has arrived, and it is now. Enterprises across various sectors of the industry are warming up to the concept of the decentralize
Read More

by upGrad

11 Feb 2024

Top 10 Interesting Blockchain Project Ideas for Beginners/Students [2024]
174887
Summary: In this Article, you will learn top 10 interesting blockchain project Ideas for beginners. Trusted Crowdfunding Platform Using a Smart Cont
Read More

by upGrad

14 Jan 2024

Blockchain Applications in Supply Chain
5613
The distributed-nature technology of Blockchain has disrupted many industries, with its uses and blockchain applications in supply chain leading to in
Read More

by Radhika Maloo

28 Aug 2023

Applications of Blockchain in Healthcare Industry
6539
After taking the finance and business sector by storm, Blockchain applications in healthcare are now all set to radicalize the healthcare industry. Ev
Read More

by Shubham Chakraborty

23 Aug 2023

What is Ripple Blockchain? Everything You Need to Know in 2024
7141
Ripple is a popular name in the tech industry. And Ripple blockchain has created a lot of buzzes. We all know how blockchain is transforming the indus
Read More

by Mayank Sahu

21 Aug 2023

How Blockchain in Transforming Manufacturing Industry [2024]
6116
How Today’s Large Scale Industries Leverage Blockchain to Scale Their Manufacturing Process As a foundation for distributed ledgers, blockchain is an
Read More

by Mayank Sahu

26 Jun 2023

Schedule 1:1 free counsellingTalk to Career Expert
icon
footer sticky close icon