Skip to content

Latest commit

 

History

History
98 lines (59 loc) · 2.72 KB

File metadata and controls

98 lines (59 loc) · 2.72 KB

Deployment Guide

Deployment to Sovrun Testnet

Step 1:

Make sure you are in the packages/contracts directory:

cd packages/contracts

Step 2:

Deploy to the Sovrun testnet by running:

pnpm deploy:sovrun

Running and Deploying Local Blockchain Environment

To run the local blockchain environment along with test accounts, execute the following command in the root directory of the project:

pnpm dev

This will start a local blockchain instance for testing and development. Once the environment is running, you can deploy contracts and interact with them locally.


Running Local Blockchain Individually Using Anvil

Step 1: Run the Local Blockchain

Make sure you've completed the prerequisite setup (see Prerequisite MUD Setup). Then, run the local blockchain using anvil:

anvil

Step 2: Deploy TacticsWar World Locally

Open a new terminal, navigate to the packages/contracts directory, and run the following command to deploy the TacticsWar locally:

pnpm deploy:local

This will deploy the smart contracts to the local blockchain instance running on anvil.


Adding Custom Chain Deployment Setup

You can also set up deployment for custom chains by following these steps.

Step 1: Configure your .env file

Ensure your environment variables are configured properly. (For more information, see (Configure env docs)[./Setup.md]).

Step 2: Create a new profile in foundry.toml

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.

Step 3: Update package.json

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.

Step 4: Deploy to the custom chain

Run the following command from the packages/contracts directory:

pnpm deploy:otherChain

Replace otherChain with the custom name you've chosen. For example, if your profile is myCustomChain, the command would be:

pnpm deploy:myCustomChain