Installing Ganache
Ganache CLI is a fast and customizable blockchain emulator. It allows you to make calls to the blockchain without the overheads of running an actual Ethereum node.
- Transactions are “mined” instantly.
- No transaction cost.
- Accounts can be re-cycled, reset and instantiated with a fixed amount of Ether (no need for faucets or mining).
- Gas price and mining speed can be modified.
- A convenient GUI gives you an overview of your testchain events.
It is a temporary blockchain that we can use for testing and development. It provides 10 unlocked accounts funded with 100 ether each, and mines transactions as they are broadcasted. It also lets us do magical things like reverting transactions and jumping forward in time, which is a huge help when unit testing.
Ganache comes in two flavors:
- GUI version complete with a block explorer
- CLI version
Installing:
To work with Ganache-cli, we must install Node.js first.
After node.js installation,
Ganache can be installed via NPM:
npm install ganache — global
Now, you can start ganache right from your command line:
ganache-cli
# or ganache
Ganache GUI version:
- Download the appropriate version for your OS
- Next, double-click on the downloaded file, follow the prompts, and you’re up and running.
& that’s it!