0

For development I use Ganache and forking the mainnet. I also have a metamask wallet than can access this. The issue is that every-time I want to do something on a contract (like aave, uniswap etc) I need to write some code (ethersjs or web3). Is there a way I can connect a webapp (dapp) to my localhost ganache?

2
  • I think the frontend of aave and uniswap are open source, and anyone can change them and start them locally
    – Majd TL
    Commented May 25, 2022 at 6:59
  • @MajdTL I was hoping for something that might work for any dapp, to be a simple browser override Commented May 25, 2022 at 8:25

1 Answer 1

0

Sure. Ganache usually runs on port http://localhost:8545 (need to check your ganache configuration to make sure). Just need to create a provider that connect to it. For example with ethers.js you will do it this way:

const provider = new ethers.providers.JsonRpcProvider(“http://localhost:8545”)

1
  • I was hoping for something that might work for any dapp, to be a simple browser override. This will require to checkout the dapp and run it. You code is exactly what I need to inject into a running app Commented May 25, 2022 at 8:26

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.