Forrest logo
tool overview
On this page you find all important commands for the CLI tool ganache-cli. If the command you are looking for is missing please ask our AI.

ganache-cli

Ganache-cli is a command line tool used for local Ethereum blockchain development. It is part of the popular development framework, Truffle Suite.

  1. Ganache-cli provides a local Ethereum test network, enabling developers to test smart contracts and decentralized applications (dApps) in a controlled and deterministic environment without the need for real Ether or connecting to the main Ethereum network.
  2. It can be installed via npm (node package manager) and runs on Node.js.
  3. Ganache-cli simulates the behavior of a full Ethereum node, allowing developers to interact with it using RPC (Remote Procedure Call) methods.
  4. It generates a set of user accounts (with corresponding private keys) that developers can use to simulate different entities interacting with their contracts and dApps.
  5. Transactions on ganache-cli are executed instantly, as it does not require actual mining to validate and confirm them.
  6. It provides advanced features such as automatic ganache accounts unlocking, network customization, gas price control, and time manipulation for testing time-dependent functionalities.
  7. Ganache-cli comes with a user-friendly interface and detailed logs, displaying transaction history, contract deployment data, and gas usage.
  8. It supports various command line options to configure parameters such as the number of test accounts, gas limits, initial Ether balances, network ID, and more.
  9. Ganache-cli can be integrated with popular development tools like Truffle, Remix, and MetaMask, making it seamless to deploy and test contracts created in those environments.
  10. Overall, Ganache-cli is a powerful and convenient tool for Ethereum developers, accelerating the development and testing process by providing a local blockchain environment.

List of commands for ganache-cli:

  • ganache-cli:tldr:122e0 ganache-cli: Run Ganache and log all requests to `stdout`.
    $ ganache-cli --verbose
    try on your machine
    explain this command
  • ganache-cli:tldr:2a458 ganache-cli: Run Ganache and lock available accounts by default.
    $ ganache-cli --secure
    try on your machine
    explain this command
  • ganache-cli:tldr:3fabc ganache-cli: Run Ganache.
    $ ganache-cli
    try on your machine
    explain this command
  • ganache-cli:tldr:be910 ganache-cli: Run Ganache with accounts with a default balance.
    $ ganache-cli --defaultBalanceEther=${default_balance}
    try on your machine
    explain this command
  • ganache-cli:tldr:bf2fe ganache-cli: Run Ganache server and unlock specific accounts.
    $ ganache-cli --secure --unlock "${account_private_key1}" --unlock "${account_private_key2}"
    try on your machine
    explain this command
  • ganache-cli:tldr:d7c37 ganache-cli: Run Ganache with a specific account and balance.
    $ ganache-cli --account="${account_private_key},${account_balance}"
    try on your machine
    explain this command
  • ganache-cli:tldr:eacfe ganache-cli: Run Ganache with a specific number of accounts.
    $ ganache-cli --accounts=${number_of_accounts}
    try on your machine
    explain this command
tool overview