2

I am using ganache-cli....and it is providing me 10 test accounts with 100ETH balance.

when I close that cmd and start ganache-cli it creates new 10 test accounts every time.

So how to retrieve my old account bcoz i have used that account reference in whole application?

2 Answers 2

3

you can try to execute it with the deterministic flag

ganache-cli --deterministic

this will try to generate the same addresses anytime if possible. You can add another parameter, db, to save also the chain database (with all the transactions) so you can load it again in the next executions

ganache-cli --deterministic --db [path]

if the db exists it will be loaded and you should have the historical data of the previous transactions.

1

To make it work with the deterministic option, you have to supply the same mnemonic each time you start.

ganache-cli -d -m 'brass bus same payment express already energy direct type have venture afraid'

-d == --deterministic

-m == --mnemonic

Your Answer

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

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