For additional step-by-step explanations on how to build and deploy your own PixeLAW app follow along here!
PixeLAW is built on top of MUD. Refer to this page to get it installed.
Use this template to create a new repository or clone this repository locally.
git clone https://github.com/themetacat/pixelaw_app_template_mud.git
cd pixelaw_app_template_mud/contracts/ && pnpm install
pnpm mud build
Before running this project, make sure to run the Pixelaw/core repository.
pnpm run deploy
After which, you can start deploying your app onto your local PixeLAW via:
Please note the following important details:
- Ensure that the value of SYSTEM_FILE_NAME in the .env matches the system file name under the ./src/systems/ directory.For example:
system file: ./src/systems/MyAppSystem.sol
./env: SYSTEM_FILE_NAME=MyAppSystem
- Ensure that the prefix of the extension file name in the
./script
directory matches the system name. For example:
system name: MyAppSystem.sol
extension name MyAppExtension.s.sol
pnpm mud build
pnpm run deploy
First comment out the registerNamespace and registerFunctionSelector parts in ./script/MyAppExtension.s.sol:
// world.registerNamespace(namespaceResource);
// world.registerFunctionSelector(systemResource, "init()");
// world.registerFunctionSelector(systemResource, "interact((address,string,(uint32,uint32),string))");
then:
pnpm run deploy INIT=false
pnpm run upload
pnpm mud build
Change the private key and core world address on the chain to be deployed in .env.
pnpm run deploy RPC_URL=<replace-this-with-provided-rpc-url> CHAIN_ID=<replace-this-with-chain-id>
First comment out the registerNamespace and registerFunctionSelector parts in ./script/MyAppExtension.s.sol:
// world.registerNamespace(namespaceResource);
// world.registerFunctionSelector(systemResource, "init()");
// world.registerFunctionSelector(systemResource, "interact((address,string,(uint32,uint32),string))");
then:
pnpm run deploy INIT=false RPC_URL=<replace-this-with-provided-rpc-url> CHAIN_ID=<replace-this-with-chain-id>
pnpm run upload
pnpm run deploy
INIT if INIT=false,update the system, default true
RPC_URL, default http://127.0.0.1:8545
CHAIN_ID, default 31337