ethereum-optimism / supersim

Local Multi-L2 Development Environment
MIT License
121 stars 44 forks source link

Customizing anvil hosts #250

Open mjlescano opened 1 week ago

mjlescano commented 1 week ago

I'm trying to run the anvil host in a Docker container and need to customize its host address. I've attempted using the --host parameter and setting the ANVIL_IP_ADDR= environment variable, but neither approach works as expected.

I'm actually needing this for running the supersim project within a Docker image without relying on the --network host option, as it is not supported on MacOS.

Could you provide guidance on how to properly customize the anvil host in this context? Alternatively, if you can point me to where I should make the changes in the codebase to potentially open a PR I'd be happy to do it, but note that I'm not proficient in Go, so any specific pointers would be greatly appreciated.

Thanks in advance for any help!

jakim929 commented 6 days ago

We should def add support for this! Curious to hear more about the use case - do u need to support a different host for each L1 and L2 instances? Or is it you need to specify the same host for all?

I can create an issue for this to get this implemented

mjlescano commented 6 days ago

In my case, we are just needing the same host for all the chains, something like supersim --host 0.0.0.0.

This would allow for the Docker image to not need --network host for running and just expose the desired ports, which in turn would make the docker image work on Mac, and we will be able to create a docker-compose file for development with all the chains and related APIs/web services for our project 🚀

FYI, I tried directly running anvil --host 0.0.0.0 inside the docker image and works perfectly, and from my host I can connect to the rpc.

jakim929 commented 1 day ago

thanks for the context - created an issue here, someone should pick it up soon! https://github.com/ethereum-optimism/supersim/issues/262