Ganache - cogeorg/teaching GitHub Wiki

You do not need a private or test node if you want to develop and test your smart contracts. A node emulator is an easy to handle alternative. Ganache is an emulated personal node for Ethereum development, that you can use to deploy contracts, develop your applications, and run tests. It is available as both a desktop application as well as a command-line tool (formerly known as the TestRPC).

Installation

To download Ganache, visit http://truffleframework.com/ganache/ and click on Download.

Installation instructions for Ubuntu

Under Linux, you will download an AppImage package. To run it, navigate to your Download folder and change its modus and finally execute it.

$ cd ~/Downloads
$ chmod a+x ganache-2.1.2-linux-x86_64.AppImage
$ ./ganache-2.1.2-linux-x86_64.AppImage

It will prompt a window and ask you whether you want to integrate Ganache with your system. Click Yes and the programm is ready to use.

Installation instructions for macOS

Under macOS, you will downlaod a dmg archive. Once the download process is complete, double-click on the icon and install it like any other Mac application by dragging it into the Applications folder.

Installation of the CLI

If you are interested in the command-line version (formerly known as the TestRPC), you can get it via npm.

$ npm install -g ganache-cli

For more information on the CLI, visit this README.

Interface

When you launch Ganache, the screen will show some details about the server, and also list out a number of accounts. Each account is given 100 ether. Having ether automatically in all accounts allows you to focus on developing your application.

There are four pages available:

  • The Accounts page shows the accounts generated and their balances. This is the default view.
  • The Blocks page shows each block as mined on the blockchain, along with gas used and transactions.
  • The Transactions page lists all transactions run against the blockchain.
  • The Logs page shows the logs for the server, which is useful for debugging.

Also note that you can search for block numbers or transaction hashes from a search box at the top.

You can change some features of the generated blockchain through the Settings pages, accessed by the gear icon in the top right corner.

  • The Server page shows details about the network connection, including hostname, port, network ID, and whether to automatically mine each transaction into a block.
  • The Accounts & Keys page sets details about the number of accounts created, and whether to use a specific mnemonic or let Ganache generate its own.
  • The Chain page sets details about the actual workings of the generated blockchain, including gas limit and gas price.
  • The Advanced page toggles Google Analytics, which is useful for the Ganache team to track usage of the application.

After making changes, you will have to click Restart on the application for the changes to take effect.

Source: truffleframeworks