|
| 1 | + |
| 2 | +# Repair Ponder Indexer |
| 3 | + |
| 4 | +Indexes FWSS repair inventory state for datasets, pieces, and storage providers. |
| 5 | + |
| 6 | +The shared Drizzle schema used by downstream consumers lives in `packages/repair-db`. |
| 7 | +Ponder owns the on-chain write schema in `apps/ponder/ponder.schema.ts`, with table names imported from |
| 8 | +`@filoz/repair-db`. |
| 9 | + |
| 10 | +## Tables |
| 11 | + |
| 12 | +- `providers`: current ServiceProviderRegistry state, including provider name from block-scoped `eth_call`s and the |
| 13 | + PDP product `serviceURL`. |
| 14 | +- `data_sets`: current FWSS dataset state. `pdp_end_epoch != 0` means PDP payment termination has started. |
| 15 | +- `pieces`: current piece inventory keyed by `(data_set_id, piece_id)`, with a secondary CID index for finding alternate |
| 16 | + providers. |
| 17 | + |
| 18 | +## Commands |
| 19 | + |
| 20 | +```sh |
| 21 | +pnpm --filter @filoz/repair-ponder codegen:mainnet |
| 22 | +pnpm --filter @filoz/repair-ponder codegen:calibnet |
| 23 | +pnpm --filter @filoz/repair-ponder typecheck |
| 24 | +pnpm --filter @filoz/repair-ponder dev:mainnet |
| 25 | +pnpm --filter @filoz/repair-ponder dev:calibnet |
| 26 | +``` |
| 27 | + |
| 28 | +Set `DATABASE_URL` and `RPC_URL` to override the local defaults. |
| 29 | + |
| 30 | +Environment variables: |
| 31 | + |
| 32 | +| Variable | Values | Default | Strict mode | |
| 33 | +| --- | --- | --- | --- | |
| 34 | +| `PONDER_NETWORK` | `mainnet`, `calibnet` | `mainnet` | Required | |
| 35 | +| `DATABASE_URL` | PostgreSQL connection string | `postgres://ponder:ponder@localhost:17825/ponder` | Required | |
| 36 | +| `RPC_URL` | Filecoin JSON-RPC URL | `http://localhost:1234/rpc/v1` | Required | |
| 37 | +| `PONDER_STRICT_ENV` | `true`, `1` | unset | Enables strict mode | |
| 38 | + |
| 39 | +Set `PONDER_STRICT_ENV=true` to require `PONDER_NETWORK`, `DATABASE_URL`, and `RPC_URL`, which is recommended for |
| 40 | +deployments. |
| 41 | + |
| 42 | +## Networks |
| 43 | + |
| 44 | +| Network | Goldsky slug | FWSS address | PDPVerifier address | Start block | |
| 45 | +| --- | --- | --- | --- | --- | |
| 46 | +| Filecoin mainnet | `filecoin` | `0x8408502033C418E1bbC97cE9ac48E5528F371A9f` | `0xBADd0B92C1c71d02E7d520f64c0876538fa2557F` | `5459607` | |
| 47 | +| Filecoin calibration | `filecoin-testnet` | `0x02925630df557F957f70E112bA06e50965417CA0` | `0x85e366Cf9DD2c0aE37E963d9556F5f4718d6417C` | `3141266` | |
| 48 | + |
| 49 | +Start blocks are 10 blocks before FWSS proxy creation. Mainnet FWSS was created at block `5459617`; calibration FWSS was created at block `3141276`. |
0 commit comments