Ethereum – Ganache for Blockchain

Last updated on Oct 20 2021
Avinash Malviya

Table of Contents

Ethereum – Ganache for Blockchain

Ganache is used for setting up a personal Ethereum Blockchain for testing your Solidity contracts. It provides more features when compared to Remix. You will learn about the features when you work out with Ganache. Before you begin using Ganache, you must first download and install the Blockchain on your local machine.

Downloading Ganache

You may download Ganache from the following URL −
https://truffleframework.com/ganache
Ganache is available on several platforms. We developed and tested this entire tutorial on Mac. Thus, the screenshots below will show Mac installation. When you open the installation URL given above, it automatically detects your machine’s OS and directs you to the appropriate binary installation. The screenshot below shows the Mac installation.

Page 1 Image 1 7
Downloading Ganache

When you click on the DOWNLOAD button, it will begin downloading the DMG file for Mac installation.

Installing Ganache

Locate the “Ganache-2.0.0.dmg” in your Downloads folder and double-click on it to install Ganache. Upon successful installation, the following screen will appear −

Page 2 Image 2 6
Installing Ganache

Drag Ganache icon to the Application folder. Now, Ganache is available as an application on your Mac.
If you are using some other OS, follow the instructions provided for successful installation.

Starting Ganache

Now locate Ganache in your Application folder and double-click on its icon to start Ganache.
Ganache Desktop
When Ganache starts, the Ganache screen will appear as shown below −

Page 3 Image 3 2
Ganache Desktop

Click QUICKSTART to start Ganache. You will see Ganache console as shown below −

Page 3 Image 4 4
QUICKSTART

The console in the above screenshot shows two user accounts with balance of 100 ETH (Ether – a currency for transaction on Ethereum platform). It also shows a transaction count of zero for each account. As the user has not performed any transactions so far, this count is obviously zero.
We will now get an overview of a few important screens of Ganache that are of immediate relevance to us.

Ethereum – Ganache Server Settings

Click on the settings icon at the top right hand side of the screen as shown in the screenshot below −

Page 5 Image 5 1
Settings

The server settings screen will appear as shown below −

Page 5 Image 6 1
server settings

Here, you will be able to set the values of server address and the port number for your Ganache server. For the time being, leave these to their default values. The Network ID is an internal Blockchain identifier of Ganache server; leave this to its default value. The Automine button is in the ON state indicating that the transactions would be processed instantly. If you switched this off, it will ask you to enter the time in seconds after which the blocks would be mined.

Account and Keys

When you click on the Accounts & Keys menu option, you will see the following screen −

Page 6 Image 7
Accounts & Keys

Here you would be able to set the default balance for each account. The default value is 100. This now explains why you saw 100 ETH displayed for each account in the Desktop screenshot. You can also set the number of accounts on this screen. The value displayed in this screenshot is 2 and that is why the desktop showed only two accounts.
Now, we will work out with the two settings’ screen; the knowledge of how these two work would suffice. Restart the server by clicking on the RESTART button in the right hand side of the screen. You will now return to the Desktop screen. Try inputting different values in the above two fields, restart the server and see its effect.

Ethereum – A Quick Walkthrough

We will now briefly understand what is available on the Ganache desktop. On the Desktop, at the top we have several menu options out of which a few are of immediate relevance to us. The menu bar is highlighted in the screenshot below −

Page 7 Image 8
Ganache desktop

Clicking on the TRANSACTIONS menu shows all the transactions performed so far. You will be performing transactions very soon. Now, come back to the above screen and check the transactions from time to time. A typical transaction screen is as shown below −

Page 7 Image 9 1
TRANSACTIONS menu

Likewise, when you click on the BLOCKS menu, you will see the various mined blocks. Consider the following screenshot to understand how the BLOCKS menu looks like −

Page 7 Image 10
BLOCKS menu

Click on the LOGS menu. It will open the system log for you. Here, you can examine the various operations that you have performed on the Ethereum Blockchain.
Now, as you have understood how to use Ganache for setting up a private Ethereum Blockchain, you will now create a few clients who would use this Blockchain.
So, this brings us to the end of blog. This Tecklearn ‘Ethereum – Ganache for BlockChain’ blog helps you with commonly asked questions if you are looking out for a job in BlockChain or Ethereum. If you wish to learn BlockChain or Ethereum and build a career in BlockChain domain, then check out our interactive, Blockchain and Ethereum Developer Training, that comes with 24*7 support to guide you throughout your learning period. Please find the link for course details:

