My program needs to know how the transactions in the mempool will affect the state when mined. Does anyone know of any tools to help with this? I know I can do it manually with ganache --fork, but I don't know a good way to automate it without starting from scratch

1 Answer 1


You can interact directly with the ganache-core library: github

Below is a test with using the infura API. This also works with a local node.

const ganache = require("ganache-core");
const Web3 = require("web3");

// set whatever options you'd use in the cli here
const options = {
  fork: "https://ropsten.infura.io/v3/API_KEY",
  port: 6546,

const server = ganache.server(options);
const provider = server.provider;
const web3 = new Web3(provider);


enter image description here

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.