Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
karooolis committed Aug 29, 2024
1 parent c94dd5b commit ea16cfa
Showing 1 changed file with 21 additions and 37 deletions.
58 changes: 21 additions & 37 deletions packages/explorer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,52 +3,32 @@
World Explorer is a GUI tool designed for visually exploring and manipulating the state of worlds.
For the full information about it, [see the docs](http://mud.dev/world-explorer).

## Installation
## Getting started

Starting with MUD 2.2, the MUD templates come with the World Explorer installed. See [Getting started](https://mud.dev/quickstart) guide for MUD for more information.
### Prerequisites

If you have an existing MUD project you'd like to use World Explorer for, you can create a project with the new template and then use World Explorer from that project with your existing one:
World Explorer is not intended to be used alone, and includes the following prerequisites to be set up and running:

1. Create a project with the new template, which has World Explorer. Then, delete the files you no longer need.
- MUD project
- Development chain (e.g. Hardhat, Foundry)
- [@latticexyz/store-indexer](https://www.npmjs.com/package/@latticexyz/store-indexer)

```sh copy
pnpm create mud@main explorer --template vanilla
cd explorer
rm -rf packages/client packages/contracts
```

2. Edit `mprocs.yaml` to remove the definitions for `client`, `contracts`, and `anvil`.

```yaml filename="mprocs.yaml" copy
procs:
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
```
### Installation

3. Replace `packages/contracts/worlds.json` with a link to the original project's `worlds.json`.
```sh
pnpm add @latticexyz/explorer
pnpm explorer
```

```sh copy
cp packages/contracts
rm worlds.json
ln -s <the original project>/packages/contracts/worlds.json .
cd ../..
```
Or, can be executed with a package bin directly:

4. Run the new project.
```sh
npx @latticexyz/explorer
```

```sh copy
pnpm dev
```
### Example setup

5. Browse to [World Explorer](http://localhost:13690).
For a full working setup, check out the [`local-explorer` example](https://github.com/latticexyz/mud/tree/main/examples/local-explorer).

## CLI arguments

Expand Down Expand Up @@ -101,3 +81,7 @@ To contribute to World Explorer, first get familiar with the [MUD contribution g
```

Files can now be edited in the `packages/explorer` directory, and changes will be reflected in the running World Explorer instance.

## Links

- [Official World Explorer docs](https://mud.dev/world-explorer)

0 comments on commit ea16cfa

Please sign in to comment.