I successfully installed and used anvil from the wsl shell.

I have some rust code, where i want to import foundry anvil instead of running from shell, cause i want to be able to control it from the app itself , reset it, fork a newblock, simulate transactions. Im trying this for 2 days already, without success.

1 Answer 1

async fn anvil_mine() -> Result<(), reqwest::Error> {
   let client = reqwest::Client::new();
   let res = client.post("")
           "jsonrpc": "2.0",
           "method": "anvil_mine",
           "params": [],
           "id": 1
   println!("{:#?}", res.text().await?);



in a terminal (default RPC url is Then use this code to interact with it.
You can replace "anvil_mine" by any of these:


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.