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(explorer): add world explorer docs page #3074

Merged
merged 22 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
4 changes: 4 additions & 0 deletions docs/pages/_meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ export default {
cli: "CLI",
"state-query": "State Query",
services: "Services",
"world-explorer": {
title: "World Explorer",
theme: { breadcrumb: false },
},
"---": {
title: "", // no title renders as a line
type: "separator",
Expand Down
85 changes: 85 additions & 0 deletions docs/pages/world-explorer.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# World Explorer

World Explorer is a GUI tool designed for visually exploring and manipulating the state of worlds.

## Getting started

##### 1. **Install the package**

```sh
pnpm add @latticexyz/explorer
qbzzt marked this conversation as resolved.
Show resolved Hide resolved
```

##### 2. **Start a local development chain**

Ensure you have a local development chain running.

##### 3. **Run the World Explorer**

```sh
npx @latticexyz/explorer --worldAddress <YOUR_WORLD_ADDRESS>
```

Alternatively, if you have a worlds configuration file:

```sh
npx @latticexyz/explorer --worldsConfigPath <PATH_TO_WORLDS_CONFIG>
```

Note: You can use `@latticexyz/store-indexer` for indexing your world's data.

## CLI arguments

The World Explorer accepts the following CLI arguments:

| Argument | Description | Default value |
| ----------------- | -------------------------------------------------------------------------------- | ------------- |
| `worldAddress` | The address of the world to explore | None |
| `worldsFile` | Path to a worlds configuration file (used to resolve world address) | None |
| `indexerDatabase` | Path to your SQLite indexer database | "indexer.db" |
qbzzt marked this conversation as resolved.
Show resolved Hide resolved
| `chainId` | The chain ID of the network | 31337 |
| `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

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:

##### 1. **Setup**

```sh
cd examples/local-explorer && pnpm install
```

##### 2. **Run**

```sh
pnpm dev
```

This command starts all necessary processes, including a local chain, indexer, and the explorer.

## Contributing
qbzzt marked this conversation as resolved.
Show resolved Hide resolved

To contribute to or modify the World Explorer, the easiest way is to run the example setup in `development` mode:

##### 1. **Setup**

Navigate to the `examples/local-explorer` directory and locate the `mprocs.yaml` file.

##### 2. **Configure**

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
```

##### 3. **Run**

```sh
pnpm dev
```

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