Skip to content

Commit

Permalink
docs: Add /trpc subroute to url indexer documentation and read example (
Browse files Browse the repository at this point in the history
#1352)

Co-authored-by: Gunnar Gylfason <[email protected]>
  • Loading branch information
tinkrtailor and tinkertailor1 authored Aug 22, 2023
1 parent ce7125a commit 20b86a7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions docs/pages/indexer.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ They are written under the assumption you are using `anvil` for your test chain,
1. Run this command as a sanity check to verify the indexer is working correctly:

```sh copy
curl 'http://localhost:3001/findAll?batch=1&input=%7B%220%22%3A%7B%22json%22%3A%7B%22chainId%22%3A31337%2C%22address%22%3A%220x5FbDB2315678afecb367f032d93F642f64180aa3%22%7D%7D%7D' | jq
curl 'http://localhost:3001/trpc/findAll?batch=1&input=%7B%220%22%3A%7B%22json%22%3A%7B%22chainId%22%3A31337%2C%22address%22%3A%220x5FbDB2315678afecb367f032d93F642f64180aa3%22%7D%7D%7D' | jq
```

The result should be nicely formatted (and long) JSON output.
Expand Down Expand Up @@ -89,11 +89,11 @@ The actual value: 2
```ts
import { createIndexerClient } from "@latticexyz/store-sync/trpc-indexer";
const indexer = createIndexerClient({
url: "http://localhost:3001",
url: "http://localhost:3001/trpc",
});
```

Create an indexer client. The URL, `http://localhost/3001`, is the one for the indexer you run on the local computer.
Create an indexer client. The URL, `http://localhost/3001/trpc`, is the one for the indexer you run on the local computer.
If the indexer is elsewhere, modify the URL as appropriate.

```ts
Expand Down
2 changes: 1 addition & 1 deletion examples/indexer-client/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createIndexerClient } from "@latticexyz/store-sync/trpc-indexer";
const indexer = createIndexerClient({
url: "http://localhost:3001",
url: "http://localhost:3001/trpc",
});

const result = await indexer.findAll.query({
Expand Down

0 comments on commit 20b86a7

Please sign in to comment.