@lodestar/prover 1.9.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 +201 -0
- package/README.md +135 -0
- package/lib/cli/applyPreset.d.ts +2 -0
- package/lib/cli/applyPreset.js +72 -0
- package/lib/cli/applyPreset.js.map +1 -0
- package/lib/cli/cli.d.ts +8 -0
- package/lib/cli/cli.js +50 -0
- package/lib/cli/cli.js.map +1 -0
- package/lib/cli/cmds/index.d.ts +4 -0
- package/lib/cli/cmds/index.js +3 -0
- package/lib/cli/cmds/index.js.map +1 -0
- package/lib/cli/cmds/start/handler.d.ts +7 -0
- package/lib/cli/cmds/start/handler.js +30 -0
- package/lib/cli/cmds/start/handler.js.map +1 -0
- package/lib/cli/cmds/start/index.d.ts +5 -0
- package/lib/cli/cmds/start/index.js +15 -0
- package/lib/cli/cmds/start/index.js.map +1 -0
- package/lib/cli/cmds/start/options.d.ts +27 -0
- package/lib/cli/cmds/start/options.js +67 -0
- package/lib/cli/cmds/start/options.js.map +1 -0
- package/lib/cli/index.d.ts +4 -0
- package/lib/cli/index.js +25 -0
- package/lib/cli/index.js.map +1 -0
- package/lib/cli/options.d.ts +22 -0
- package/lib/cli/options.js +50 -0
- package/lib/cli/options.js.map +1 -0
- package/lib/constants.d.ts +6 -0
- package/lib/constants.js +7 -0
- package/lib/constants.js.map +1 -0
- package/lib/index.d.ts +4 -0
- package/lib/index.js +4 -0
- package/lib/index.js.map +1 -0
- package/lib/index.web.d.ts +3 -0
- package/lib/index.web.js +3 -0
- package/lib/index.web.js.map +1 -0
- package/lib/interfaces.d.ts +69 -0
- package/lib/interfaces.js +6 -0
- package/lib/interfaces.js.map +1 -0
- package/lib/proof_provider/ordered_map.d.ts +8 -0
- package/lib/proof_provider/ordered_map.js +24 -0
- package/lib/proof_provider/ordered_map.js.map +1 -0
- package/lib/proof_provider/payload_store.d.ts +25 -0
- package/lib/proof_provider/payload_store.js +154 -0
- package/lib/proof_provider/payload_store.js.map +1 -0
- package/lib/proof_provider/proof_provider.d.ts +36 -0
- package/lib/proof_provider/proof_provider.js +171 -0
- package/lib/proof_provider/proof_provider.js.map +1 -0
- package/lib/types.d.ts +136 -0
- package/lib/types.js +3 -0
- package/lib/types.js.map +1 -0
- package/lib/utils/assertion.d.ts +10 -0
- package/lib/utils/assertion.js +34 -0
- package/lib/utils/assertion.js.map +1 -0
- package/lib/utils/command.d.ts +22 -0
- package/lib/utils/command.js +27 -0
- package/lib/utils/command.js.map +1 -0
- package/lib/utils/consensus.d.ts +19 -0
- package/lib/utils/consensus.js +74 -0
- package/lib/utils/consensus.js.map +1 -0
- package/lib/utils/conversion.d.ts +47 -0
- package/lib/utils/conversion.js +94 -0
- package/lib/utils/conversion.js.map +1 -0
- package/lib/utils/errors.d.ts +6 -0
- package/lib/utils/errors.js +6 -0
- package/lib/utils/errors.js.map +1 -0
- package/lib/utils/evm.d.ts +44 -0
- package/lib/utils/evm.js +193 -0
- package/lib/utils/evm.js.map +1 -0
- package/lib/utils/execution.d.ts +12 -0
- package/lib/utils/execution.js +53 -0
- package/lib/utils/execution.js.map +1 -0
- package/lib/utils/file.d.ts +8 -0
- package/lib/utils/file.js +50 -0
- package/lib/utils/file.js.map +1 -0
- package/lib/utils/gitData/gitDataPath.d.ts +17 -0
- package/lib/utils/gitData/gitDataPath.js +37 -0
- package/lib/utils/gitData/gitDataPath.js.map +1 -0
- package/lib/utils/gitData/index.d.ts +6 -0
- package/lib/utils/gitData/index.js +68 -0
- package/lib/utils/gitData/index.js.map +1 -0
- package/lib/utils/gitData/writeGitData.d.ts +3 -0
- package/lib/utils/gitData/writeGitData.js +8 -0
- package/lib/utils/gitData/writeGitData.js.map +1 -0
- package/lib/utils/json_rpc.d.ts +17 -0
- package/lib/utils/json_rpc.js +115 -0
- package/lib/utils/json_rpc.js.map +1 -0
- package/lib/utils/logger.d.ts +4 -0
- package/lib/utils/logger.js +12 -0
- package/lib/utils/logger.js.map +1 -0
- package/lib/utils/process.d.ts +20 -0
- package/lib/utils/process.js +75 -0
- package/lib/utils/process.js.map +1 -0
- package/lib/utils/req_resp.d.ts +5 -0
- package/lib/utils/req_resp.js +33 -0
- package/lib/utils/req_resp.js.map +1 -0
- package/lib/utils/rpc.d.ts +26 -0
- package/lib/utils/rpc.js +55 -0
- package/lib/utils/rpc.js.map +1 -0
- package/lib/utils/validation.d.ts +30 -0
- package/lib/utils/validation.js +94 -0
- package/lib/utils/validation.js.map +1 -0
- package/lib/utils/verification.d.ts +34 -0
- package/lib/utils/verification.js +62 -0
- package/lib/utils/verification.js.map +1 -0
- package/lib/utils/version.d.ts +12 -0
- package/lib/utils/version.js +59 -0
- package/lib/utils/version.js.map +1 -0
- package/lib/verified_requests/eth_call.d.ts +4 -0
- package/lib/verified_requests/eth_call.js +33 -0
- package/lib/verified_requests/eth_call.js.map +1 -0
- package/lib/verified_requests/eth_estimateGas.d.ts +4 -0
- package/lib/verified_requests/eth_estimateGas.js +33 -0
- package/lib/verified_requests/eth_estimateGas.js.map +1 -0
- package/lib/verified_requests/eth_getBalance.d.ts +3 -0
- package/lib/verified_requests/eth_getBalance.js +13 -0
- package/lib/verified_requests/eth_getBalance.js.map +1 -0
- package/lib/verified_requests/eth_getBlockByHash.d.ts +4 -0
- package/lib/verified_requests/eth_getBlockByHash.js +12 -0
- package/lib/verified_requests/eth_getBlockByHash.js.map +1 -0
- package/lib/verified_requests/eth_getBlockByNumber.d.ts +7 -0
- package/lib/verified_requests/eth_getBlockByNumber.js +12 -0
- package/lib/verified_requests/eth_getBlockByNumber.js.map +1 -0
- package/lib/verified_requests/eth_getCode.d.ts +3 -0
- package/lib/verified_requests/eth_getCode.js +32 -0
- package/lib/verified_requests/eth_getCode.js.map +1 -0
- package/lib/verified_requests/eth_getTransactionCount.d.ts +6 -0
- package/lib/verified_requests/eth_getTransactionCount.js +13 -0
- package/lib/verified_requests/eth_getTransactionCount.js.map +1 -0
- package/lib/web3_provider.d.ts +14 -0
- package/lib/web3_provider.js +138 -0
- package/lib/web3_provider.js.map +1 -0
- package/lib/web3_proxy.d.ts +13 -0
- package/lib/web3_proxy.js +136 -0
- package/lib/web3_proxy.js.map +1 -0
- package/package.json +100 -0
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import http from "node:http";
|
|
2
|
+
import url from "node:url";
|
|
3
|
+
import httpProxy from "http-proxy";
|
|
4
|
+
import { getNodeLogger } from "@lodestar/logger/node";
|
|
5
|
+
import { LogLevel } from "@lodestar/logger";
|
|
6
|
+
import { ProofProvider } from "./proof_provider/proof_provider.js";
|
|
7
|
+
import { getResponseForRequest, isBatchRequest } from "./utils/json_rpc.js";
|
|
8
|
+
import { fetchRequestPayload, fetchResponseBody } from "./utils/req_resp.js";
|
|
9
|
+
import { processAndVerifyRequest } from "./utils/process.js";
|
|
10
|
+
import { ELRpc } from "./utils/rpc.js";
|
|
11
|
+
function createHttpHandler({ info, signal, }) {
|
|
12
|
+
return function handler(payload) {
|
|
13
|
+
return new Promise((resolve, reject) => {
|
|
14
|
+
const serverInfo = info();
|
|
15
|
+
if (typeof serverInfo === "string") {
|
|
16
|
+
return reject(new Error(serverInfo));
|
|
17
|
+
}
|
|
18
|
+
const req = http.request({
|
|
19
|
+
method: "POST",
|
|
20
|
+
path: "/proxy",
|
|
21
|
+
port: serverInfo.port,
|
|
22
|
+
host: serverInfo.host,
|
|
23
|
+
timeout: serverInfo.timeout,
|
|
24
|
+
signal,
|
|
25
|
+
headers: {
|
|
26
|
+
"Content-Type": "application/json",
|
|
27
|
+
},
|
|
28
|
+
}, (res) => {
|
|
29
|
+
fetchResponseBody(res)
|
|
30
|
+
.then((response) => {
|
|
31
|
+
resolve(response);
|
|
32
|
+
})
|
|
33
|
+
.catch(reject);
|
|
34
|
+
});
|
|
35
|
+
req.on("timeout", () => {
|
|
36
|
+
req.destroy();
|
|
37
|
+
reject(new Error("Request timeout"));
|
|
38
|
+
});
|
|
39
|
+
req.write(JSON.stringify(payload));
|
|
40
|
+
req.end();
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
export function createVerifiedExecutionProxy(opts) {
|
|
45
|
+
var _a, _b, _c;
|
|
46
|
+
const { executionRpcUrl, requestTimeout } = opts;
|
|
47
|
+
const signal = (_a = opts.signal) !== null && _a !== void 0 ? _a : new AbortController().signal;
|
|
48
|
+
const logger = (_b = opts.logger) !== null && _b !== void 0 ? _b : getNodeLogger({ level: (_c = opts.logLevel) !== null && _c !== void 0 ? _c : LogLevel.info, module: "prover" });
|
|
49
|
+
const proofProvider = ProofProvider.init({
|
|
50
|
+
...opts,
|
|
51
|
+
signal,
|
|
52
|
+
logger,
|
|
53
|
+
});
|
|
54
|
+
logger.info("Creating http proxy", { url: executionRpcUrl });
|
|
55
|
+
const proxy = httpProxy.createProxy({
|
|
56
|
+
target: executionRpcUrl,
|
|
57
|
+
ws: executionRpcUrl.startsWith("ws"),
|
|
58
|
+
agent: http.globalAgent,
|
|
59
|
+
xfwd: true,
|
|
60
|
+
ignorePath: true,
|
|
61
|
+
changeOrigin: true,
|
|
62
|
+
});
|
|
63
|
+
let proxyServerListeningAddress;
|
|
64
|
+
const rpc = new ELRpc(createHttpHandler({
|
|
65
|
+
signal,
|
|
66
|
+
info: () => {
|
|
67
|
+
if (!proxyServerListeningAddress) {
|
|
68
|
+
return "Proxy server not listening";
|
|
69
|
+
}
|
|
70
|
+
return {
|
|
71
|
+
port: proxyServerListeningAddress.port,
|
|
72
|
+
host: proxyServerListeningAddress.host,
|
|
73
|
+
timeout: requestTimeout,
|
|
74
|
+
};
|
|
75
|
+
},
|
|
76
|
+
}), logger);
|
|
77
|
+
logger.info("Creating http server");
|
|
78
|
+
const proxyServer = http.createServer(function proxyRequestHandler(req, res) {
|
|
79
|
+
if (req.url === "/proxy") {
|
|
80
|
+
logger.debug("Forwarding request to execution layer");
|
|
81
|
+
proxy.web(req, res);
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
let payload;
|
|
85
|
+
fetchRequestPayload(req)
|
|
86
|
+
.then((data) => {
|
|
87
|
+
payload = data;
|
|
88
|
+
return processAndVerifyRequest({ payload, proofProvider, rpc, logger });
|
|
89
|
+
})
|
|
90
|
+
.then((response) => {
|
|
91
|
+
res.write(JSON.stringify(response));
|
|
92
|
+
res.end();
|
|
93
|
+
})
|
|
94
|
+
.catch((err) => {
|
|
95
|
+
logger.error("Error processing request", err);
|
|
96
|
+
const message = err.message;
|
|
97
|
+
if (isBatchRequest(payload)) {
|
|
98
|
+
res.write(JSON.stringify(payload.map((req) => getResponseForRequest(req, { message }))));
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
res.write(JSON.stringify(getResponseForRequest(payload, undefined, { message })));
|
|
102
|
+
}
|
|
103
|
+
res.end();
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
proxyServer.on("listening", () => {
|
|
107
|
+
const address = proxyServer.address();
|
|
108
|
+
if (address === null) {
|
|
109
|
+
throw new Error("Invalid proxy server address");
|
|
110
|
+
}
|
|
111
|
+
if (typeof address === "string") {
|
|
112
|
+
const rawUrl = url.parse(address);
|
|
113
|
+
if (!rawUrl.host || !rawUrl.port || !rawUrl.protocol) {
|
|
114
|
+
throw new Error(`Invalid proxy server address: ${address}`);
|
|
115
|
+
}
|
|
116
|
+
proxyServerListeningAddress = { host: rawUrl.host, port: parseInt(rawUrl.port) };
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
proxyServerListeningAddress = { host: address.address, port: address.port };
|
|
120
|
+
}
|
|
121
|
+
logger.info(`Lodestar Prover Proxy listening on ${proxyServerListeningAddress.host}:${proxyServerListeningAddress.port}`);
|
|
122
|
+
rpc.verifyCompatibility().catch((err) => {
|
|
123
|
+
logger.error(err);
|
|
124
|
+
process.exit(1);
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
proxyServer.on("upgrade", function proxyRequestUpgrade(req, socket, head) {
|
|
128
|
+
logger.debug("Upgrading the ws connection");
|
|
129
|
+
proxy.ws(req, socket, head);
|
|
130
|
+
});
|
|
131
|
+
signal.addEventListener("abort", () => {
|
|
132
|
+
proxyServer.close();
|
|
133
|
+
});
|
|
134
|
+
return { server: proxyServer, proofProvider };
|
|
135
|
+
}
|
|
136
|
+
//# sourceMappingURL=web3_proxy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web3_proxy.js","sourceRoot":"","sources":["../src/web3_proxy.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,GAAG,MAAM,UAAU,CAAC;AAC3B,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAC,aAAa,EAAC,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAC,QAAQ,EAAC,MAAM,kBAAkB,CAAC;AAE1C,OAAO,EAAC,aAAa,EAAC,MAAM,oCAAoC,CAAC;AAEjE,OAAO,EAAC,qBAAqB,EAAE,cAAc,EAAC,MAAM,qBAAqB,CAAC;AAC1E,OAAO,EAAC,mBAAmB,EAAE,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AAC3E,OAAO,EAAC,uBAAuB,EAAC,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAC,KAAK,EAAC,MAAM,gBAAgB,CAAC;AAOrC,SAAS,iBAAiB,CAAC,EACzB,IAAI,EACJ,MAAM,GAIP;IACC,OAAO,SAAS,OAAO,CAAC,OAA8B;QACpD,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACrC,MAAM,UAAU,GAAG,IAAI,EAAE,CAAC;YAC1B,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE;gBAClC,OAAO,MAAM,CAAC,IAAI,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;aACtC;YAED,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CACtB;gBACE,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,UAAU,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AAiC,OAAO,EAAE,CAAC,CAAC;aAC7D;YACD,2BAA2B,GAAG,EAAC,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,EAAC,CAAC;SAChF;aAAM;YACL,2BAA2B,GAAG,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAC,CAAC;SAC3E;QAED,MAAM,CAAC,IAAI,CACT,sCAAsC,2BAA2B,CAAC,IAAI,IAAI,2BAA2B,CAAC,IAAI,EAAE,CAC7G,CAAC;QAEF,GAAG,CAAC,mBAAmB,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;YACtC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAClB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,WAAW,CAAC,EAAE,CAAC,SAAS,EAAE,SAAS,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI;QACtE,MAAM,CAAC,KAAK,CAAC,6BAA6B,CAAC,CAAC;QAC5C,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,GAAG,EAAE;QACpC,WAAW,CAAC,KAAK,EAAE,CAAC;IACtB,CAAC,CAAC,CAAC;IAEH,OAAO,EAAC,MAAM,EAAE,WAAW,EAAE,aAAa,EAAC,CAAC;AAC9C,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@lodestar/prover",
|
|
3
|
+
"description": "A Typescript implementation of the Ethereum Consensus light client",
|
|
4
|
+
"license": "Apache-2.0",
|
|
5
|
+
"author": "ChainSafe Systems",
|
|
6
|
+
"homepage": "https://github.com/ChainSafe/lodestar#readme",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com:ChainSafe/lodestar.git"
|
|
10
|
+
},
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/ChainSafe/lodestar/issues"
|
|
13
|
+
},
|
|
14
|
+
"version": "1.9.1",
|
|
15
|
+
"type": "module",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"import": "./lib/index.js",
|
|
19
|
+
"browser": "./lib/index.web.js"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"bin": {
|
|
23
|
+
"lodestar-prover": "lib/cli/index.js"
|
|
24
|
+
},
|
|
25
|
+
"typesVersions": {
|
|
26
|
+
"*": {
|
|
27
|
+
"*": [
|
|
28
|
+
"*",
|
|
29
|
+
"lib/*",
|
|
30
|
+
"lib/*/index"
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"types": "./lib/index.d.ts",
|
|
35
|
+
"files": [
|
|
36
|
+
"lib/**/*.d.ts",
|
|
37
|
+
"lib/**/*.js",
|
|
38
|
+
"lib/**/*.js.map",
|
|
39
|
+
"*.d.ts",
|
|
40
|
+
"*.js"
|
|
41
|
+
],
|
|
42
|
+
"scripts": {
|
|
43
|
+
"clean": "rm -rf lib && rm -f *.tsbuildinfo",
|
|
44
|
+
"build": "tsc -p tsconfig.build.json",
|
|
45
|
+
"build:watch": "yarn run build --watch",
|
|
46
|
+
"build:release": "yarn clean && yarn run build",
|
|
47
|
+
"check-build": "node -e \"(async function() { await import('./lib/index.js') })()\"",
|
|
48
|
+
"check-types": "tsc",
|
|
49
|
+
"coverage": "codecov -F lodestar-api",
|
|
50
|
+
"lint": "eslint --color --ext .ts src/ test/",
|
|
51
|
+
"lint:fix": "yarn run lint --fix",
|
|
52
|
+
"pretest": "yarn run check-types",
|
|
53
|
+
"test": "yarn test:unit && yarn test:e2e",
|
|
54
|
+
"test:unit": "nyc --cache-dir .nyc_output/.cache -e .ts mocha 'test/unit/**/*.test.ts'",
|
|
55
|
+
"test:browsers": "yarn karma start karma.config.cjs",
|
|
56
|
+
"test:e2e": "LODESTAR_PRESET=minimal mocha 'test/e2e/**/*.test.ts'",
|
|
57
|
+
"check-readme": "typescript-docs-verifier",
|
|
58
|
+
"generate-fixtures": "npx ts-node --esm scripts/generate_fixtures.ts"
|
|
59
|
+
},
|
|
60
|
+
"dependencies": {
|
|
61
|
+
"@ethereumjs/block": "^4.2.2",
|
|
62
|
+
"@ethereumjs/blockchain": "^6.2.2",
|
|
63
|
+
"@ethereumjs/common": "^3.1.2",
|
|
64
|
+
"@ethereumjs/evm": "^1.3.2",
|
|
65
|
+
"@ethereumjs/rlp": "^4.0.1",
|
|
66
|
+
"@ethereumjs/trie": "^5.0.5",
|
|
67
|
+
"@ethereumjs/tx": "^4.1.2",
|
|
68
|
+
"@ethereumjs/util": "^8.0.6",
|
|
69
|
+
"@ethereumjs/vm": "^6.4.2",
|
|
70
|
+
"@lodestar/api": "^1.9.1",
|
|
71
|
+
"@lodestar/config": "^1.9.1",
|
|
72
|
+
"@lodestar/params": "^1.9.1",
|
|
73
|
+
"@lodestar/logger": "^1.9.1",
|
|
74
|
+
"@lodestar/light-client": "^1.9.1",
|
|
75
|
+
"@lodestar/types": "^1.9.1",
|
|
76
|
+
"@lodestar/utils": "^1.9.1",
|
|
77
|
+
"ethereum-cryptography": "^1.2.0",
|
|
78
|
+
"find-up": "^6.3.0",
|
|
79
|
+
"http-proxy": "^1.18.1",
|
|
80
|
+
"js-yaml": "^4.1.0",
|
|
81
|
+
"source-map-support": "^0.5.21",
|
|
82
|
+
"yargs": "^17.7.1"
|
|
83
|
+
},
|
|
84
|
+
"devDependencies": {
|
|
85
|
+
"@lodestar/test-utils": "^1.9.1",
|
|
86
|
+
"@types/http-proxy": "^1.17.10",
|
|
87
|
+
"@types/yargs": "^17.0.24",
|
|
88
|
+
"axios": "^1.3.4",
|
|
89
|
+
"ethers": "^6.4.2",
|
|
90
|
+
"web3": "^1.10.0"
|
|
91
|
+
},
|
|
92
|
+
"keywords": [
|
|
93
|
+
"ethereum",
|
|
94
|
+
"eth-consensus",
|
|
95
|
+
"beacon",
|
|
96
|
+
"api",
|
|
97
|
+
"blockchain",
|
|
98
|
+
"prover"
|
|
99
|
+
]
|
|
100
|
+
}
|