2

I deployed contracts to kovan testnet, but I have certain places where there is a 1 week duration. How do I speed up time on testnet so I can easily test these things? (For example speeding it up to be 10 seconds duration instead

1
  • you can't. but you can fork the testnet with ganache or hardhat and do your tests on it
    – Majd TL
    Commented May 31, 2022 at 6:52

2 Answers 2

0

You can't influence the network itself, since it's not under your control. So what you need to do is either change your contract's duration or test in local blockchain where you can modify time. Local testing is by far the better option, and you'll need that anyway when you write unit tests for your contracts.

0

You should test your contract in a local environment.

Ganache has a number of tools to help you with these kind of tests like advanceTimeAndBlock.

Check the documentation of the time machine here: https://github.com/ejwessel/GanacheTimeTraveler

I would use hardhat to have a complete suite of tools (including ganache):

https://hardhat.org/tutorial/testing-contracts

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.