Skip to content

Commit

Permalink
Contributing... done
Browse files Browse the repository at this point in the history
  • Loading branch information
qbzzt committed Aug 28, 2024
1 parent e4662c6 commit 9fde4f2
Showing 1 changed file with 48 additions and 17 deletions.
65 changes: 48 additions & 17 deletions docs/pages/world-explorer.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
<CollapseCode>

##### 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:
</CollapseCode>

```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\]`.

0 comments on commit 9fde4f2

Please sign in to comment.