For testing my codes without side effects (e.g., consuming gas, etc.) on the development environment, I'm finding a way to execute a smart contract that interacts with other contracts deployed on Ethereum Mainnet. Is there any way to do dry run contracts in the same state on mainnet?

Finally, "ganache-cli --fork" did this job. Thank you for an answer and a comment.

$ ganache-cli --fork http://localhost:8545@1599200

  -f, --fork                Fork from another currently running Ethereum client at a given block. Input should be
                            the HTTP location and port of the other client, e.g. 'http://localhost:8545' or
                            optionally provide a block number 'http://localhost:8545@1599200'

1 Answer 1



You can run your own node and synchronize it fully. After that you can import the blockchain data to a local blockchain (Ganache) and use that. Then you can simulate transactions against the snapshot.

Of course this is only a snapshot and you either have to keep re-importing the latest mainnet snapshot or just use a slowly decaying snapshot.

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.