Open zasleon opened 5 years ago
Hey @zasleon, the --db
command actually requires that you specify the path.
From the docs:
--db
: Specify a path to a directory to save the chain database. If a database already exists, ganache-cli will initialize that chain instead of creating a new one.
the correct command is:
D:\pv>ganache-cli -p 8545 --mnemonic --networkId 100 --db ./my-chaindata-directory
Where my-chaindata-directory
is an existing directory (should be empty at first)
Let me know if you have any questions! Thanks!
For internal reference: Not closing this issue because we shouldn't allow the flag to be specified by the user but not also set. The nargs
yargs option may help here.
first i used cmd " ganache-cli -p 8545 --mnemonic --networkId 100 --db" to create a blockchain like below.
D:\pv>ganache-cli -p 8545 --mnemonic --networkId 100 --db Ganache CLI v6.3.0 (ganache-core: 2.4.0) Available Accounts ……
there are lots of files created by this command, just like: "!blockHashes!0xe8ca3e76ee368e97c3f55380ffae4fff6743577329f76140046348d3fdbe7a12" "!blockLogs!0" "!blockLogs!length" "!blocks!0" "!blocks!length" "!trie_db!0x2d71ce1e99e7d9b687cf6ea0673404bcad9fa37c2478577c02aa32e4a0332a58" ……………………
i also send several eth from account0 to account1. then i closed this cmd.
Current Behavior
but the second time i restart the cmd and input "ganache-cli -p 8545 --mnemonic --networkId 100 --db" or"ganache-cli -p 8545 --db" or whatever i try , the ganache-cli just create new 12 Mnemonic and all the accounts refresh to become 100eth.
Expected Behavior
shouldn't "--db" load the local file and output the same Mnemonic last time it generated? or am i use wrong form of command to load the local last blockchain file?