Setup Ganache

Ganache: Ganache is a personal Ethereum blockchain that you can use for local development and testing. It allows you to deploy smart contracts, interact with them, and inspect the transactions and state changes in a controlled environment. Ganache is useful because it allows you to experiment and test your smart contracts without spending real Ether or using the public Ethereum network

1. To use Ganache CLI, first, you need to install it. Open a terminal and run the following command:

npm install -g ganache-cli

2. By default, Ganache CLI will start on port 8545. You'll see output in the terminal with information about the local blockchain, including available test accounts and their private keys.

Configure your Truffle or Hardhat project to connect to the local Ganache instance. For Truffle, you need to set the networks configuration in truffle-config.js. Here's an example configuration:

module.exports = {
  networks: {
    development: {
      host: "",
      port: 8545,
      network_id: "*",
  // ... other configurations ...

3. Start Ganache CLI by running:


With Ganache running and your project configured, you can now deploy and interact with your smart contracts on the local Ethereum blockchain provided by Ganache.