The Deployer
To deploy a World and its resources, there exists a deploy
command on the MUD CLI.
When using the deployer, you must set the private key of the deployer using the PRIVATE_KEY
environment variable. You can make this easier by using dotenv (opens in a new tab) before running mud deploy
in your deployment script.
The deployer also supports Foundry profile to deploy to different chains.
To set the profile used by the deployer, either set your FOUNDRY_PROFILE
environment variable, or pass --profile <profileName>
to the deployer (eg: mud deploy --profile optimism-mainnet
).
The RPC used by the deployer will be http://localhost:8545 (opens in a new tab) if no profile is set, otherwise it will be read from the eth_rpc_url
configuration field of the Foundry profile.
Example profile:
# foundry.toml
[profile.lattice-testnet]
eth_rpc_url = "https://follower.testnet-chain.linfra.xyz"
[profile.optimism-mainnet]
eth_rpc_url = "https://infura[...]"
When run, the deployer will:
- Deploy a fresh World (we don’t support adding resources to a World yet through the deployer)
- Install the default modules on the World
- Deploy all systems
- Register all systems
- Register all tables
- Install all the remaining modules