0

I'm trying to create a DAPP (with docker-compose) which will require many transactions, and I am currently experiencing nonce problems with my Transaction Manager.

However, I'm not looking for help with this problem. What I would like to do is decrease the time between blocks getting mined in my dev environment. Currently, blocks get mined every 2 minutes, whereas blocks on the ethereum network get mined every 17 seconds or so.

Is it possible to change the time on my local machine in order to simulate a real life environment?

2 Answers 2

0

Don't know how to change the time but you can force block mining using the evm_mine method.

provider.send({
    jsonrpc: '2.0',
    method: 'evm_mine',
  }, (e) => {
    if (e) { return reject(e); }
});

https://docs.nethereum.com/en/latest/ethereum-and-clients/ganache-cli/

How to mine my contract in testrpc

1
0

My development workflow and stack goes like this.

  1. Remix and JavaScript VM for iteration and superficial testing.
  2. Truffle and a single-node private network w. 2 blocks/second to develop unit tests and UI. I do that with Geth and a genesis block that specifies low difficulty.
  3. Deploy to Rinkeby with normal block time.

The first two platforms have fast block time. The third one is realistic.

Hope it helps.

Your Answer

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

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