Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(guides/hello/add system): update for the app namespace 🚗 #2859

Merged
merged 2 commits into from
May 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions docs/pages/guides/hello-world/add-system.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ In this tutorial you add a system to decrement the counter and update the applic
[Create a new MUD application from the template](../../templates/typescript/getting-started).
Use the vanilla template.

```sh copy
pnpm create mud@latest tutorial --template vanilla
cd tutorial
```

## Add a contract for the new system

Create a file `packages/contracts/src/systems/DecrementSystem.sol`.
Expand Down Expand Up @@ -109,13 +114,13 @@ In this case, the vanilla getting started front end.
* is in the root namespace, `.increment` can be called directly
* on the World contract.
*/
const tx = await worldContract.write.increment();
const tx = await worldContract.write.app__increment();
await waitForTransaction(tx);
return getComponentValue(Counter, singletonEntity);
};

const decrement = async () => {
const tx = await worldContract.write.decrement();
const tx = await worldContract.write.app__decrement();
await waitForTransaction(tx);
return getComponentValue(Counter, singletonEntity);
};
Expand Down
Loading