@filoz/repair-cli 0.3.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/package.json +3 -3
- package/dist/src/api.d.ts +35 -0
- package/dist/src/api.d.ts.map +1 -0
- package/dist/src/api.js +118 -0
- package/dist/src/api.js.map +1 -0
- package/dist/src/cli.js +2 -0
- package/dist/src/cli.js.map +1 -1
- package/dist/src/commands/datasets.d.ts +3 -5
- package/dist/src/commands/datasets.d.ts.map +1 -1
- package/dist/src/commands/datasets.js +24 -33
- package/dist/src/commands/datasets.js.map +1 -1
- package/dist/src/commands/providers.d.ts +3 -5
- package/dist/src/commands/providers.d.ts.map +1 -1
- package/dist/src/commands/providers.js +32 -33
- package/dist/src/commands/providers.js.map +1 -1
- package/dist/src/commands/repair.d.ts +3 -5
- package/dist/src/commands/repair.d.ts.map +1 -1
- package/dist/src/commands/repair.js +3 -3
- package/dist/src/commands/repair.js.map +1 -1
- package/dist/src/commands/replicate.d.ts +3 -5
- package/dist/src/commands/replicate.d.ts.map +1 -1
- package/dist/src/commands/replicate.js +3 -3
- package/dist/src/commands/replicate.js.map +1 -1
- package/dist/src/commands/second-copy.d.ts +23 -0
- package/dist/src/commands/second-copy.d.ts.map +1 -0
- package/dist/src/commands/second-copy.js +175 -0
- package/dist/src/commands/second-copy.js.map +1 -0
- package/dist/src/commands/session-key.d.ts +3 -5
- package/dist/src/commands/session-key.d.ts.map +1 -1
- package/dist/src/commands/setup.d.ts.map +1 -1
- package/dist/src/commands/setup.js +11 -32
- package/dist/src/commands/setup.js.map +1 -1
- package/dist/src/commands/wallet.d.ts +3 -5
- package/dist/src/commands/wallet.d.ts.map +1 -1
- package/dist/src/db/dedupe-cids.d.ts +6 -7
- package/dist/src/db/dedupe-cids.d.ts.map +1 -1
- package/dist/src/db/dedupe-cids.js +2 -14
- package/dist/src/db/dedupe-cids.js.map +1 -1
- package/dist/src/db/find-repair-dataset.d.ts +3 -3
- package/dist/src/db/find-repair-dataset.d.ts.map +1 -1
- package/dist/src/db/find-repair-dataset.js +16 -14
- package/dist/src/db/find-repair-dataset.js.map +1 -1
- package/dist/src/db/get-active-data-set-ids.d.ts +9 -0
- package/dist/src/db/get-active-data-set-ids.d.ts.map +1 -0
- package/dist/src/db/get-active-data-set-ids.js +9 -0
- package/dist/src/db/get-active-data-set-ids.js.map +1 -0
- package/dist/src/db/get-alternate-provider-urls.d.ts +6 -0
- package/dist/src/db/get-alternate-provider-urls.d.ts.map +1 -0
- package/dist/src/db/get-alternate-provider-urls.js +24 -0
- package/dist/src/db/get-alternate-provider-urls.js.map +1 -0
- package/dist/src/db/get-pieces.d.ts +8 -27
- package/dist/src/db/get-pieces.d.ts.map +1 -1
- package/dist/src/db/get-pieces.js +44 -97
- package/dist/src/db/get-pieces.js.map +1 -1
- package/dist/src/db/get-repair-provider.d.ts +2 -2
- package/dist/src/db/get-repair-provider.d.ts.map +1 -1
- package/dist/src/db/get-repair-provider.js +8 -20
- package/dist/src/db/get-repair-provider.js.map +1 -1
- package/dist/src/db/repair-create.d.ts.map +1 -1
- package/dist/src/db/repair-create.js +5 -3
- package/dist/src/db/repair-create.js.map +1 -1
- package/dist/src/db/replicate-create.d.ts.map +1 -1
- package/dist/src/db/replicate-create.js +15 -21
- package/dist/src/db/replicate-create.js.map +1 -1
- package/dist/src/db/second-copy-create.d.ts +10 -0
- package/dist/src/db/second-copy-create.d.ts.map +1 -0
- package/dist/src/db/second-copy-create.js +104 -0
- package/dist/src/db/second-copy-create.js.map +1 -0
- package/dist/src/local-schema.d.ts +41 -1
- package/dist/src/local-schema.d.ts.map +1 -1
- package/dist/src/local-schema.js +2 -0
- package/dist/src/local-schema.js.map +1 -1
- package/dist/src/middleware.d.ts +7 -11
- package/dist/src/middleware.d.ts.map +1 -1
- package/dist/src/middleware.js +6 -10
- package/dist/src/middleware.js.map +1 -1
- package/dist/src/pipeline/add-pieces.d.ts +3 -3
- package/dist/src/pipeline/add-pieces.d.ts.map +1 -1
- package/dist/src/pipeline/add-pieces.js +15 -7
- package/dist/src/pipeline/add-pieces.js.map +1 -1
- package/dist/src/pipeline/create-datasets.d.ts +4 -4
- package/dist/src/pipeline/create-datasets.d.ts.map +1 -1
- package/dist/src/pipeline/create-datasets.js +7 -14
- package/dist/src/pipeline/create-datasets.js.map +1 -1
- package/dist/src/types.d.ts +6 -7
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils.d.ts +7 -10
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/src/utils.js +21 -2
- package/dist/src/utils.js.map +1 -1
- package/package.json +3 -3
- package/readme.md +98 -13
- package/src/api.ts +220 -0
- package/src/cli.ts +2 -0
- package/src/commands/datasets.ts +24 -36
- package/src/commands/providers.ts +34 -42
- package/src/commands/repair.ts +3 -3
- package/src/commands/replicate.ts +3 -3
- package/src/commands/second-copy.ts +187 -0
- package/src/commands/setup.ts +12 -35
- package/src/db/dedupe-cids.ts +7 -24
- package/src/db/find-repair-dataset.ts +17 -28
- package/src/db/get-active-data-set-ids.ts +29 -0
- package/src/db/get-alternate-provider-urls.ts +43 -0
- package/src/db/get-pieces.ts +82 -214
- package/src/db/get-repair-provider.ts +10 -30
- package/src/db/repair-create.ts +5 -3
- package/src/db/replicate-create.ts +15 -21
- package/src/db/second-copy-create.ts +147 -0
- package/src/local-schema.ts +3 -0
- package/src/middleware.ts +7 -11
- package/src/pipeline/add-pieces.ts +21 -11
- package/src/pipeline/create-datasets.ts +9 -29
- package/src/types.ts +9 -7
- package/src/utils.ts +22 -4
- package/dist/src/db/find-providers-by-cid.d.ts +0 -9
- package/dist/src/db/find-providers-by-cid.d.ts.map +0 -1
- package/dist/src/db/find-providers-by-cid.js +0 -43
- package/dist/src/db/find-providers-by-cid.js.map +0 -1
- package/dist/src/indexer-schema.d.ts +0 -549
- package/dist/src/indexer-schema.d.ts.map +0 -1
- package/dist/src/indexer-schema.js +0 -56
- package/dist/src/indexer-schema.js.map +0 -1
- package/src/db/find-providers-by-cid.ts +0 -70
- package/src/indexer-schema.ts +0 -77
package/dist/src/utils.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { type Chain } from '@filoz/synapse-core/chains';
|
|
2
2
|
import type * as SP from '@filoz/synapse-core/sp';
|
|
3
3
|
import { type SQL } from 'drizzle-orm';
|
|
4
|
-
import type { PgTable } from 'drizzle-orm/pg-core';
|
|
5
4
|
import type { SQLiteTable } from 'drizzle-orm/sqlite-core';
|
|
6
5
|
import { z } from 'incur';
|
|
7
6
|
import { Conf } from 'iso-conf';
|
|
@@ -11,16 +10,14 @@ import * as schema from './local-schema.ts';
|
|
|
11
10
|
import type { LocalDatabase, WalletClient } from './types.ts';
|
|
12
11
|
export declare const configSchema: z.ZodObject<{
|
|
13
12
|
privateKey: z.ZodOptional<z.ZodString>;
|
|
14
|
-
|
|
15
|
-
indexerCalibrationUrl: z.ZodOptional<z.ZodURL>;
|
|
13
|
+
apiUrl: z.ZodOptional<z.ZodURL>;
|
|
16
14
|
chainId: z.ZodOptional<z.ZodNumber>;
|
|
17
15
|
dbPath: z.ZodOptional<z.ZodString>;
|
|
18
16
|
source: z.ZodOptional<z.ZodString>;
|
|
19
17
|
}, z.core.$strip>;
|
|
20
18
|
export declare const config: Conf<z.ZodObject<{
|
|
21
19
|
privateKey: z.ZodOptional<z.ZodString>;
|
|
22
|
-
|
|
23
|
-
indexerCalibrationUrl: z.ZodOptional<z.ZodURL>;
|
|
20
|
+
apiUrl: z.ZodOptional<z.ZodURL>;
|
|
24
21
|
chainId: z.ZodOptional<z.ZodNumber>;
|
|
25
22
|
dbPath: z.ZodOptional<z.ZodString>;
|
|
26
23
|
source: z.ZodOptional<z.ZodString>;
|
|
@@ -11957,30 +11954,30 @@ export declare function getPiece({ pieceCid, serviceUrl }: {
|
|
|
11957
11954
|
serviceUrl: string;
|
|
11958
11955
|
}): Promise<string>;
|
|
11959
11956
|
export declare function findPieceOnProviders(providers: string[], pieceCid: string): Promise<string | undefined>;
|
|
11960
|
-
export declare const buildConflictUpdateColumns: <T extends
|
|
11957
|
+
export declare const buildConflictUpdateColumns: <T extends SQLiteTable, Q extends keyof T["_"]["columns"]>(table: T, columns?: Q[]) => Record<Q, SQL<unknown>>;
|
|
11961
11958
|
export declare function excludeOperationsByCid(operations: OperationSelect[], cid: string): {
|
|
11962
11959
|
operationToCommit: {
|
|
11963
|
-
metadata: import("@filoz/synapse-core").MetadataObject;
|
|
11964
|
-
cid: string;
|
|
11965
11960
|
id: number;
|
|
11966
11961
|
status: schema.OperationStatus;
|
|
11967
11962
|
createdAt: number;
|
|
11968
11963
|
updatedAt: number;
|
|
11969
11964
|
repairId: number;
|
|
11970
11965
|
type: schema.OperationType;
|
|
11966
|
+
cid: string;
|
|
11967
|
+
metadata: import("@filoz/synapse-core").MetadataObject;
|
|
11971
11968
|
alternateProvider: string;
|
|
11972
11969
|
txHash: string | null;
|
|
11973
11970
|
error: string | null;
|
|
11974
11971
|
}[];
|
|
11975
11972
|
operationToFailed: {
|
|
11976
|
-
metadata: import("@filoz/synapse-core").MetadataObject;
|
|
11977
|
-
cid: string;
|
|
11978
11973
|
id: number;
|
|
11979
11974
|
status: schema.OperationStatus;
|
|
11980
11975
|
createdAt: number;
|
|
11981
11976
|
updatedAt: number;
|
|
11982
11977
|
repairId: number;
|
|
11983
11978
|
type: schema.OperationType;
|
|
11979
|
+
cid: string;
|
|
11980
|
+
metadata: import("@filoz/synapse-core").MetadataObject;
|
|
11984
11981
|
alternateProvider: string;
|
|
11985
11982
|
txHash: string | null;
|
|
11986
11983
|
error: string | null;
|
package/dist/src/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,KAAK,EAAY,MAAM,4BAA4B,CAAA;AAEjE,OAAO,KAAK,KAAK,EAAE,MAAM,wBAAwB,CAAA;AACjD,OAAO,EAA4B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AAM,CAAC,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,EACjG,OAAO,CAAC,EACR,UAAU,CAAC,EAAE,4BAed,CAAA;AAKD,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,eAAe,EAAE,EAAE,GAAG,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWhF;AAKD,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,eAAe,EAAE,uBAiBnE"}
|
package/dist/src/utils.js
CHANGED
|
@@ -14,8 +14,7 @@ import packageJson from '../package.json' with { type: 'json' };
|
|
|
14
14
|
import * as schema from "./local-schema.js";
|
|
15
15
|
export const configSchema = z.object({
|
|
16
16
|
privateKey: z.string().optional(),
|
|
17
|
-
|
|
18
|
-
indexerCalibrationUrl: z.url().optional(),
|
|
17
|
+
apiUrl: z.url().optional(),
|
|
19
18
|
chainId: z.number().optional(),
|
|
20
19
|
dbPath: z.string().optional(),
|
|
21
20
|
source: z.string().optional(),
|
|
@@ -56,6 +55,7 @@ export async function createLocalDatabase(dbPath) {
|
|
|
56
55
|
schema,
|
|
57
56
|
});
|
|
58
57
|
await localDb.$client.execute('PRAGMA journal_mode = WAL');
|
|
58
|
+
await migrateLocalDatabase(localDb);
|
|
59
59
|
return localDb;
|
|
60
60
|
}
|
|
61
61
|
export async function migrateLocalDatabase(db) {
|
|
@@ -80,6 +80,25 @@ export async function migrateLocalDatabase(db) {
|
|
|
80
80
|
}
|
|
81
81
|
catch {
|
|
82
82
|
}
|
|
83
|
+
try {
|
|
84
|
+
await db.$client.execute(`
|
|
85
|
+
ALTER TABLE repairs ADD COLUMN kind text NOT NULL DEFAULT 'repair'
|
|
86
|
+
`);
|
|
87
|
+
}
|
|
88
|
+
catch {
|
|
89
|
+
}
|
|
90
|
+
try {
|
|
91
|
+
await db.$client.execute(`
|
|
92
|
+
ALTER TABLE repairs ADD COLUMN source_provider_url text
|
|
93
|
+
`);
|
|
94
|
+
}
|
|
95
|
+
catch {
|
|
96
|
+
}
|
|
97
|
+
await db.$client.execute(`
|
|
98
|
+
UPDATE repairs
|
|
99
|
+
SET kind = 'replicate'
|
|
100
|
+
WHERE repair_data_set_id IS NOT NULL AND (kind IS NULL OR kind = 'repair')
|
|
101
|
+
`);
|
|
83
102
|
await db.$client.execute(`
|
|
84
103
|
CREATE TABLE IF NOT EXISTS operations (
|
|
85
104
|
id integer PRIMARY KEY AUTOINCREMENT NOT NULL,
|
package/dist/src/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AACjE,OAAO,KAAK,KAAK,MAAM,2BAA2B,CAAA;AAElD,OAAO,EAAE,eAAe,EAAE,OAAO,EAAY,GAAG,EAAE,MAAM,aAAa,CAAA;AACrE,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AACjE,OAAO,KAAK,KAAK,MAAM,2BAA2B,CAAA;AAElD,OAAO,EAAE,eAAe,EAAE,OAAO,EAAY,GAAG,EAAE,MAAM,aAAa,CAAA;AACrE,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAE5C,OAAO,EAAE,CAAC,EAAE,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,OAAO,MAAM,UAAU,CAAA;AAC9B,OAAO,YAAY,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,kBAAkB,EAAuB,IAAI,EAAE,+BAA+B,EAAE,MAAM,MAAM,CAAA;AACrG,OAAO,EAAE,mBAAmB,EAAE,MAAM,eA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|
"description": "Early repair for faulty service providers and datasets",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -96,10 +96,12 @@
|
|
|
96
96
|
},
|
|
97
97
|
"dependencies": {
|
|
98
98
|
"@clack/prompts": "^1.5.1",
|
|
99
|
+
"@filecoin-project/api-client": "^0.2.0",
|
|
99
100
|
"@filoz/synapse-core": "^0.7.0",
|
|
100
101
|
"@libsql/client": "^0.17.3",
|
|
101
102
|
"conf": "^15.1.0",
|
|
102
103
|
"drizzle-orm": "^0.45.2",
|
|
104
|
+
"fetch-extras": "^3.2.1",
|
|
103
105
|
"incur": "^0.4.6",
|
|
104
106
|
"iso-base": "^4.4.0",
|
|
105
107
|
"iso-conf": "^0.4.0",
|
|
@@ -108,14 +110,12 @@
|
|
|
108
110
|
"p-locate": "^7.0.0",
|
|
109
111
|
"p-map": "^7.0.4",
|
|
110
112
|
"p-queue": "^9.3.0",
|
|
111
|
-
"pg": "^8.21.0",
|
|
112
113
|
"terminal-link": "^5.0.0",
|
|
113
114
|
"viem": "^2.50.4"
|
|
114
115
|
},
|
|
115
116
|
"devDependencies": {
|
|
116
117
|
"@biomejs/biome": "2.4.16",
|
|
117
118
|
"@types/node": "^25.9.2",
|
|
118
|
-
"@types/pg": "^8.20.0",
|
|
119
119
|
"playwright-test": "^14.1.12",
|
|
120
120
|
"type-fest": "^5.7.0",
|
|
121
121
|
"typescript": "6.0.3"
|
package/readme.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
The `repair` CLI helps prepare and run repair and replication jobs on Filecoin PDP datasets. It uses:
|
|
8
8
|
|
|
9
|
-
-
|
|
9
|
+
- the [Filecoin API](https://github.com/filecoin-project/agents/tree/main/apps/filecoin-api) (`https://api.filecoin.io` by default) as the read-only source of providers, datasets, and pieces
|
|
10
10
|
- a local SQLite database to track repair and replication jobs and per-piece operations
|
|
11
11
|
- a configured Filecoin wallet to create datasets and submit on-chain add-piece transactions
|
|
12
12
|
|
|
@@ -24,7 +24,7 @@ repair --help
|
|
|
24
24
|
|
|
25
25
|
## Setup
|
|
26
26
|
|
|
27
|
-
Run setup before using any command that talks to the
|
|
27
|
+
Run setup before using any command that talks to the Filecoin API, local database, or wallet.
|
|
28
28
|
|
|
29
29
|
```bash
|
|
30
30
|
repair setup
|
|
@@ -33,8 +33,7 @@ repair setup
|
|
|
33
33
|
Setup prompts for:
|
|
34
34
|
|
|
35
35
|
- private key for the repair wallet
|
|
36
|
-
-
|
|
37
|
-
- calibration indexer Postgres URL
|
|
36
|
+
- Filecoin API URL (defaults to `https://api.filecoin.io`)
|
|
38
37
|
- chain, either Filecoin Mainnet `314` or Filecoin Calibration `314159`
|
|
39
38
|
- local SQLite database path
|
|
40
39
|
- dataset source label, used when creating repair target datasets (defaults to `early-repair`)
|
|
@@ -59,7 +58,7 @@ Interactive configuration and local database setup.
|
|
|
59
58
|
repair setup
|
|
60
59
|
```
|
|
61
60
|
|
|
62
|
-
Use this whenever you need to initialize the CLI, change the active chain,
|
|
61
|
+
Use this whenever you need to initialize the CLI, change the active chain, change the Filecoin API URL, change the dataset source label, or move the local SQLite database.
|
|
63
62
|
|
|
64
63
|
### `repair wallet fund`
|
|
65
64
|
|
|
@@ -136,7 +135,7 @@ The command waits for the revoke transaction to be mined and returns the session
|
|
|
136
135
|
|
|
137
136
|
### `repair providers list`
|
|
138
137
|
|
|
139
|
-
Lists PDP providers from the
|
|
138
|
+
Lists PDP providers from the Filecoin API.
|
|
140
139
|
|
|
141
140
|
```bash
|
|
142
141
|
repair providers list
|
|
@@ -149,8 +148,6 @@ By default, the command returns active PDP providers that are approved or endors
|
|
|
149
148
|
- `serviceUrl`
|
|
150
149
|
- `approved`
|
|
151
150
|
- `endorsed`
|
|
152
|
-
- `pieceCount`, the number of active indexed pieces for that provider
|
|
153
|
-
- `totalSize`, the sum of active piece raw sizes formatted in decimal GB
|
|
154
151
|
|
|
155
152
|
Use `--all` to include every active PDP provider, even if it is not approved or endorsed.
|
|
156
153
|
|
|
@@ -158,6 +155,12 @@ Use `--all` to include every active PDP provider, even if it is not approved or
|
|
|
158
155
|
repair providers list --all
|
|
159
156
|
```
|
|
160
157
|
|
|
158
|
+
Use `--stats` to also return `pieceCount`, the number of active indexed pieces for each provider, and `totalSize`, the sum of their raw sizes in decimal GB. The API has no aggregate endpoint, so this pages through every piece of every listed provider and can take a long time.
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
repair providers list --stats
|
|
162
|
+
```
|
|
163
|
+
|
|
161
164
|
### `repair datasets list`
|
|
162
165
|
|
|
163
166
|
Lists datasets owned by the configured repair wallet.
|
|
@@ -166,7 +169,7 @@ Lists datasets owned by the configured repair wallet.
|
|
|
166
169
|
repair datasets list
|
|
167
170
|
```
|
|
168
171
|
|
|
169
|
-
Each dataset includes its ID, CDN/IPFS indexing flags, source, provider URL, PDP end epoch
|
|
172
|
+
Each dataset includes its ID, CDN/IPFS indexing flags, source, provider URL, and PDP end epoch. Add `--stats` to include each dataset's active piece count, which pages through every piece.
|
|
170
173
|
|
|
171
174
|
Filter by provider ID:
|
|
172
175
|
|
|
@@ -176,7 +179,7 @@ repair datasets list --provider-id 123
|
|
|
176
179
|
|
|
177
180
|
### `repair datasets show <id>`
|
|
178
181
|
|
|
179
|
-
Shows a dataset from the
|
|
182
|
+
Shows a dataset from the Filecoin API.
|
|
180
183
|
|
|
181
184
|
```bash
|
|
182
185
|
repair datasets show 42
|
|
@@ -206,7 +209,7 @@ repair repair create --provider-id 101 --target-provider-id 202
|
|
|
206
209
|
|
|
207
210
|
`--target-provider-id` is the provider that should receive the repaired pieces. It must be different from `--provider-id`.
|
|
208
211
|
|
|
209
|
-
The command snapshots the current chain block number, creates a local repair row, scans active pieces for the source provider, deduplicates them by CID, and creates local `add_piece` operations.
|
|
212
|
+
The command snapshots the current chain block number, creates a local repair row, scans active pieces for the source provider, deduplicates them by CID, and creates local `add_piece` operations. For each piece it probes the approved and endorsed providers (endorsed first) with `HEAD /piece/{cid}`, then the provider being repaired as a last resort, and uses the first one that serves it as the pull source. Pieces that no provider serves are marked `skipped`. The command returns a `repairId`.
|
|
210
213
|
|
|
211
214
|
### `repair repair list`
|
|
212
215
|
|
|
@@ -225,7 +228,7 @@ Each repair includes:
|
|
|
225
228
|
- block number used when the repair was created
|
|
226
229
|
- total operations and counts by `pending`, `failed`, `completed`, and `skipped`
|
|
227
230
|
|
|
228
|
-
This command lists provider-level repairs only. Dataset replications are listed with `repair replicate list`.
|
|
231
|
+
This command lists provider-level repairs only. Dataset replications are listed with `repair replicate list`. Second-copy jobs are listed with `repair second-copy list`.
|
|
229
232
|
|
|
230
233
|
### `repair repair run <repairId>`
|
|
231
234
|
|
|
@@ -235,7 +238,7 @@ Runs a pending repair.
|
|
|
235
238
|
repair repair run 1
|
|
236
239
|
```
|
|
237
240
|
|
|
238
|
-
The command first ensures the target repair dataset exists for the configured wallet and target provider. If no matching dataset exists, it creates one with IPFS indexing enabled and CDN disabled, using the configured source label. Then it processes pending `add_piece` operations by pulling pieces from alternate providers into the target provider and committing them on-chain.
|
|
241
|
+
The command first ensures the target repair dataset exists for the configured wallet and target provider. If no matching dataset exists, it creates one with IPFS indexing enabled and CDN disabled, using the configured source label. Then it reads the CIDs already in the target dataset once, marks matching operations completed, and processes the remaining pending `add_piece` operations by pulling pieces from alternate providers into the target provider and committing them on-chain.
|
|
239
242
|
|
|
240
243
|
Options:
|
|
241
244
|
|
|
@@ -324,6 +327,75 @@ repair replicate delete 1
|
|
|
324
327
|
|
|
325
328
|
This only deletes local SQLite state. It does not delete on-chain datasets or remove pieces from a provider.
|
|
326
329
|
|
|
330
|
+
### `repair second-copy create`
|
|
331
|
+
|
|
332
|
+
Creates a local second-copy job from a pieces JSON file and an explicit source provider URL.
|
|
333
|
+
|
|
334
|
+
```bash
|
|
335
|
+
repair second-copy create \
|
|
336
|
+
--pieces-file ./secondary-copy-pieces.json \
|
|
337
|
+
--source-provider-url https://mainnet-sp.example/pdp \
|
|
338
|
+
--target-provider-id 202
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
`--pieces-file` is a JSON file with an `aggregates` array. Each aggregate must include a `piece_cid` string. Only aggregate `piece_cid` values are used; `sub_pieces` are ignored.
|
|
342
|
+
|
|
343
|
+
`--source-provider-url` is the provider URL pieces are pulled from. It is not looked up in the Filecoin API, so it can point at a provider on another network (for example Mainnet while the CLI is configured for Calibration).
|
|
344
|
+
|
|
345
|
+
`--target-provider-id` is the provider on the configured chain that should receive the copied pieces. Its service URL must differ from `--source-provider-url`.
|
|
346
|
+
|
|
347
|
+
The command snapshots the current chain block number, creates a local second-copy row, and creates local `add_piece` operations for every unique `piece_cid` in the file. The command returns a `secondCopyId`.
|
|
348
|
+
|
|
349
|
+
### `repair second-copy list`
|
|
350
|
+
|
|
351
|
+
Lists local second-copy jobs.
|
|
352
|
+
|
|
353
|
+
```bash
|
|
354
|
+
repair second-copy list
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
Each job includes:
|
|
358
|
+
|
|
359
|
+
- second-copy ID and status
|
|
360
|
+
- source provider URL
|
|
361
|
+
- target provider ID and target provider URL
|
|
362
|
+
- target dataset ID, when one has been created or found
|
|
363
|
+
- block number used when the job was created
|
|
364
|
+
- total operations and counts by `pending`, `failed`, `completed`, and `skipped`
|
|
365
|
+
|
|
366
|
+
### `repair second-copy run <secondCopyId>`
|
|
367
|
+
|
|
368
|
+
Runs a pending second-copy job.
|
|
369
|
+
|
|
370
|
+
```bash
|
|
371
|
+
repair second-copy run 1
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
The command first ensures the target dataset exists for the configured wallet and target provider (same as repair: IPFS indexing enabled, CDN disabled). Then it processes pending `add_piece` operations by pulling pieces from `--source-provider-url` into the target provider and committing them on-chain.
|
|
375
|
+
|
|
376
|
+
Options:
|
|
377
|
+
|
|
378
|
+
- `--concurrency <number>` controls how many pull batches run at once. Defaults to `4`.
|
|
379
|
+
- `--batch-size <number>` controls the maximum number of `add_piece` operations per batch. Defaults to `40`.
|
|
380
|
+
- `--payer <address>` overrides the payer address used when creating or finding the target dataset. Defaults to the configured wallet address.
|
|
381
|
+
|
|
382
|
+
Example:
|
|
383
|
+
|
|
384
|
+
```bash
|
|
385
|
+
repair second-copy run 1 --concurrency 8 --batch-size 40
|
|
386
|
+
repair second-copy run 1 --payer 0x1234567890123456789012345678901234567890
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
### `repair second-copy delete <secondCopyId>`
|
|
390
|
+
|
|
391
|
+
Deletes a local second-copy job and its operations.
|
|
392
|
+
|
|
393
|
+
```bash
|
|
394
|
+
repair second-copy delete 1
|
|
395
|
+
```
|
|
396
|
+
|
|
397
|
+
This only deletes local SQLite state. It does not delete on-chain datasets or remove pieces from a provider.
|
|
398
|
+
|
|
327
399
|
## Typical Workflow
|
|
328
400
|
|
|
329
401
|
1. Configure the CLI.
|
|
@@ -378,6 +450,19 @@ repair replicate list
|
|
|
378
450
|
repair replicate run 1
|
|
379
451
|
```
|
|
380
452
|
|
|
453
|
+
### Second-copy from a pieces file
|
|
454
|
+
|
|
455
|
+
Use second-copy when you have a list of piece CIDs to pull from an explicit provider URL into a target provider on the configured chain. This supports cross-network pulls, such as Mainnet source URL → Calibration target provider.
|
|
456
|
+
|
|
457
|
+
```bash
|
|
458
|
+
repair second-copy create \
|
|
459
|
+
--pieces-file ./secondary-copy-pieces.json \
|
|
460
|
+
--source-provider-url https://mainnet-sp.example/pdp \
|
|
461
|
+
--target-provider-id 202
|
|
462
|
+
repair second-copy list
|
|
463
|
+
repair second-copy run 1
|
|
464
|
+
```
|
|
465
|
+
|
|
381
466
|
## Contributing
|
|
382
467
|
|
|
383
468
|
Read contributing [guidelines](../../.github/CONTRIBUTING.md).
|
package/src/api.ts
ADDED
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ApiError,
|
|
3
|
+
createApiClient,
|
|
4
|
+
type DataSet,
|
|
5
|
+
DEFAULT_API_URL,
|
|
6
|
+
type Piece,
|
|
7
|
+
type PieceWithDataSet,
|
|
8
|
+
type Provider,
|
|
9
|
+
unwrap,
|
|
10
|
+
} from '@filecoin-project/api-client'
|
|
11
|
+
import { pipeline, withRateLimit, withRetry, withTimeout } from 'fetch-extras'
|
|
12
|
+
import type { IndexerApi } from './types.ts'
|
|
13
|
+
|
|
14
|
+
export { ApiError, DEFAULT_API_URL } from '@filecoin-project/api-client'
|
|
15
|
+
export type { DataSet, Piece, PieceWithDataSet, Provider }
|
|
16
|
+
|
|
17
|
+
/** filecoin-api network path segment. */
|
|
18
|
+
export type Network = 'mainnet' | 'calibration'
|
|
19
|
+
|
|
20
|
+
/** Largest page size filecoin-api accepts. */
|
|
21
|
+
export const MAX_PAGE_SIZE = 200
|
|
22
|
+
|
|
23
|
+
/** Retries for network errors and `408`, `429` and `5xx` responses. */
|
|
24
|
+
const MAX_RETRIES = 5
|
|
25
|
+
|
|
26
|
+
/** Per-attempt request timeout; a timed-out request fails instead of retrying. */
|
|
27
|
+
const REQUEST_TIMEOUT_MS = 30_000
|
|
28
|
+
|
|
29
|
+
/** filecoin-api allows 120 requests per minute per client IP. */
|
|
30
|
+
const RATE_LIMIT = { requestsPerInterval: 120, interval: 60_000 }
|
|
31
|
+
|
|
32
|
+
/** Map a chain ID to its filecoin-api network. */
|
|
33
|
+
export function networkFromChainId(chainId: number): Network {
|
|
34
|
+
return chainId === 314 ? 'mainnet' : 'calibration'
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Create a filecoin-api client for a chain.
|
|
39
|
+
*
|
|
40
|
+
* @param options.baseUrl - API origin; defaults to the client's production URL.
|
|
41
|
+
* @param options.chainId - Chain ID used to pick the network.
|
|
42
|
+
*/
|
|
43
|
+
export function createIndexerApi({ baseUrl, chainId }: { baseUrl?: string; chainId: number }): IndexerApi {
|
|
44
|
+
// Pace requests under the API's limit, and still retry 429s (other clients may share the IP),
|
|
45
|
+
// honouring Retry-After.
|
|
46
|
+
const fetchWithRetry = pipeline(
|
|
47
|
+
fetch,
|
|
48
|
+
withTimeout(REQUEST_TIMEOUT_MS),
|
|
49
|
+
withRateLimit(RATE_LIMIT),
|
|
50
|
+
withRetry({ retries: MAX_RETRIES })
|
|
51
|
+
)
|
|
52
|
+
return {
|
|
53
|
+
client: createApiClient({ baseUrl: baseUrl ?? DEFAULT_API_URL, fetch: fetchWithRetry }),
|
|
54
|
+
network: networkFromChainId(chainId),
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** Return `null` instead of throwing for a filecoin-api 404. */
|
|
59
|
+
async function orNull<T>(promise: Promise<T>): Promise<T | null> {
|
|
60
|
+
try {
|
|
61
|
+
return await promise
|
|
62
|
+
} catch (error) {
|
|
63
|
+
if (ApiError.isNotFound(error)) return null
|
|
64
|
+
throw error
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** Collect every item from a cursor-paginated walk. */
|
|
69
|
+
async function collect<T>(pages: AsyncIterable<T[]>): Promise<T[]> {
|
|
70
|
+
const items: T[] = []
|
|
71
|
+
for await (const page of pages) items.push(...page)
|
|
72
|
+
return items
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Walk a cursor-paginated list, yielding one page of items at a time.
|
|
77
|
+
*
|
|
78
|
+
* @param fetchPage - Fetches the page after `cursor` (`undefined` for the first page).
|
|
79
|
+
*/
|
|
80
|
+
async function* paginate<T>(
|
|
81
|
+
fetchPage: (cursor: string | undefined) => Promise<{ data: T[]; nextCursor: string | null }>
|
|
82
|
+
): AsyncGenerator<T[]> {
|
|
83
|
+
let cursor: string | undefined
|
|
84
|
+
do {
|
|
85
|
+
const page = await fetchPage(cursor)
|
|
86
|
+
yield page.data
|
|
87
|
+
cursor = page.nextCursor ?? undefined
|
|
88
|
+
} while (cursor)
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/** Get a provider by ID, or `null` when it does not exist. */
|
|
92
|
+
export function getProvider({ client, network }: IndexerApi, providerId: bigint): Promise<Provider | null> {
|
|
93
|
+
return orNull(
|
|
94
|
+
client
|
|
95
|
+
.GET('/{network}/providers/{providerId}', {
|
|
96
|
+
params: { path: { network, providerId: providerId.toString() } },
|
|
97
|
+
})
|
|
98
|
+
.then((result) => unwrap(result).data)
|
|
99
|
+
)
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/** List every provider matching the filters. */
|
|
103
|
+
export function listProviders(
|
|
104
|
+
{ client, network }: IndexerApi,
|
|
105
|
+
query: { active?: boolean; approved?: boolean; endorsed?: boolean } = {}
|
|
106
|
+
): Promise<Provider[]> {
|
|
107
|
+
return collect(
|
|
108
|
+
paginate((cursor) =>
|
|
109
|
+
client
|
|
110
|
+
.GET('/{network}/providers', {
|
|
111
|
+
params: {
|
|
112
|
+
path: { network },
|
|
113
|
+
query: {
|
|
114
|
+
limit: MAX_PAGE_SIZE,
|
|
115
|
+
cursor,
|
|
116
|
+
active: bool(query.active),
|
|
117
|
+
approved: bool(query.approved),
|
|
118
|
+
endorsed: bool(query.endorsed),
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
})
|
|
122
|
+
.then(unwrap)
|
|
123
|
+
)
|
|
124
|
+
)
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/** Get a data set by ID, or `null` when it does not exist. */
|
|
128
|
+
export function getDataSet({ client, network }: IndexerApi, dataSetId: bigint): Promise<DataSet | null> {
|
|
129
|
+
return orNull(
|
|
130
|
+
client
|
|
131
|
+
.GET('/{network}/data-sets/{dataSetId}', {
|
|
132
|
+
params: { path: { network, dataSetId: dataSetId.toString() } },
|
|
133
|
+
})
|
|
134
|
+
.then((result) => unwrap(result).data)
|
|
135
|
+
)
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/** List every data set matching the filters, newest ID first. */
|
|
139
|
+
export function listDataSets(
|
|
140
|
+
{ client, network }: IndexerApi,
|
|
141
|
+
query: { owner?: string; providerId?: bigint; deleted?: boolean; withCdn?: boolean }
|
|
142
|
+
): Promise<DataSet[]> {
|
|
143
|
+
return collect(
|
|
144
|
+
paginate((cursor) =>
|
|
145
|
+
client
|
|
146
|
+
.GET('/{network}/data-sets', {
|
|
147
|
+
params: {
|
|
148
|
+
path: { network },
|
|
149
|
+
query: {
|
|
150
|
+
limit: MAX_PAGE_SIZE,
|
|
151
|
+
cursor,
|
|
152
|
+
owner: query.owner,
|
|
153
|
+
provider_id: query.providerId?.toString(),
|
|
154
|
+
deleted: bool(query.deleted),
|
|
155
|
+
with_cdn: bool(query.withCdn),
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
})
|
|
159
|
+
.then(unwrap)
|
|
160
|
+
)
|
|
161
|
+
)
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/** Walk the pieces of one data set page by page, newest piece ID first. */
|
|
165
|
+
export function dataSetPiecePages(
|
|
166
|
+
{ client, network }: IndexerApi,
|
|
167
|
+
dataSetId: bigint,
|
|
168
|
+
query: { removed?: boolean } = {}
|
|
169
|
+
): AsyncGenerator<Piece[]> {
|
|
170
|
+
return paginate((cursor) =>
|
|
171
|
+
client
|
|
172
|
+
.GET('/{network}/data-sets/{dataSetId}/pieces', {
|
|
173
|
+
params: {
|
|
174
|
+
path: { network, dataSetId: dataSetId.toString() },
|
|
175
|
+
query: { limit: MAX_PAGE_SIZE, cursor, removed: bool(query.removed) },
|
|
176
|
+
},
|
|
177
|
+
})
|
|
178
|
+
.then(unwrap)
|
|
179
|
+
)
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/** List every piece in one data set, newest piece ID first. */
|
|
183
|
+
export function listDataSetPieces(
|
|
184
|
+
api: IndexerApi,
|
|
185
|
+
dataSetId: bigint,
|
|
186
|
+
query: { removed?: boolean } = {}
|
|
187
|
+
): Promise<Piece[]> {
|
|
188
|
+
return collect(dataSetPiecePages(api, dataSetId, query))
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Walk the pieces of every data set a provider stores, page by page, newest data set and piece
|
|
193
|
+
* first. One walk covers all of the provider's data sets.
|
|
194
|
+
*/
|
|
195
|
+
export function providerPiecePages(
|
|
196
|
+
{ client, network }: IndexerApi,
|
|
197
|
+
providerId: bigint,
|
|
198
|
+
query: { removed?: boolean } = {}
|
|
199
|
+
): AsyncGenerator<PieceWithDataSet[]> {
|
|
200
|
+
return paginate((cursor) =>
|
|
201
|
+
client
|
|
202
|
+
.GET('/{network}/pieces', {
|
|
203
|
+
params: {
|
|
204
|
+
path: { network },
|
|
205
|
+
query: { limit: MAX_PAGE_SIZE, cursor, provider_id: providerId.toString(), removed: bool(query.removed) },
|
|
206
|
+
},
|
|
207
|
+
})
|
|
208
|
+
.then(unwrap)
|
|
209
|
+
)
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/** Encode an optional boolean filter as a query string value. */
|
|
213
|
+
function bool(value: boolean | undefined): 'true' | 'false' | undefined {
|
|
214
|
+
return value === undefined ? undefined : value ? 'true' : 'false'
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/** Convert API piece metadata to the string record stored on local operations. */
|
|
218
|
+
export function toStringMetadata(metadata: Record<string, unknown> | null): Record<string, string> {
|
|
219
|
+
return Object.fromEntries(Object.entries(metadata ?? {}).map(([key, value]) => [key, String(value)]))
|
|
220
|
+
}
|