This package provides an Emacs interface for launching and configuring various foundry commands. Currently it only supports Anvil, the local testnet node from the Foundry suite of Ethereum development tools.
- Easy-to-use transient interface for configuring Anvil options
- Customizable fork URL options
- Launches Anvil in a dedicated buffer with proper output handling
-
Ensure you have Foundry installed on your system. If not, follow the official Foundry installation guide.
-
Add the
foundry.elfile to your Emacs load path. If you are using Doom Emacs, add the following to yourpackages.el:
(package! foundry
:recipe (:host github :repo "z80dev/foundry-el" :files ("*.el")))-
Add the following to your Emacs configuration:
(require 'foundry)
If you are using Doom, instead use the
use-package!macro inconfig.el:(use-package! foundry)
-
Run
M-x foundry-anvil-launchto open the Anvil configuration transient. -
Use the transient interface to set your desired Anvil options.
-
Press
lto launch Anvil with the selected options.
You can customize the preconfigured fork URL options available in the transient. There are two ways to do this:
- Run
M-x customize-group RET foundry RET - Find the
Foundry Anvil Network Fork Url Optionssetting - Add, modify, or remove entries as needed
- Save your changes
Add the following to your Emacs configuration file (e.g., init.el or .emacs):
(setq foundry-anvil-network-fork-url-options
'(("local" . nil)
("mainnet" . "https://eth-mainnet.g.alchemy.com/v2/<YOUR_API_KEY>")
("base" . "https://base-mainnet.g.alchemy.com/v2/<YOUR_API_KEY")))Replace <YOUR_API_KEY> with your actual API key for the respective networks.
You can also simply provide a url when presented with the list of fork options. This url will be used to launch the anvil node in fork mode.
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the GPL-3.0 License - see the LICENSE file for details.