Since the blockchain is immutable, developing and running tests directly on a blockchain is expensive and inefficient. Ganache is an Open Source tool that simulates the blockchain on your local desktop.
To Configure Ganache, we will follow 4 steps:
Step 1: Create a new Workspace in Ganache
Step 2: Add Project in Workspace Tab
Step 3: Add Mnemonic in Accounts & Keys Tab
Step 4: Configure Server Tab
Launch the Ganache GUI, then create a new workspace with any name of your choice.
Make sure you have selected "Workspace" in the upper left corner in Ganache.
1. Select "Add Project".
2. Select "truffle-config.js" from the same folder as the README.md file.
1. Select "Accounts & Keys" in the upper left corner in Ganache.
2. Navigate to the README.md file generated for your project and find the Ganache Settings section.
3. Copy the mnemonic phrase. Your mnemonic will look something like this:
4. Paste the mnemonic phrase from your README.md file into Ganache.
These keywords are used to auto-generate accounts with private keys for development. If the keywords in "truffle-config.js" (which are the same as above) and Ganache don't match, you will not be able to deploy your Smart Contracts to Ganache.
1. Check that "Port Number" is "7545" and "Network ID = 5777".