|
| 1 | +import { anvil } from "viem/chains"; |
1 | 2 | import type { ComposeFile, Config, Service } from "../types/compose.js"; |
2 | 3 | import { DEFAULT_HEALTHCHECK } from "./common.js"; |
3 | 4 |
|
@@ -75,19 +76,21 @@ export const squidProcessorService = (options: ServiceOptions): Service => { |
75 | 76 | const databasePassword = options.databasePassword; |
76 | 77 | const databaseHost = options.databaseHost ?? "database"; |
77 | 78 | const databasePort = options.databasePort ?? 5432; |
| 79 | + const chain = anvil; |
| 80 | + const environment: Record<string, string> = { |
| 81 | + DB_HOST: databaseHost, |
| 82 | + DB_NAME: "explorer", |
| 83 | + DB_PASS: databasePassword, |
| 84 | + DB_PORT: databasePort.toString(), |
| 85 | + CHAIN_IDS: chain.id.toString(), |
| 86 | + }; |
| 87 | + environment[`RPC_URL_${chain.id}`] = `http://anvil:8545`; |
| 88 | + environment[`BLOCK_CONFIRMATIONS_${chain.id}`] = "0"; |
| 89 | + environment[`GENESIS_BLOCK_${chain.id}`] = "1"; |
78 | 90 |
|
79 | 91 | return { |
80 | 92 | image: `cartesi/rollups-explorer-api:${imageTag}`, |
81 | | - environment: { |
82 | | - DB_HOST: databaseHost, |
83 | | - DB_NAME: "explorer", |
84 | | - DB_PASS: databasePassword, |
85 | | - DB_PORT: databasePort.toString(), |
86 | | - CHAIN_IDS: "13370", |
87 | | - RPC_URL_13370: "http://anvil:8545", |
88 | | - BLOCK_CONFIRMATIONS_13370: 0, |
89 | | - GENESIS_BLOCK_13370: 1, |
90 | | - }, |
| 93 | + environment, |
91 | 94 | command: ["sqd", "process:prod"], |
92 | 95 | depends_on: { |
93 | 96 | database: { condition: "service_healthy" }, |
|
0 commit comments