Make sure you are in the packages/contracts directory:
cd packages/contractsDeploy to the Sovrun testnet by running:
pnpm deploy:sovrunTo run the local blockchain environment along with test accounts, execute the following command in the root directory of the project:
pnpm devThis will start a local blockchain instance for testing and development. Once the environment is running, you can deploy contracts and interact with them locally.
Make sure you've completed the prerequisite setup (see Prerequisite MUD Setup). Then, run the local blockchain using anvil:
anvilOpen a new terminal, navigate to the packages/contracts directory, and run the following command to deploy the TacticsWar locally:
pnpm deploy:localThis will deploy the smart contracts to the local blockchain instance running on anvil.
You can also set up deployment for custom chains by following these steps.
Ensure your environment variables are configured properly. (For more information, see (Configure env docs)[./Setup.md]).
From the packages/contracts directory, open the foundry.toml file and create a new profile for the chain you want to deploy to. You can replace otherChain with any name of your choice to represent the chain you’re targeting. For example:
[profile.otherChain]
eth_rpc_url = "your_rpc_url_here"In this example, otherChain can be any descriptive name you choose for the chain, such as myCustomChain.
Open package.json under packages/contracts/ add the following line under the "scripts" object (around line 6). Make sure to follow the pattern deploy:[customChain], where customChain matches the name of your new profile from foundry.toml:
"deploy:otherChain": "mud deploy --profile=otherChain",Replace otherChain with the custom name used in your profile, such as myCustomChain. Ensure that the --profile value matches the profile added in foundry.toml.
Run the following command from the packages/contracts directory:
pnpm deploy:otherChainReplace otherChain with the custom name you've chosen. For example, if your profile is myCustomChain, the command would be:
pnpm deploy:myCustomChain