Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

--db option still creates a new network ID when ganache-cli restarted #979

Closed
abcoathup opened this issue May 7, 2020 · 2 comments
Closed

Comments

@abcoathup
Copy link

--db option still creates a new network ID when ganache-cli restarted

Expected Behavior

When running ganache-cli and saving the chain database e.g. npx ganache-cli -d --db Ganache_Data, when stopping and starting ganache-cli the network ID should stay the same.

Current Behavior

When running ganache-cli and saving the chain database e.g. npx ganache-cli -d --db Ganache_Data, when stopping and starting ganache-cli the network ID is the current time.

Currently it appears the only way to keep the network ID is to use the -i/--networkId option.

Steps to Reproduce (for bugs)

  1. Start ganache-cli and save the chain database for the first time

    $ npx ganache-cli -d --db Ganache_Data
    

    Check the network ID is current time

  2. Start ganache-cli and use the saved chain database

    $ npx ganache-cli -d --db Ganache_Data
    

    Check the network ID is current time and not the previous network ID

Context

Reported by a community member in the OpenZeppelin Community Forum who wanted to persist ganache-cli across restarts but OpenZeppelin CLI was detecting a new network as the network ID was changing: https://forum.openzeppelin.com/t/persist-deployment-on-local-blockchain/2788

Your Environment

  • Version used: 6.9.1
  • Version of Truffle/Remix/Other tools used: OpenZeppelin CLI 2.8.2
  • NodeJS Version: [ ] 6.x, [ ] 7.x (unsupported), [ ] 8.x, [ ] 9.x, [x] 10
  • Operating System and version (include distro if Linux): WSL2 Windows 10
  • I intend to submit a pull request to fix this issue: [ ]
@davidmurdoch davidmurdoch transferred this issue from trufflesuite/ganache-cli-archive Aug 19, 2021
@MicaiahReid
Copy link
Contributor

Thanks for reporting, @abcoathup. We're working on a fix and will keep you posted.

@davidmurdoch
Copy link
Member

Let's track this one in #1030

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants