From 9fde4f21bb2c705135f83db9476358f8a0d10c07 Mon Sep 17 00:00:00 2001 From: Ori Pomerantz Date: Wed, 28 Aug 2024 15:30:23 -0500 Subject: [PATCH] Contributing... done --- docs/pages/world-explorer.mdx | 65 ++++++++++++++++++++++++++--------- 1 file changed, 48 insertions(+), 17 deletions(-) diff --git a/docs/pages/world-explorer.mdx b/docs/pages/world-explorer.mdx index 0b05f20ce1..fbd9f35f77 100644 --- a/docs/pages/world-explorer.mdx +++ b/docs/pages/world-explorer.mdx @@ -80,31 +80,62 @@ The World Explorer accepts the following CLI options: | `--port` | The port on which to run the World Explorer | 13690 | | `--env` | The environment to run the World Explorer in (e.g., "development", "production") | production | -## Example setup +## Contributing -An example setup is provided in the `examples/local-explorer` directory, demonstrating a full setup for using the World Explorer in a local development environment: +To contribute to or modify the World Explorer, the easiest way is to run the example setup in `development` mode. -## Contributing +1. Create a [local development setup](/contribute#local-development-setup): + + ```sh copy + git clone https://github.com/latticexyz/mud.git + cd mud + pnpm install + pnpm build + ``` + +1. Change to the example directory. -To contribute to or modify the World Explorer, the easiest way is to run the example setup in `development` mode: + ```sh copy + cd examples/local-explorer/ + ``` -##### 1. **Setup** +1. Edit the explorer line in `mprocs.yaml` -Navigate to the `examples/local-explorer` directory and locate the `mprocs.yaml` file. + -##### 2. **Configure** + ```yaml filename="mprocs.yaml" copy showLineNumbers {20} + procs: + client: + cwd: packages/client + shell: pnpm run dev + contracts: + cwd: packages/contracts + shell: pnpm mud dev-contracts --rpc http://127.0.0.1:8545 + anvil: + cwd: packages/contracts + shell: anvil --base-fee 0 --block-time 2 + indexer: + cwd: packages/contracts + shell: rimraf $SQLITE_FILENAME && pnpm sqlite-indexer + env: + RPC_HTTP_URL: "http://127.0.0.1:8545" + FOLLOW_BLOCK_TAG: "latest" + SQLITE_FILENAME: "indexer.db" + explorer: + cwd: packages/contracts + shell: pnpm explorer --env development + ``` -In `mprocs.yaml`, ensure the `explorer` command is set up correctly. For example: + -```yaml -explorer: - shell: pnpm explorer --worldsConfigPath packages/contracts/worlds.json --env development -``` +1. Install the libraries and run the application. -##### 3. **Run** + ```sh copy + pnpm install + pnpm dev + ``` -```sh -pnpm dev -``` +1. In a separate command-line window, go to `mud/package/explorer` and modify that package. + The code should rebuild automatically after you save changes. -Files can now be edited in the `packages/explorer` directory, and changes will be reflected in the running World Explorer instance. + If you want to modidy the user interface code, it is at `src/app/worlds/\[worldAddress\]`.