Start a development server for MUD contracts, and redeploy or modify the
World when contracts change.
Before you run
mud dev-contracts you need to specify the private key of the deploying account.
There are several ways to do this:
Export an environment variable.
export PRIVATE_KEY=0x<key goes here>
.envto specify the
# This .env file is for demonstration purposes only. # # This should usually be excluded via .gitignore and the env vars attached to # your deployment environment, but we're including this here for ease of local # development. Please do not commit changes to this file! # # Anvil default private key: PRIVATE_KEY=0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d
You also need to specify a URL to the blockchain. Again, there are several ways to do this:
- Use the
--rpc <url>command line parameter.
- Specify the URL as the
eth_rpc_urlvalue in the
foundry.toml(opens in a new tab).
- Do not specify an RPC at all, in which case
mud dev-contractsstarts an
anvil(opens in a new tab) instance for you.
These are the command line options you can specify on
|Show version number||boolean|
|Path to the config file||string|
|The RPC URL to use||string||Empty, in which case the command starts |
|Deploy to an existing World at the given address||string||Empty, deploy new |
(1) The hostname
localhost may not work. If that is the case, use