Skip to content

Commit 3d5b7b7

Browse files
dhvanipakarooolis
andauthored
fix(explorer): create a separate flag and port for the indexer created by the explorer (#3511)
Co-authored-by: Karolis Ramanauskas <hello@karolisram.com>
1 parent 452d3e5 commit 3d5b7b7

3 files changed

Lines changed: 14 additions & 1 deletion

File tree

.changeset/modern-parrots-shave.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@latticexyz/explorer": patch
3+
---
4+
5+
Add a separate flag and port for the indexer created by the Explorer.

docs/pages/world-explorer.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ The World Explorer accepts the following CLI arguments:
5959
| `chainId` | The chain ID of the network | 31337 |
6060
| `port` | The port on which to run the World Explorer | 13690 |
6161
| `hostname` | The host on which to run the World Explorer | 0.0.0.0 |
62+
| `indexerPort` | The port number for the indexer | 3001 |
6263

6364
## Installation
6465

packages/explorer/src/bin/explorer.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ const argv = yargs(process.argv.slice(2))
2020
type: "number",
2121
default: process.env.PORT || 13690,
2222
},
23+
indexerPort: {
24+
alias: "pi",
25+
description: "Port number for the indexer",
26+
type: "number",
27+
default: process.env.INDEXER_PORT || 3001,
28+
},
2329
hostname: {
2430
alias: "H",
2531
description: "Host for the server",
@@ -50,7 +56,7 @@ const argv = yargs(process.argv.slice(2))
5056
})
5157
.parseSync();
5258

53-
const { port, hostname, chainId, indexerDatabase, dev } = argv;
59+
const { port, indexerPort, hostname, chainId, indexerDatabase, dev } = argv;
5460
const indexerDatabasePath = path.join(packageRoot, indexerDatabase);
5561

5662
let explorerProcess: ChildProcess;
@@ -104,6 +110,7 @@ async function startStoreIndexer() {
104110
FOLLOW_BLOCK_TAG: "latest",
105111
SQLITE_FILENAME: indexerDatabase,
106112
...process.env,
113+
PORT: indexerPort.toString(),
107114
},
108115
});
109116
}

0 commit comments

Comments
 (0)