[Ethereum] Ganache (UI) save blockchain

etherganachesolidity

I am running a testnet on Ganache UI. But when I deploy a contract and close and reopen ganache, there are no blocks and the contract deployment is gone. Is it possible to save/load a blockchain through ganache UI?

I know how to save a blockchain in ganache-cli. But ganache-cli and ganache UI seem to be different and I can't connect them to each other.

I would like to save my blockchain within ganache UI.

Best Answer

You should use Ganache GUI's 'Workspace' feature. Workspace stores the current state of the chain even after restarting ganache or even the system.

To create a new workspace:

  1. Open up Ganache GUI.
  2. Click on 'New Workspace'.
  3. Enter the Workspace's name and configure settings as per your needs.
  4. Click 'Save Workspace'.
  5. The next time you open up Ganache GUI, select your required workspace from the list.

Your blockchain's state would remain intact.

Related Topic