If I run ganache-cli without options or any options except --db, and then run truffle migrate it will successfully migrate my contracts.


If I run ganache-cli --db ./ganachedata, and then run truffle migrate it will halt for a while and then crash with error:

Using network 'development'. Running migration: 1_initial_migration.js Deploying Migrations... ... 0x2a1435cdef2ae87c905ed3d8e48a6011c56287fa9d2e8efc1fcdf32bbac979ab Error encountered, bailing. Network state unknown. Review successful transactions manually. Error: Contract transaction couldn't be found after 50 blocks at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:328377:30 at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:64331:21 at Array.forEach () at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:64330:32 at Array.forEach () at Object.onMessage [as callback] (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:64328:22) at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:330526:20 at Array.forEach () at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:330525:12 at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:176198:11

How to fix it? I need to save blockchain data so I need this --db option.

Btw MetaMask works fine with ganache-cli --db ./ganachedata.

1 Answer 1


You also have to use -d to determinalistic generate account addresses and -i to use the same network id.

ganache-cli -d --db data -i 123456

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.