@storagehub/api-augment 0.1.0 → 0.2.1
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/LICENSE +674 -0
- package/biome.json +2 -9
- package/dist/parachain/index.js.map +1 -0
- package/dist/parachain/interfaces/augment-api-consts.js.map +1 -0
- package/dist/parachain/interfaces/augment-api-errors.js.map +1 -0
- package/dist/parachain/interfaces/augment-api-events.js.map +1 -0
- package/dist/parachain/interfaces/augment-api-query.js.map +1 -0
- package/dist/parachain/interfaces/augment-api-rpc.js.map +1 -0
- package/dist/parachain/interfaces/augment-api-runtime.js.map +1 -0
- package/dist/parachain/interfaces/augment-api-tx.js.map +1 -0
- package/dist/parachain/interfaces/augment-api.js.map +1 -0
- package/dist/parachain/interfaces/augment-types.js.map +1 -0
- package/dist/parachain/interfaces/definitions.js.map +1 -0
- package/dist/parachain/interfaces/index.js.map +1 -0
- package/dist/{interfaces → parachain/interfaces}/lookup.js +1465 -813
- package/dist/parachain/interfaces/lookup.js.map +1 -0
- package/dist/parachain/interfaces/registry.js.map +1 -0
- package/dist/parachain/interfaces/storagehubclient/definitions.js +7 -0
- package/dist/parachain/interfaces/storagehubclient/definitions.js.map +1 -0
- package/dist/parachain/interfaces/storagehubclient/index.js.map +1 -0
- package/dist/parachain/interfaces/storagehubclient/runtime.js.map +1 -0
- package/dist/parachain/interfaces/storagehubclient/types.js.map +1 -0
- package/dist/parachain/interfaces/types-lookup.js.map +1 -0
- package/dist/parachain/interfaces/types.js.map +1 -0
- package/dist/solochain-evm/index.js +4 -0
- package/dist/solochain-evm/index.js.map +1 -0
- package/dist/solochain-evm/interfaces/augment-api-consts.js +6 -0
- package/dist/solochain-evm/interfaces/augment-api-consts.js.map +1 -0
- package/dist/solochain-evm/interfaces/augment-api-errors.js +6 -0
- package/dist/solochain-evm/interfaces/augment-api-errors.js.map +1 -0
- package/dist/solochain-evm/interfaces/augment-api-events.js +6 -0
- package/dist/solochain-evm/interfaces/augment-api-events.js.map +1 -0
- package/dist/solochain-evm/interfaces/augment-api-query.js +6 -0
- package/dist/solochain-evm/interfaces/augment-api-query.js.map +1 -0
- package/dist/solochain-evm/interfaces/augment-api-rpc.js +6 -0
- package/dist/solochain-evm/interfaces/augment-api-rpc.js.map +1 -0
- package/dist/solochain-evm/interfaces/augment-api-runtime.js +6 -0
- package/dist/solochain-evm/interfaces/augment-api-runtime.js.map +1 -0
- package/dist/solochain-evm/interfaces/augment-api-tx.js +6 -0
- package/dist/solochain-evm/interfaces/augment-api-tx.js.map +1 -0
- package/dist/solochain-evm/interfaces/augment-api.js +10 -0
- package/dist/solochain-evm/interfaces/augment-api.js.map +1 -0
- package/dist/solochain-evm/interfaces/augment-types.js +6 -0
- package/dist/solochain-evm/interfaces/augment-types.js.map +1 -0
- package/dist/solochain-evm/interfaces/definitions.js +2 -0
- package/dist/solochain-evm/interfaces/definitions.js.map +1 -0
- package/dist/solochain-evm/interfaces/index.js +4 -0
- package/dist/solochain-evm/interfaces/index.js.map +1 -0
- package/dist/solochain-evm/interfaces/lookup.js +3744 -0
- package/dist/solochain-evm/interfaces/lookup.js.map +1 -0
- package/dist/solochain-evm/interfaces/registry.js +6 -0
- package/dist/solochain-evm/interfaces/registry.js.map +1 -0
- package/dist/solochain-evm/interfaces/storagehubclient/definitions.js +7 -0
- package/dist/solochain-evm/interfaces/storagehubclient/definitions.js.map +1 -0
- package/dist/solochain-evm/interfaces/storagehubclient/index.js +4 -0
- package/dist/solochain-evm/interfaces/storagehubclient/index.js.map +1 -0
- package/dist/solochain-evm/interfaces/storagehubclient/types.js +4 -0
- package/dist/solochain-evm/interfaces/storagehubclient/types.js.map +1 -0
- package/dist/solochain-evm/interfaces/types-lookup.js +6 -0
- package/dist/solochain-evm/interfaces/types-lookup.js.map +1 -0
- package/dist/solochain-evm/interfaces/types.js +4 -0
- package/dist/solochain-evm/interfaces/types.js.map +1 -0
- package/dist/types/{interfaces → parachain/interfaces}/augment-api-consts.d.ts +147 -20
- package/dist/types/{interfaces → parachain/interfaces}/augment-api-errors.d.ts +235 -8
- package/dist/types/{interfaces → parachain/interfaces}/augment-api-events.d.ts +542 -118
- package/dist/types/{interfaces → parachain/interfaces}/augment-api-query.d.ts +208 -118
- package/dist/types/{interfaces → parachain/interfaces}/augment-api-rpc.d.ts +61 -4
- package/dist/types/{interfaces → parachain/interfaces}/augment-api-runtime.d.ts +97 -8
- package/dist/types/{interfaces → parachain/interfaces}/augment-api-tx.d.ts +356 -181
- package/dist/types/{interfaces → parachain/interfaces}/augment-types.d.ts +144 -11
- package/dist/types/{interfaces → parachain/interfaces}/lookup.d.ts +1067 -513
- package/dist/types/parachain/interfaces/registry.d.ts +311 -0
- package/dist/types/{interfaces → parachain/interfaces}/storagehubclient/types.d.ts +129 -18
- package/dist/types/{interfaces → parachain/interfaces}/types-lookup.d.ts +1619 -887
- package/dist/types/solochain-evm/interfaces/augment-api-consts.d.ts +641 -0
- package/dist/types/solochain-evm/interfaces/augment-api-errors.d.ts +1260 -0
- package/dist/types/solochain-evm/interfaces/augment-api-events.d.ts +2058 -0
- package/dist/types/solochain-evm/interfaces/augment-api-query.d.ts +1317 -0
- package/dist/types/solochain-evm/interfaces/augment-api-rpc.d.ts +775 -0
- package/dist/types/solochain-evm/interfaces/augment-api-runtime.d.ts +535 -0
- package/dist/types/solochain-evm/interfaces/augment-api-tx.d.ts +2381 -0
- package/dist/types/solochain-evm/interfaces/augment-api.d.ts +7 -0
- package/dist/types/solochain-evm/interfaces/augment-types.d.ts +1418 -0
- package/dist/types/solochain-evm/interfaces/index.d.ts +1 -0
- package/dist/types/solochain-evm/interfaces/lookup.d.ts +3363 -0
- package/dist/types/solochain-evm/interfaces/registry.d.ts +252 -0
- package/dist/types/solochain-evm/interfaces/storagehubclient/definitions.d.ts +6 -0
- package/dist/types/solochain-evm/interfaces/storagehubclient/index.d.ts +1 -0
- package/dist/types/solochain-evm/interfaces/storagehubclient/types.d.ts +319 -0
- package/dist/types/solochain-evm/interfaces/types-lookup.d.ts +3577 -0
- package/dist/types/solochain-evm/interfaces/types.d.ts +1 -0
- package/metadata-sh-parachain.json +5 -0
- package/metadata-sh-solochain-evm.json +5 -0
- package/package.json +41 -26
- package/scripts/scrapeMetadata.ts +41 -29
- package/src/parachain/index.ts +3 -0
- package/src/{interfaces → parachain/interfaces}/augment-api-consts.ts +147 -20
- package/src/{interfaces → parachain/interfaces}/augment-api-errors.ts +235 -8
- package/src/{interfaces → parachain/interfaces}/augment-api-events.ts +527 -137
- package/src/{interfaces → parachain/interfaces}/augment-api-query.ts +272 -145
- package/src/{interfaces → parachain/interfaces}/augment-api-rpc.ts +123 -5
- package/src/{interfaces → parachain/interfaces}/augment-api-runtime.ts +183 -8
- package/src/{interfaces → parachain/interfaces}/augment-api-tx.ts +374 -182
- package/src/{interfaces → parachain/interfaces}/augment-types.ts +278 -12
- package/src/parachain/interfaces/definitions.ts +1 -0
- package/src/{interfaces → parachain/interfaces}/lookup.ts +1497 -813
- package/src/{interfaces → parachain/interfaces}/registry.ts +176 -98
- package/src/parachain/interfaces/storagehubclient/definitions.ts +7 -0
- package/src/{interfaces → parachain/interfaces}/storagehubclient/types.ts +158 -18
- package/src/{interfaces → parachain/interfaces}/types-lookup.ts +1970 -896
- package/src/solochain-evm/index.ts +3 -0
- package/src/solochain-evm/interfaces/augment-api-consts.ts +655 -0
- package/src/solochain-evm/interfaces/augment-api-errors.ts +1268 -0
- package/src/solochain-evm/interfaces/augment-api-events.ts +1813 -0
- package/src/solochain-evm/interfaces/augment-api-query.ts +1838 -0
- package/src/solochain-evm/interfaces/augment-api-rpc.ts +1319 -0
- package/src/solochain-evm/interfaces/augment-api-runtime.ts +958 -0
- package/src/solochain-evm/interfaces/augment-api-tx.ts +2818 -0
- package/src/solochain-evm/interfaces/augment-api.ts +10 -0
- package/src/solochain-evm/interfaces/augment-types.ts +2774 -0
- package/src/solochain-evm/interfaces/definitions.ts +1 -0
- package/src/solochain-evm/interfaces/index.ts +4 -0
- package/src/solochain-evm/interfaces/lookup.ts +3788 -0
- package/src/solochain-evm/interfaces/registry.ts +506 -0
- package/src/solochain-evm/interfaces/storagehubclient/definitions.ts +7 -0
- package/src/solochain-evm/interfaces/storagehubclient/index.ts +4 -0
- package/src/solochain-evm/interfaces/storagehubclient/types.ts +391 -0
- package/src/solochain-evm/interfaces/types-lookup.ts +4616 -0
- package/src/solochain-evm/interfaces/types.ts +4 -0
- package/tsconfig.json +17 -20
- package/tsconfig.parachain.json +17 -0
- package/tsconfig.solochain-evm.json +17 -0
- package/tsconfig.tsbuildinfo +1 -0
- package/dist/index.js.map +0 -1
- package/dist/interfaces/augment-api-consts.js.map +0 -1
- package/dist/interfaces/augment-api-errors.js.map +0 -1
- package/dist/interfaces/augment-api-events.js.map +0 -1
- package/dist/interfaces/augment-api-query.js.map +0 -1
- package/dist/interfaces/augment-api-rpc.js.map +0 -1
- package/dist/interfaces/augment-api-runtime.js.map +0 -1
- package/dist/interfaces/augment-api-tx.js.map +0 -1
- package/dist/interfaces/augment-api.js.map +0 -1
- package/dist/interfaces/augment-types.js.map +0 -1
- package/dist/interfaces/definitions.js.map +0 -1
- package/dist/interfaces/index.js.map +0 -1
- package/dist/interfaces/lookup.js.map +0 -1
- package/dist/interfaces/registry.js.map +0 -1
- package/dist/interfaces/storagehubclient/definitions.js +0 -7
- package/dist/interfaces/storagehubclient/definitions.js.map +0 -1
- package/dist/interfaces/storagehubclient/index.js.map +0 -1
- package/dist/interfaces/storagehubclient/runtime.js.map +0 -1
- package/dist/interfaces/storagehubclient/types.js.map +0 -1
- package/dist/interfaces/types-lookup.js.map +0 -1
- package/dist/interfaces/types.js.map +0 -1
- package/dist/types/interfaces/registry.d.ts +0 -272
- package/src/interfaces/storagehubclient/definitions.ts +0 -7
- package/storagehub.json +0 -1
- /package/dist/{index.js → parachain/index.js} +0 -0
- /package/dist/{interfaces → parachain/interfaces}/augment-api-consts.js +0 -0
- /package/dist/{interfaces → parachain/interfaces}/augment-api-errors.js +0 -0
- /package/dist/{interfaces → parachain/interfaces}/augment-api-events.js +0 -0
- /package/dist/{interfaces → parachain/interfaces}/augment-api-query.js +0 -0
- /package/dist/{interfaces → parachain/interfaces}/augment-api-rpc.js +0 -0
- /package/dist/{interfaces → parachain/interfaces}/augment-api-runtime.js +0 -0
- /package/dist/{interfaces → parachain/interfaces}/augment-api-tx.js +0 -0
- /package/dist/{interfaces → parachain/interfaces}/augment-api.js +0 -0
- /package/dist/{interfaces → parachain/interfaces}/augment-types.js +0 -0
- /package/dist/{interfaces → parachain/interfaces}/definitions.js +0 -0
- /package/dist/{interfaces → parachain/interfaces}/index.js +0 -0
- /package/dist/{interfaces → parachain/interfaces}/registry.js +0 -0
- /package/dist/{interfaces → parachain/interfaces}/storagehubclient/index.js +0 -0
- /package/dist/{interfaces → parachain/interfaces}/storagehubclient/runtime.js +0 -0
- /package/dist/{interfaces → parachain/interfaces}/storagehubclient/types.js +0 -0
- /package/dist/{interfaces → parachain/interfaces}/types-lookup.js +0 -0
- /package/dist/{interfaces → parachain/interfaces}/types.js +0 -0
- /package/dist/types/{index.d.ts → parachain/index.d.ts} +0 -0
- /package/dist/types/{interfaces → parachain/interfaces}/augment-api.d.ts +0 -0
- /package/dist/types/{interfaces → parachain/interfaces}/definitions.d.ts +0 -0
- /package/dist/types/{interfaces → parachain/interfaces}/index.d.ts +0 -0
- /package/dist/types/{interfaces → parachain/interfaces}/storagehubclient/definitions.d.ts +0 -0
- /package/dist/types/{interfaces → parachain/interfaces}/storagehubclient/index.d.ts +0 -0
- /package/dist/types/{interfaces → parachain/interfaces}/storagehubclient/runtime.d.ts +0 -0
- /package/dist/types/{interfaces → parachain/interfaces}/types.d.ts +0 -0
- /package/{src/index.ts → dist/types/solochain-evm/index.d.ts} +0 -0
- /package/{src/interfaces/definitions.ts → dist/types/solochain-evm/interfaces/definitions.d.ts} +0 -0
- /package/src/{interfaces → parachain/interfaces}/augment-api.ts +0 -0
- /package/src/{interfaces → parachain/interfaces}/index.ts +0 -0
- /package/src/{interfaces → parachain/interfaces}/storagehubclient/index.ts +0 -0
- /package/src/{interfaces → parachain/interfaces}/storagehubclient/runtime.ts +0 -0
- /package/src/{interfaces → parachain/interfaces}/types.ts +0 -0
package/package.json
CHANGED
|
@@ -1,38 +1,53 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storagehub/api-augment",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "",
|
|
5
|
-
"scripts": {
|
|
6
|
-
"scrape": "pnpm tsx scripts/scrapeMetadata.ts",
|
|
7
|
-
"fmt": "biome format .",
|
|
8
|
-
"fmt:fix": "biome format . --write",
|
|
9
|
-
"tsc": "tsc --noEmit --pretty",
|
|
10
|
-
"build": "tsc -b --verbose",
|
|
11
|
-
"generate:all": "pnpm generate:defs && pnpm generate:meta",
|
|
12
|
-
"generate:defs": "pnpm tsx node_modules/@polkadot/typegen/scripts/polkadot-types-from-defs.mjs --package @storagehub/api-augment/interfaces --input ./src/interfaces --endpoint ./storagehub.json",
|
|
13
|
-
"generate:meta": "pnpm tsx node_modules/@polkadot/typegen/scripts/polkadot-types-from-chain.mjs --package @storagehub/api-augment/interfaces --endpoint ./storagehub.json --output ./src/interfaces"
|
|
14
|
-
},
|
|
15
5
|
"keywords": [],
|
|
16
6
|
"author": "",
|
|
17
|
-
"module": "./dist/index.js",
|
|
18
|
-
"
|
|
7
|
+
"module": "./dist/parachain/index.js",
|
|
8
|
+
"type": "module",
|
|
9
|
+
"types": "./dist/types/parachain/index.d.ts",
|
|
19
10
|
"exports": {
|
|
20
11
|
".": {
|
|
21
|
-
"types": "./dist/types/index.d.ts",
|
|
22
|
-
"module": "./dist/index.js",
|
|
23
|
-
"default": "./dist/index.js"
|
|
12
|
+
"types": "./dist/types/parachain/index.d.ts",
|
|
13
|
+
"module": "./dist/parachain/index.js",
|
|
14
|
+
"default": "./dist/parachain/index.js"
|
|
15
|
+
},
|
|
16
|
+
"./parachain": {
|
|
17
|
+
"types": "./dist/types/parachain/index.d.ts",
|
|
18
|
+
"module": "./dist/parachain/index.js",
|
|
19
|
+
"default": "./dist/parachain/index.js"
|
|
20
|
+
},
|
|
21
|
+
"./solochain-evm": {
|
|
22
|
+
"types": "./dist/types/solochain-evm/index.d.ts",
|
|
23
|
+
"module": "./dist/solochain-evm/index.js",
|
|
24
|
+
"default": "./dist/solochain-evm/index.js"
|
|
24
25
|
}
|
|
25
26
|
},
|
|
26
27
|
"license": "ISC",
|
|
27
28
|
"dependencies": {
|
|
28
|
-
"@polkadot/api": "
|
|
29
|
-
"@polkadot/api-base": "
|
|
30
|
-
"@polkadot/rpc-core": "
|
|
31
|
-
"@polkadot/typegen": "
|
|
32
|
-
"@polkadot/types": "
|
|
33
|
-
"@polkadot/types-codec": "
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
29
|
+
"@polkadot/api": "^16.4.7",
|
|
30
|
+
"@polkadot/api-base": "^16.4.7",
|
|
31
|
+
"@polkadot/rpc-core": "^16.4.7",
|
|
32
|
+
"@polkadot/typegen": "^16.4.7",
|
|
33
|
+
"@polkadot/types": "^16.4.7",
|
|
34
|
+
"@polkadot/types-codec": "^16.4.7",
|
|
35
|
+
"tsx": "4.20.5",
|
|
36
|
+
"typescript": "^5.9.2",
|
|
37
|
+
"@storagehub/types-bundle": "0.2.1"
|
|
38
|
+
},
|
|
39
|
+
"scripts": {
|
|
40
|
+
"scrape": "pnpm tsx scripts/scrapeMetadata.ts",
|
|
41
|
+
"fmt": "biome format .",
|
|
42
|
+
"fmt:fix": "biome format . --write",
|
|
43
|
+
"tsc": "tsc --noEmit --pretty",
|
|
44
|
+
"build": "tsc -p tsconfig.parachain.json && tsc -p tsconfig.solochain-evm.json",
|
|
45
|
+
"generate:all": "pnpm generate:defs && pnpm generate:meta",
|
|
46
|
+
"generate:defs": "pnpm generate:defs:parachain && pnpm generate:defs:solochain-evm",
|
|
47
|
+
"generate:meta": "pnpm generate:meta:parachain && pnpm generate:meta:solochain-evm",
|
|
48
|
+
"generate:defs:parachain": "pnpm tsx node_modules/@polkadot/typegen/scripts/polkadot-types-from-defs.mjs --package @storagehub/api-augment/parachain/interfaces --input ./src/parachain/interfaces --endpoint ./metadata-sh-parachain.json",
|
|
49
|
+
"generate:meta:parachain": "pnpm tsx node_modules/@polkadot/typegen/scripts/polkadot-types-from-chain.mjs --package @storagehub/api-augment/parachain/interfaces --endpoint ./metadata-sh-parachain.json --output ./src/parachain/interfaces",
|
|
50
|
+
"generate:defs:solochain-evm": "pnpm tsx node_modules/@polkadot/typegen/scripts/polkadot-types-from-defs.mjs --package @storagehub/api-augment/solochain-evm/interfaces --input ./src/solochain-evm/interfaces --endpoint ./metadata-sh-solochain-evm.json",
|
|
51
|
+
"generate:meta:solochain-evm": "pnpm tsx node_modules/@polkadot/typegen/scripts/polkadot-types-from-chain.mjs --package @storagehub/api-augment/solochain-evm/interfaces --endpoint ./metadata-sh-solochain-evm.json --output ./src/solochain-evm/interfaces"
|
|
37
52
|
}
|
|
38
|
-
}
|
|
53
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import fs from "node:fs";
|
|
2
1
|
import { execSync, spawn } from "node:child_process";
|
|
2
|
+
import fs from "node:fs";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
|
|
5
5
|
const fetchMetadata = async () => {
|
|
@@ -37,41 +37,53 @@ const fetchMetadata = async () => {
|
|
|
37
37
|
throw new Error("Error fetching metadata");
|
|
38
38
|
};
|
|
39
39
|
|
|
40
|
+
const runCombination = async (metadataPath: string, dockerComposePath: string) => {
|
|
41
|
+
console.log(`\n=== Starting container for compose: ${dockerComposePath} ===`);
|
|
42
|
+
try {
|
|
43
|
+
// Start services in background
|
|
44
|
+
spawn(
|
|
45
|
+
"docker",
|
|
46
|
+
["compose", "-f", dockerComposePath, "up", "-d", "--remove-orphans", "--renew-anon-volumes"],
|
|
47
|
+
{ stdio: "inherit" }
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
const metadata = await fetchMetadata();
|
|
51
|
+
const jsonResponse = await new Response(metadata).json();
|
|
52
|
+
fs.writeFileSync(metadataPath, JSON.stringify(jsonResponse, null, 2));
|
|
53
|
+
console.log("✅ Metadata file written to:", metadataPath);
|
|
54
|
+
} finally {
|
|
55
|
+
try {
|
|
56
|
+
execSync(`docker compose -f=${dockerComposePath} down --remove-orphans --volumes`, {
|
|
57
|
+
stdio: "inherit"
|
|
58
|
+
});
|
|
59
|
+
} catch (e) {
|
|
60
|
+
console.warn("⚠️ Error bringing docker compose down:", e);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
|
|
40
65
|
async function main() {
|
|
41
66
|
const nodePath = path.join(process.cwd(), "..", "target", "release", "storage-hub-node");
|
|
42
|
-
const
|
|
67
|
+
const metadataPaths = [
|
|
68
|
+
path.join(process.cwd(), "metadata-sh-parachain.json"),
|
|
69
|
+
path.join(process.cwd(), "metadata-sh-solochain-evm.json")
|
|
70
|
+
];
|
|
71
|
+
const dockerComposePaths = [
|
|
72
|
+
path.join(process.cwd(), "..", "docker", "local-parachain-compose.yml"),
|
|
73
|
+
path.join(process.cwd(), "..", "docker", "local-solochain-evm-compose.yml")
|
|
74
|
+
];
|
|
43
75
|
|
|
44
76
|
if (!fs.existsSync(nodePath)) {
|
|
45
77
|
console.error("Storage Hub Node not found at path: ", nodePath);
|
|
46
78
|
throw new Error("File not found");
|
|
47
79
|
}
|
|
48
80
|
|
|
49
|
-
//
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
[
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
"up",
|
|
56
|
-
"--remove-orphans",
|
|
57
|
-
"--renew-anon-volumes"
|
|
58
|
-
],
|
|
59
|
-
{
|
|
60
|
-
stdio: "inherit"
|
|
61
|
-
}
|
|
62
|
-
);
|
|
63
|
-
|
|
64
|
-
const metadata = await fetchMetadata();
|
|
65
|
-
fs.writeFileSync(metadataPath, Buffer.from(metadata));
|
|
66
|
-
|
|
67
|
-
console.log("✅ Metadata file written to:", metadataPath);
|
|
81
|
+
// Run sequentially for each combination
|
|
82
|
+
for (let index = 0; index < metadataPaths.length; index++) {
|
|
83
|
+
const metadataPath = metadataPaths[index];
|
|
84
|
+
const dockerComposePath = dockerComposePaths[index];
|
|
85
|
+
await runCombination(metadataPath, dockerComposePath);
|
|
86
|
+
}
|
|
68
87
|
}
|
|
69
88
|
|
|
70
|
-
main()
|
|
71
|
-
.catch((error) => {
|
|
72
|
-
console.error(error);
|
|
73
|
-
process.exitCode = 1;
|
|
74
|
-
})
|
|
75
|
-
.finally(() => {
|
|
76
|
-
execSync("docker compose -f=../docker/local-node-compose.yml down --remove-orphans --volumes");
|
|
77
|
-
});
|
|
89
|
+
await main();
|
|
@@ -70,28 +70,53 @@ declare module "@polkadot/api-base/types/consts" {
|
|
|
70
70
|
};
|
|
71
71
|
fileSystem: {
|
|
72
72
|
/**
|
|
73
|
-
*
|
|
73
|
+
* Base deposit held from the User when creating a new storage request. The actual deposit held is this amount
|
|
74
|
+
* plus the amount required to pay for all BSP's `bsp_volunteer` extrinsic.
|
|
74
75
|
**/
|
|
75
|
-
|
|
76
|
+
baseStorageRequestCreationDeposit: u128 & AugmentedConst<ApiType>;
|
|
77
|
+
/**
|
|
78
|
+
* Basic security replication target for a new storage request.
|
|
79
|
+
*
|
|
80
|
+
* This should be high enough so that it gives users a ~1% chance of their file
|
|
81
|
+
* being controlled by a single malicious entity under certain network conditions.
|
|
82
|
+
*
|
|
83
|
+
* For more details, see [crate::types::ReplicationTarget].
|
|
84
|
+
**/
|
|
85
|
+
basicReplicationTarget: u32 & AugmentedConst<ApiType>;
|
|
76
86
|
/**
|
|
77
|
-
*
|
|
87
|
+
* Penalty paid by a BSP when they forcefully stop storing a file.
|
|
78
88
|
**/
|
|
79
|
-
|
|
89
|
+
bspStopStoringFilePenalty: u128 & AugmentedConst<ApiType>;
|
|
80
90
|
/**
|
|
81
|
-
*
|
|
91
|
+
* The deposit paid by a user to create a new file deletion request.
|
|
82
92
|
*
|
|
83
|
-
* This
|
|
84
|
-
*
|
|
93
|
+
* This deposit gets returned to the user when the MSP submits an inclusion proof of the file to
|
|
94
|
+
* confirm its deletion, but gets sent to the MSP if the MSP did not actually had the file and
|
|
95
|
+
* sends a non-inclusion proof instead. This is done to prevent users being able to spam MSPs
|
|
96
|
+
* with malicious file deletion requests.
|
|
85
97
|
**/
|
|
86
|
-
|
|
98
|
+
fileDeletionRequestDeposit: u128 & AugmentedConst<ApiType>;
|
|
99
|
+
/**
|
|
100
|
+
* High security replication target for a new storage request.
|
|
101
|
+
*
|
|
102
|
+
* This should be high enough so that it gives users a ~0.01% chance of their file
|
|
103
|
+
* being controlled by a single malicious entity under certain network conditions.
|
|
104
|
+
*
|
|
105
|
+
* For more details, see [crate::types::ReplicationTarget].
|
|
106
|
+
**/
|
|
107
|
+
highSecurityReplicationTarget: u32 & AugmentedConst<ApiType>;
|
|
108
|
+
/**
|
|
109
|
+
* Maximum batch of storage requests that can be confirmed at once when calling `bsp_confirm_storing`.
|
|
110
|
+
**/
|
|
111
|
+
maxBatchConfirmStorageRequests: u32 & AugmentedConst<ApiType>;
|
|
87
112
|
/**
|
|
88
113
|
* Maximum number of multiaddresses for a storage request.
|
|
89
114
|
**/
|
|
90
115
|
maxDataServerMultiAddresses: u32 & AugmentedConst<ApiType>;
|
|
91
116
|
/**
|
|
92
|
-
* Maximum number of expired items (per type) to clean up in a single
|
|
117
|
+
* Maximum number of expired items (per type) to clean up in a single tick.
|
|
93
118
|
**/
|
|
94
|
-
|
|
119
|
+
maxExpiredItemsInTick: u32 & AugmentedConst<ApiType>;
|
|
95
120
|
/**
|
|
96
121
|
* Maximum byte size of a file path.
|
|
97
122
|
**/
|
|
@@ -104,6 +129,10 @@ declare module "@polkadot/api-base/types/consts" {
|
|
|
104
129
|
* Maximum byte size of a peer id.
|
|
105
130
|
**/
|
|
106
131
|
maxPeerIdSize: u32 & AugmentedConst<ApiType>;
|
|
132
|
+
/**
|
|
133
|
+
* Maximum replication target that a user can select for a new storage request.
|
|
134
|
+
**/
|
|
135
|
+
maxReplicationTarget: u32 & AugmentedConst<ApiType>;
|
|
107
136
|
/**
|
|
108
137
|
* Maximum number of file deletion requests a user can have pending.
|
|
109
138
|
**/
|
|
@@ -113,7 +142,7 @@ declare module "@polkadot/api-base/types/consts" {
|
|
|
113
142
|
**/
|
|
114
143
|
maxUserPendingMoveBucketRequests: u32 & AugmentedConst<ApiType>;
|
|
115
144
|
/**
|
|
116
|
-
* Number of
|
|
145
|
+
* Number of ticks required to pass between a BSP requesting to stop storing a file and it being able to confirm to stop storing it.
|
|
117
146
|
**/
|
|
118
147
|
minWaitForStopStoring: u32 & AugmentedConst<ApiType>;
|
|
119
148
|
/**
|
|
@@ -121,13 +150,60 @@ declare module "@polkadot/api-base/types/consts" {
|
|
|
121
150
|
**/
|
|
122
151
|
moveBucketRequestTtl: u32 & AugmentedConst<ApiType>;
|
|
123
152
|
/**
|
|
124
|
-
*
|
|
153
|
+
* Standard security replication target for a new storage request.
|
|
154
|
+
*
|
|
155
|
+
* This should be high enough so that it gives users a ~0.1% chance of their file
|
|
156
|
+
* being controlled by a single malicious entity under certain network conditions.
|
|
157
|
+
*
|
|
158
|
+
* For more details, see [crate::types::ReplicationTarget].
|
|
125
159
|
**/
|
|
126
|
-
|
|
160
|
+
standardReplicationTarget: u32 & AugmentedConst<ApiType>;
|
|
127
161
|
/**
|
|
128
162
|
* Time-to-live for a storage request.
|
|
129
163
|
**/
|
|
130
164
|
storageRequestTtl: u32 & AugmentedConst<ApiType>;
|
|
165
|
+
/**
|
|
166
|
+
* Super high security replication target for a new storage request.
|
|
167
|
+
*
|
|
168
|
+
* This should be high enough so that it gives users a ~0.001% chance of their file
|
|
169
|
+
* being controlled by a single malicious entity under certain network conditions.
|
|
170
|
+
*
|
|
171
|
+
* For more details, see [crate::types::ReplicationTarget].
|
|
172
|
+
**/
|
|
173
|
+
superHighSecurityReplicationTarget: u32 & AugmentedConst<ApiType>;
|
|
174
|
+
/**
|
|
175
|
+
* The amount of ticks that have to pass for the threshold to volunteer for a specific storage request
|
|
176
|
+
* to arrive at its maximum value.
|
|
177
|
+
**/
|
|
178
|
+
tickRangeToMaximumThreshold: u32 & AugmentedConst<ApiType>;
|
|
179
|
+
/**
|
|
180
|
+
* The treasury account of the runtime, where a fraction of each payment goes.
|
|
181
|
+
**/
|
|
182
|
+
treasuryAccount: AccountId32 & AugmentedConst<ApiType>;
|
|
183
|
+
/**
|
|
184
|
+
* Ultra high security replication target for a new storage request.
|
|
185
|
+
*
|
|
186
|
+
* This should be high enough so that it gives users a ~0.0001% chance of their file
|
|
187
|
+
* being controlled by a single malicious entity under certain network conditions.
|
|
188
|
+
*
|
|
189
|
+
* For more details, see [crate::types::ReplicationTarget].
|
|
190
|
+
**/
|
|
191
|
+
ultraHighSecurityReplicationTarget: u32 & AugmentedConst<ApiType>;
|
|
192
|
+
/**
|
|
193
|
+
* The amount of ticks that the user has to pay upfront when issuing a storage request.
|
|
194
|
+
*
|
|
195
|
+
* This is to compensate the system load that the process of file retrieval will have on the network.
|
|
196
|
+
* If this did not exist, a malicious user could spam the network with huge files, making BSPs change
|
|
197
|
+
* their capacity and download a lot of data while the user might not even have the balance to
|
|
198
|
+
* store and pay those BSPs in the long term.
|
|
199
|
+
*
|
|
200
|
+
* It initially exists as a deterrent, since these funds will be transferred to the treasury and not to the BSPs
|
|
201
|
+
* of the network. Governance can then decide what to do with these funds.
|
|
202
|
+
*
|
|
203
|
+
* The amount that the user is going to have to pay is calculated as follows:
|
|
204
|
+
* `Replication Target Chosen * PricePerGigaUnitPerTick * File Size in Gigabytes * UpfrontTicksToPay`
|
|
205
|
+
**/
|
|
206
|
+
upfrontTicksToPay: u32 & AugmentedConst<ApiType>;
|
|
131
207
|
/**
|
|
132
208
|
* Generic const
|
|
133
209
|
**/
|
|
@@ -244,14 +320,27 @@ declare module "@polkadot/api-base/types/consts" {
|
|
|
244
320
|
[key: string]: Codec;
|
|
245
321
|
};
|
|
246
322
|
paymentStreams: {
|
|
323
|
+
/**
|
|
324
|
+
* The base deposit for a new payment stream. The actual deposit will be this constant + the deposit calculated using the `NewStreamDeposit` constant.
|
|
325
|
+
**/
|
|
326
|
+
baseDeposit: u128 & AugmentedConst<ApiType>;
|
|
327
|
+
/**
|
|
328
|
+
* The maximum amount of Users that a Provider can charge in a single extrinsic execution.
|
|
329
|
+
* This is used to prevent a Provider from charging too many Users in a single block, which could lead to a DoS attack.
|
|
330
|
+
**/
|
|
331
|
+
maxUsersToCharge: u32 & AugmentedConst<ApiType>;
|
|
247
332
|
/**
|
|
248
333
|
* The number of ticks that correspond to the deposit that a User has to pay to open a payment stream.
|
|
249
334
|
* This means that, from the balance of the User for which the payment stream is being created, the amount
|
|
250
|
-
* `NewStreamDeposit * rate` will be held as a deposit.
|
|
251
|
-
* In the case of dynamic-rate payment streams, `rate` will be `
|
|
252
|
-
*
|
|
335
|
+
* `NewStreamDeposit * rate + BaseDeposit` will be held as a deposit.
|
|
336
|
+
* In the case of dynamic-rate payment streams, `rate` will be `amount_provided_in_giga_units * price_per_giga_unit_per_tick`, where `price_per_giga_unit_per_tick` is
|
|
337
|
+
* obtained from the `CurrentPricePerGigaUnitPerTick` storage.
|
|
253
338
|
**/
|
|
254
339
|
newStreamDeposit: u32 & AugmentedConst<ApiType>;
|
|
340
|
+
/**
|
|
341
|
+
* The treasury account of the runtime, where a fraction of each payment goes.
|
|
342
|
+
**/
|
|
343
|
+
treasuryAccount: AccountId32 & AugmentedConst<ApiType>;
|
|
255
344
|
/**
|
|
256
345
|
* The number of ticks that a user will have to wait after it has been flagged as without funds to be able to clear that flag
|
|
257
346
|
* and be able to pay for services again. If there's any outstanding debt when the flag is cleared, it will be paid.
|
|
@@ -327,6 +416,17 @@ declare module "@polkadot/api-base/types/consts" {
|
|
|
327
416
|
* The maximum number of custom challenges that can be made in a single checkpoint block.
|
|
328
417
|
**/
|
|
329
418
|
maxCustomChallengesPerBlock: u32 & AugmentedConst<ApiType>;
|
|
419
|
+
/**
|
|
420
|
+
* The maximum number of Providers that can be slashed per tick.
|
|
421
|
+
*
|
|
422
|
+
* Providers are marked as slashable if they are found in the [`TickToProvidersDeadlines`] StorageMap
|
|
423
|
+
* for the current challenges tick. It is expected that most of the times, there will be little to
|
|
424
|
+
* no Providers in the [`TickToProvidersDeadlines`] StorageMap for the current challenges tick. That
|
|
425
|
+
* is because Providers are expected to submit proofs in time. However, in the extreme scenario where
|
|
426
|
+
* a large number of Providers are missing the proof submissions, this configuration is used to keep
|
|
427
|
+
* the execution of the `on_poll` hook bounded.
|
|
428
|
+
**/
|
|
429
|
+
maxSlashableProvidersPerTick: u32 & AugmentedConst<ApiType>;
|
|
330
430
|
/**
|
|
331
431
|
* The maximum amount of Providers that can submit a proof in a single block.
|
|
332
432
|
* Although this can be seen as an arbitrary limit, if set to the already existing
|
|
@@ -345,11 +445,16 @@ declare module "@polkadot/api-base/types/consts" {
|
|
|
345
445
|
* If less than this percentage of blocks are not full, the networks is considered to be presumably
|
|
346
446
|
* under a spam attack.
|
|
347
447
|
* This can also be thought of as the maximum ratio of misbehaving collators tolerated. For example,
|
|
348
|
-
* if this is set to `Perbill::from_percent(50)`, then if more than half of the last `BlockFullnessPeriod`
|
|
448
|
+
* if this is set to `Perbill::from_percent(50)`, then if more than half of the last [`Config::BlockFullnessPeriod`]
|
|
349
449
|
* blocks are not full, then one of those blocks surely was produced by an honest collator, meaning
|
|
350
|
-
* that there was at least one truly _not_ full block in the last `BlockFullnessPeriod` blocks.
|
|
450
|
+
* that there was at least one truly _not_ full block in the last [`Config::BlockFullnessPeriod`] blocks.
|
|
351
451
|
**/
|
|
352
452
|
minNotFullBlocksRatio: Perbill & AugmentedConst<ApiType>;
|
|
453
|
+
/**
|
|
454
|
+
* The fee charged for submitting a priority challenge.
|
|
455
|
+
* This fee goes to the Treasury, and is used to prevent spam.
|
|
456
|
+
**/
|
|
457
|
+
priorityChallengesFee: u128 & AugmentedConst<ApiType>;
|
|
353
458
|
/**
|
|
354
459
|
* The number of random challenges that are generated per block, using the random seed
|
|
355
460
|
* generated for that block.
|
|
@@ -380,6 +485,14 @@ declare module "@polkadot/api-base/types/consts" {
|
|
|
380
485
|
[key: string]: Codec;
|
|
381
486
|
};
|
|
382
487
|
providers: {
|
|
488
|
+
/**
|
|
489
|
+
* The amount of blocks that a BSP must wait before being able to sign off, after being signed up.
|
|
490
|
+
*
|
|
491
|
+
* This is to prevent BSPs from signing up and off too quickly, thus making it harder for an attacker
|
|
492
|
+
* to suddenly have a large portion of the total number of BSPs. The reason for this, is that the
|
|
493
|
+
* attacker would have to lock up a large amount of funds for this period of time.
|
|
494
|
+
**/
|
|
495
|
+
bspSignUpLockPeriod: u32 & AugmentedConst<ApiType>;
|
|
383
496
|
/**
|
|
384
497
|
* The amount that an account has to deposit to create a bucket.
|
|
385
498
|
**/
|
|
@@ -400,10 +513,11 @@ declare module "@polkadot/api-base/types/consts" {
|
|
|
400
513
|
* The maximum amount of blocks after which a sign up request expires so the randomness cannot be chosen
|
|
401
514
|
**/
|
|
402
515
|
maxBlocksForRandomness: u32 & AugmentedConst<ApiType>;
|
|
516
|
+
maxCommitmentSize: u32 & AugmentedConst<ApiType>;
|
|
403
517
|
/**
|
|
404
|
-
*
|
|
518
|
+
* Maximum number of expired items (per type) to clean up in a single block.
|
|
405
519
|
**/
|
|
406
|
-
|
|
520
|
+
maxExpiredItemsInBlock: u32 & AugmentedConst<ApiType>;
|
|
407
521
|
/**
|
|
408
522
|
* The estimated maximum size of an unknown file.
|
|
409
523
|
*
|
|
@@ -426,6 +540,14 @@ declare module "@polkadot/api-base/types/consts" {
|
|
|
426
540
|
* The minimum amount of blocks between capacity changes for a SP
|
|
427
541
|
**/
|
|
428
542
|
minBlocksBetweenCapacityChanges: u32 & AugmentedConst<ApiType>;
|
|
543
|
+
/**
|
|
544
|
+
* Time-to-live for a provider to top up their deposit to cover a capacity deficit.
|
|
545
|
+
*
|
|
546
|
+
* This TTL is used to determine at what point to insert the expiration item in the
|
|
547
|
+
* [`ProviderTopUpExpirations`] storage which is processed in the `on_idle` hook at
|
|
548
|
+
* the time when the tick has been reached.
|
|
549
|
+
**/
|
|
550
|
+
providerTopUpTtl: u32 & AugmentedConst<ApiType>;
|
|
429
551
|
/**
|
|
430
552
|
* The slash factor deducted from a Storage Provider's deposit for every single storage proof they fail to provide.
|
|
431
553
|
**/
|
|
@@ -449,6 +571,11 @@ declare module "@polkadot/api-base/types/consts" {
|
|
|
449
571
|
* - The slashed funds are transferred.
|
|
450
572
|
**/
|
|
451
573
|
treasury: AccountId32 & AugmentedConst<ApiType>;
|
|
574
|
+
/**
|
|
575
|
+
* 0-size bucket fixed rate payment stream (i.e. the amount charged as a base
|
|
576
|
+
* fee for a bucket that doesn't have any files yet)
|
|
577
|
+
**/
|
|
578
|
+
zeroSizeBucketFixedRate: u128 & AugmentedConst<ApiType>;
|
|
452
579
|
/**
|
|
453
580
|
* Generic const
|
|
454
581
|
**/
|