@acala-network/chopsticks 0.6.0 → 0.6.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/lib/cli.js +19 -1
- package/package.json +4 -4
package/lib/cli.js
CHANGED
|
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const node_path_1 = require("node:path");
|
|
6
7
|
const helpers_1 = require("yargs/helpers");
|
|
7
8
|
const node_fs_1 = require("node:fs");
|
|
8
9
|
const lodash_1 = __importDefault(require("lodash"));
|
|
@@ -16,16 +17,33 @@ const decoder_1 = require("./utils/decoder");
|
|
|
16
17
|
const dry_run_1 = require("./dry-run");
|
|
17
18
|
const dry_run_preimage_1 = require("./dry-run-preimage");
|
|
18
19
|
const utils_1 = require("./utils");
|
|
20
|
+
const shared_1 = require("./rpc/shared");
|
|
19
21
|
const run_block_1 = require("./run-block");
|
|
20
22
|
const try_runtime_1 = require("./try-runtime");
|
|
21
23
|
dotenv_1.default.config();
|
|
24
|
+
const CONFIGS_BASE_URL = 'https://raw.githubusercontent.com/AcalaNetwork/chopsticks/master/configs/';
|
|
22
25
|
const processConfig = async (path) => {
|
|
23
26
|
let file;
|
|
24
27
|
if ((0, utils_1.isUrl)(path)) {
|
|
25
28
|
file = await axios_1.default.get(path).then((x) => x.data);
|
|
26
29
|
}
|
|
27
30
|
else {
|
|
28
|
-
|
|
31
|
+
try {
|
|
32
|
+
file = (0, node_fs_1.readFileSync)(path, 'utf8');
|
|
33
|
+
}
|
|
34
|
+
catch (err) {
|
|
35
|
+
if ((0, node_path_1.basename)(path) === path && ['', '.yml', '.yaml', '.json'].includes((0, node_path_1.extname)(path))) {
|
|
36
|
+
if ((0, node_path_1.extname)(path) === '') {
|
|
37
|
+
path += '.yml';
|
|
38
|
+
}
|
|
39
|
+
const url = CONFIGS_BASE_URL + path;
|
|
40
|
+
shared_1.logger.info(`Loading config file ${url}`);
|
|
41
|
+
file = await axios_1.default.get(url).then((x) => x.data);
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
throw err;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
29
47
|
}
|
|
30
48
|
const config = js_yaml_1.default.load(lodash_1.default.template(file, { variable: 'env' })(process.env));
|
|
31
49
|
return schema_1.configSchema.parse(config);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@acala-network/chopsticks",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"author": "Bryan Chen <xlchen1291@gmail.com>",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"bin": "./chopsticks.js",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"dev:moonbeam": "cd ../..; ts-node-dev --transpile-only --inspect --notify=false packages/chopsticks/src/cli.ts -- dev --config=configs/moonbeam.yml"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@acala-network/chopsticks-executor": "0.6.
|
|
18
|
+
"@acala-network/chopsticks-executor": "0.6.1",
|
|
19
19
|
"@polkadot/api": "^10.2.1",
|
|
20
20
|
"@polkadot/rpc-provider": "^10.2.1",
|
|
21
21
|
"@polkadot/types": "^10.2.1",
|
|
@@ -39,12 +39,12 @@
|
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@types/js-yaml": "^4.0.5",
|
|
41
41
|
"@types/lodash": "^4.14.192",
|
|
42
|
-
"@types/node": "^18.15.
|
|
42
|
+
"@types/node": "^18.15.11",
|
|
43
43
|
"@types/ws": "^8.5.4",
|
|
44
44
|
"@types/yargs": "^17.0.24",
|
|
45
45
|
"ts-node": "^10.9.1",
|
|
46
46
|
"ts-node-dev": "^2.0.0",
|
|
47
|
-
"typescript": "^5.0.
|
|
47
|
+
"typescript": "^5.0.3"
|
|
48
48
|
},
|
|
49
49
|
"files": [
|
|
50
50
|
"lib",
|