optimism-mud-starter
optimism-mud-starter copied to clipboard
A MUD based starterkit by optimism
This is a Optimism + MUD project built with ❤ for hackers.
Who is this for?
MUD is a full-stack Dapp development framework. Think of it as the Ruby-on-Rails or NEXT.js of Dapp development.
It comes with the following features:
- Automatic indexer generation with MUD storage
- Automatic frontend SDK generation to the mud store
- Uniquely gas efficient storage
- An amazing cli with great code generation tools
This starter is a great choice for any of the following groups:
- Hackers hacking on Optimism
- Hackers interested in trying out an opinionated full stack framework
MUD2 is in alpha. Looking for a more traditional starterkit? Check out Optimism Starter.
Why MUD?
MUD takes care of all the plumbing of building blockchain-based applications so you can focus on your application logic. In the MUD builders' own words:
MUD is a framework for ambitious Ethereum applications. It compresses the complexity of building EVM apps with a tightly integrated software stack.
Go take a deep dive at mud.dev! You'll be as excited as we are.
Getting Started
Install Node 18
Install Foundry
You will need to install Foundry to build your smart contracts.
-
Run the following command:
curl -L https://foundry.paradigm.xyz | bash -
Source your environment as requested by Foundry.
-
Run
foundryup.
Install pnpm
Pnpm is the package manager MUD uses. It's usage is very similar to NPM but speed is much faster
npm install pnpm --global
Start the application
-
Clone/fork the optimism-mud-starter repo
git clone https://github.com/ethereum-optimism/optimism-mud-starter.git -
Install the necessary node packages:
cd optimism-mud-starter pnpm install -
Initialize the mud project
pnpm initializeIf you get errors during this step, you might need to update your Foundry to the latest version.
-
Start dev server
pnpm dev
- Open localhost:3000 in your browser.
See below for general usage instructions or FAQ for answers to general questions such as:
- Where to get goerli eth.
- How to deploy a public version of your app.
Check out the MUD documentation
MUD is in Alpha so make sure to check out the official MUD documentation for latest usage instructions.
Join the MUD discord
MUD has a vibrant community ready to help. Join the discord to share your MUD project or ask any questions.
Set up environment
Get an Etherscan key
-
Register for Etherscan on Optimism. This account is different from your normal Etherscan account.
-
Go to the API keys page and click Add to create a new API key.
-
You can now add the etherscan key to your foundry.toml
Alternatives
Looking to use burner wallets? Prefer hardhat? Prefer NEXT.js? Check out these amazing alternatives:
- optimism starter - A more traditional wagmi/viem based starterkit
- create mud - This starterkit uses the react template. MUD offers a vanillajs version too
- create wagmi cli - A flexible cli with many templates (this starterkit was started from vite-react-cli-foundry)
- scaffold-eth - The new 2nd version of a popular NEXT.js based starter including hardhat, burner wallets, great documentation, and an active telegram for support
Learn more
- MUD Documentation – learn about wagmi Hooks and API.
- Foundry Documentation – learn more about the Foundry stack (Anvil, Forge, etc).
- Vite Documentation – learn about Vite features and API.
