Getting started with MUD
Let's create your first project with MUD!
Prerequisites
Make sure you have the following dependencies installed.
- Install Node.js (opens in a new tab) v18
- Install pnpm (opens in a new tab) with
npm install -g pnpm - Install Foundry (opens in a new tab)
Note for Windows users: You may have additional steps/prerequisites to install things like Foundry. We're still working on docs for these.
Create a new project
It's easy to start a new project with MUD. Just run the following command:
pnpm create mud@canary your-project-nameYou'll be prompted to pick the type of template to use (vanilla JS or React).
Run your project
Jump into your new project's directory. In one terminal, run the anvil node with:
pnpm run dev:nodeAnd in another terminal, run the app with:
pnpm run devUnder the hood, dev will do a few different steps:
- Generates code to make it easier and safer to interact with MUD
- Deploys contracts to the local anvil node
- Starts the client app
Project layout
TODO