Forrest logo
back to the ganache-cli tool

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

This command is using the Ganache-CLI (Ganache Command Line Interface) with additional options.

  • ganache-cli: This is the command to run the Ganache-CLI, which allows you to create a personal Ethereum blockchain for development and testing purposes.

  • --secure: This option enables secure mode for Ganache-CLI, which means that it requires specified accounts to be explicitly unlocked before signing any transactions.

  • --unlock "${account_private_key1}": This option unlocks the account associated with the private key ${account_private_key1}. With this account unlocked, transactions can be signed using this account without any error.

  • --unlock "${account_private_key2}": This option unlocks another account associated with the private key ${account_private_key2}. Similar to the previous option, this allows transactions to be signed using this account.

The command assumes that there are two account private keys ${account_private_key1} and ${account_private_key2} that are provided as environment variables or variables defined elsewhere in the execution environment. By unlocking these accounts, the command enables you to interact with and sign transactions using these specific accounts during your development and testing process.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the ganache-cli tool