https://www.tecklearn.com/course/blockchain-and-ethereum-certification-training/

Blockchain and Ethereum Developer Training

About the Course

Tecklearn’s Blockchain and Ethereum Certification Training course in the blockchain technology that covers essential concepts like Blockchain programming, Ethereum, Solidity, Digital ledger types, Smart Contracts, Multichain, Bitcoin mining, Cryptocurrency, etc. The course provides an overview of the structure and mechanism of Blockchain. You will learn about the Ethereum ecosystem, how smart contracts are developed using Solidity and how to deploy a business network using Hyperledger Compose.

Why Should you take BlockChain and Ethereum Certification Training?

• The average salary of a Blockchain Ethereum Developer is $158,860 per annum – Paysa.com.
• Blockchain tech has gone far beyond its beginnings in banking and cryptocurrency: In 2019, businesses are expected to spend $2.9B on the technology.
• IBM reports that Blockchain markets are headed to $60 Billion worldwide by 2024.

What you will Learn in this Course?

Introduction and origin of Blockchain

• How does our current financial system work?
• What can be the possible solution
• What is a distributed system
• What is Blockchain
• How does a Blockchain work
• Components of Blockchain
• Business network
• Consensus, Provenances, immutability and finality

Cryptocurrency and Blockchain

• Distributed system
• Distributed Ledger technology
• Global Payments
• Why BlockChain
• BlockChain and use case needs
• Requirements of blockchain for business
• BlockChain benefits
• Types of BlockChain
• Hands on

Bitcoin Platform

• What is Bitcoin?
• Why use Bitcoins?
• Bitcoin Ecosystem
• Structure of a Bitcoin Transaction
• Merkel Trees
• Scripting language in Bitcoin
• Applications of Bitcoin script
• Nodes in a Bitcoin Network
• Bitcoin Economics
• What is Bitcoin Mining?
• Types of Mining
• Mining and Consensus
• Hands On

Introduction to Ethereum

• What is Ethereum?
• Ethereum Layers
• Introducing Smart Contracts
• Cryptocurrency in Ethereum
• Mining in Ethereum
• Consensus Mechanism
• Platform Functions in Ethereum
• Technologies that support Ethereum
• Ethereum Programming Language
• Components for the development of Ethereum DApps
• Editors and tools
• Frontend Development
• Ethereum Test Networks
• ERC Tokens
• Hands On

Solidity

• Introducing Solidity
• Sample Code, Layout of Source File
• Structure of a Contract
• State Variables, Functions Types, Reference Types
• Special Variables and Functions, Expressions and Control Structures
• Function Calls, Error Handling
• Visibility for Functions and State Variables
• Inheritance, Constructors
• Importing Smart Contracts
• Gas Limit and Loops
• Sending and Receiving Ether
• Recommendations
• Contract ABI
• Setting up the development environment and Deploying DApp
• Hands On

Hyperledger

• Introduction to Hyperledger
• Hyperledger architecture
• Hyperledger Fabric V1 Architecture
• Consensus
• Hyperledger API
• Hyperledger Application Model
• Hyperledger project and tools
• Network Topology
• Exploring Hyperledger frameworks
• Business Network Deployment on Hyperledger Composer Playground
• Sample Transaction
• Service invoices
• Hands On

Hyperledger Composer

• Development Environment using Composer
• Developing business networks
• Testing business networks
• Introduction to Hyperledger Fabric
• Hyperledger Fabric Model
• Ways to create Hyperledger Fabric Blockchain Network
• Hands On

Create and Deploy Your Private Blockchain On Multichain

• What Is MultiChain
• MultiChain Privacy and Permissions
• Mining in MultiChain
• Multiple configurable Blockchains using MultiChain
• Setting up a Private Blockchain
• Hands On

Blockchain Use Cases

• Potential use cases in Blockchain
• BlockChain project

 Got a question for us? Please mention it in the comments section and we will get back to you.

0 responses on "Ethereum - Ganache for Blockchain"

Leave a Message

Your email address will not be published. Required fields are marked *