Skip to content

Commit

Permalink
fix indexer db path
Browse files Browse the repository at this point in the history
  • Loading branch information
karooolis committed Sep 25, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent aa55ef9 commit 21659a9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/explorer/src/bin/explorer.ts
Original file line number Diff line number Diff line change
@@ -64,6 +64,8 @@ const argv = yargs(process.argv.slice(2))
.parseSync();

const { port, hostname, chainId, indexerDatabase, worldsFile, dev } = argv;
const indexerDatabasePath = path.join(packageRoot, indexerDatabase);

let worldAddress = argv.worldAddress;
let explorerProcess: ChildProcess;
let indexerProcess: ChildProcess;
@@ -73,7 +75,7 @@ async function startExplorer() {
...process.env,
CHAIN_ID: chainId.toString(),
WORLD_ADDRESS: worldAddress?.toString(),
INDEXER_DATABASE: indexerDatabase,
INDEXER_DATABASE: indexerDatabasePath,
};

if (dev) {
@@ -105,13 +107,12 @@ async function startStoreIndexer() {
return;
}

console.log("Running SQLite indexer for anvil...", packageRoot);
const indexerDatabasePath = path.join(packageRoot, indexerDatabase);
try {
if (existsSync(indexerDatabasePath)) {
execSync(`shx rm -rf ${indexerDatabasePath}`);
}

console.log("Running SQLite indexer for anvil...");
indexerProcess = spawn("sh", ["node_modules/.bin/sqlite-indexer"], {
cwd: packageRoot,
stdio: "inherit",

0 comments on commit 21659a9

Please sign in to comment.