Skip to content
This repository has been archived by the owner on Jan 21, 2022. It is now read-only.

--blockTime not working #517

Closed
e18r opened this issue May 5, 2018 · 7 comments
Closed

--blockTime not working #517

e18r opened this issue May 5, 2018 · 7 comments

Comments

@e18r
Copy link

e18r commented May 5, 2018

Expected Behavior

ganache-cli --blockTime 15 should wait 15 seconds before mining each block.

Current Behavior

ganache-cli --blockTime 15 behaves exactly like ganache-cli

Steps to Reproduce

  1. clone my repository at https://github.com/emi-silva/lease.git and reset to commit 287b481de1df7b0ca5e8033990d434514b571754

  2. run ganache-cli on port 8875 without the --blockTime option

  3. truffle test test/delay.test.js --network dev

  4. take a look at the output log. The state variable is updated immediately.

  5. run ganache-cli on port 8875 with the --blockTime option set to 15 (or to 15000000 for that matter)

  6. truffle test test/delay.test.js --network dev

  7. The results are the same.

  8. run ganache UI on port 8875, uncheck the automine option, set the block time to 15

  9. truffle test test/delay.test.js --network dev

  10. take a look at the output log. The state variable is not updated immediately.

  11. run Rinkeby: geth --networkid 4 --rpcport 8555 --rpc

  12. truffle test test/delay.test.js --network rinkeby

  13. The state variable is again not updated immediately.

Context

This issue is not letting me reproduce an actual production scenario for my unit tests, which is a potential source of bugs in my contract. If it is not solved, I cannot continue using ganache-cli.

Your Environment

  • Version used: 6.1.0
  • Version of Truffle/Remix/Other tools used: Truffle 4.1.8, Ganache UI 1.1.0, Geth 1.8.4-stable-2423ae01
  • NodeJS Version: [ ] 6.x, [ ] 7.x (unsupported), [ ] 8.x, [x] 9.x
  • Operating System and version (include distro if Linux): Arch Linux (latest)
  • Link to your project or repro gist: https://github.com/emi-silva/lease.git
  • Commit hash to use with above link for reproduction: 287b481de1df7b0ca5e8033990d434514b571754
  • I intend to submit a pull request to fix this issue: [ ]
@dostu
Copy link

dostu commented May 7, 2018

This is already fixed in ganache-core develop branch (trufflesuite/ganache#101), but they need to make a new release.

@linhnh-ibl
Copy link

Same issue, waiting for new release!

@mikeseese
Copy link
Contributor

Hey everyone! A release was snapped a couple weeks ago, you can now use v6.1.3

I'm going to go ahead and close this, but please open it up again if the issue persists (or open a new issue if it's slightly different).

Thanks!

@deomaius
Copy link

deomaius commented Jul 21, 2018

Didn't work for me, resorted to ganache-ui which works flawlessly.

Tried -b --blockTime --blocktime

@mikeseese
Copy link
Contributor

mikeseese commented Jul 21, 2018

@SamGos what version of ganache-cli are your using (either ganache-cli --version or npm list -g ganache-cli)?

This works for me on 6.1.6

@deomaius
Copy link

deomaius commented Jul 22, 2018

@seesemichaelj

OS: MAC OS X Sierra v10.13.12

/usr/local/lib └── [email protected]

&

Ganache CLI v6.1.6 (ganache-core: 2.1.5)

Works fine on UI but as you can imagine it is memory resourceful with the client side interface;

@deomaius
Copy link

Forgive me it seem's my observations were wrong, I was actually on the wrong port to truffle 😞
Using; ganache-cli --blockTime 5 --verbose true -p 9545
This helped to log the evn_mine method output to the console and made me aware it was actually functional, I've a suggestion to add the mine method to the console automatically.

Forgive my silliness and have a nice day 👍

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

No branches or pull requests

5 participants