Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where does ganache store the Ethereum blockchain

I'm actually using truffle with Ganache to do some development.

I would like to know where does Ganache store it's blockchain to see how much data is used by my test. Is it stored somewhere accessible on the pc ?

I'm using

  • Ubuntu 17.10 64-bit
  • ganache-1.0.1-x86_64
like image 487
Zackorrigan Avatar asked Jan 04 '18 14:01

Zackorrigan


2 Answers

TestRPC used to just be in memory. They only recently released support for writing the blockchain out to the file system. As far as I can tell, the in memory implementation is still the default behavior. If you want to find the blockchain files, you'd specify the location yourself with the --db option.

From their release page (under v4.0.0):

Because we backed the TestRPC via the filesystem, this means you can now save your blockchain's data for later use. That's right, if you close the TestRPC and reopen it later, say, you can start up right where you left off. You'll need to use the new --db option (see the README) to tell the TestRPC where you'd like the data saved. You'll also likely want to use the --mnemonic option to use the same accounts each time.

like image 138
Adam Kipnis Avatar answered Oct 18 '22 13:10

Adam Kipnis


With Ganache v2, there is a new feature allowing you to maintain different workspaces. Each workspace can represent a different ongoing chain, and can be resumed by reading from disk at (just about) any time.

For example (on Windows) a workspace named "sample-spot" would be stored at %AppData%\Ganache\workspaces\sample-spot\chaindata (where %AppData% may be something like C:\Users\yourname\AppData\Roaming\).

Some additional details can be found in code here and documentation here.

like image 26
WBT Avatar answered Oct 18 '22 14:10

WBT