2

my ganache -cli environment

I use ganache-cli --db to create a private test chain and save it on my computer, and the result is below: enter image description here

I use web3py w3.personal.newAccount('1') to add a new address, and I use print(len(w3.personal.listAccounts)) to show the amount of accounts, and the result is belowenter image description here

but when I shut down(ctrl +c) and turn on the ganache-cli again, I find there is no account saved.

Shane Fontaine
  • 18,036
  • 20
  • 54
  • 82
Lance li
  • 33
  • 5

1 Answers1

0

You must specify a location to save and load the DB from.

Both times you run the command, simply specify a location, like so:

ganche-cli --db="~/my/DB/path"

Shane Fontaine
  • 18,036
  • 20
  • 54
  • 82