@lodestar/api 1.20.0-dev.c1532773c2 → 1.20.0-dev.f4460cd1d6
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/README.md +2 -2
- package/lib/beacon/client/beacon.d.ts +4 -3
- package/lib/beacon/client/beacon.js +3 -36
- package/lib/beacon/client/beacon.js.map +1 -1
- package/lib/beacon/client/config.d.ts +4 -3
- package/lib/beacon/client/config.js +3 -6
- package/lib/beacon/client/config.js.map +1 -1
- package/lib/beacon/client/debug.d.ts +4 -3
- package/lib/beacon/client/debug.js +4 -45
- package/lib/beacon/client/debug.js.map +1 -1
- package/lib/beacon/client/events.d.ts +5 -2
- package/lib/beacon/client/events.js +32 -35
- package/lib/beacon/client/events.js.map +1 -1
- package/lib/beacon/client/index.d.ts +6 -3
- package/lib/beacon/client/index.js +2 -2
- package/lib/beacon/client/index.js.map +1 -1
- package/lib/beacon/client/lightclient.d.ts +4 -3
- package/lib/beacon/client/lightclient.js +4 -7
- package/lib/beacon/client/lightclient.js.map +1 -1
- package/lib/beacon/client/lodestar.d.ts +4 -3
- package/lib/beacon/client/lodestar.js +4 -7
- package/lib/beacon/client/lodestar.js.map +1 -1
- package/lib/beacon/client/node.d.ts +4 -3
- package/lib/beacon/client/node.js +4 -7
- package/lib/beacon/client/node.js.map +1 -1
- package/lib/beacon/client/proof.d.ts +5 -4
- package/lib/beacon/client/proof.js +5 -61
- package/lib/beacon/client/proof.js.map +1 -1
- package/lib/beacon/client/validator.d.ts +4 -3
- package/lib/beacon/client/validator.js +4 -7
- package/lib/beacon/client/validator.js.map +1 -1
- package/lib/beacon/index.d.ts +5 -5
- package/lib/beacon/index.js.map +1 -1
- package/lib/beacon/routes/beacon/block.d.ts +282 -164
- package/lib/beacon/routes/beacon/block.js +324 -116
- package/lib/beacon/routes/beacon/block.js.map +1 -1
- package/lib/beacon/routes/beacon/index.d.ts +6 -588
- package/lib/beacon/routes/beacon/index.js +16 -26
- package/lib/beacon/routes/beacon/index.js.map +1 -1
- package/lib/beacon/routes/beacon/pool.d.ts +155 -117
- package/lib/beacon/routes/beacon/pool.js +146 -42
- package/lib/beacon/routes/beacon/pool.js.map +1 -1
- package/lib/beacon/routes/beacon/rewards.d.ts +113 -101
- package/lib/beacon/routes/beacon/rewards.js +98 -63
- package/lib/beacon/routes/beacon/rewards.js.map +1 -1
- package/lib/beacon/routes/beacon/state.d.ts +172 -226
- package/lib/beacon/routes/beacon/state.js +204 -126
- package/lib/beacon/routes/beacon/state.js.map +1 -1
- package/lib/beacon/routes/config.d.ts +21 -36
- package/lib/beacon/routes/config.js +45 -24
- package/lib/beacon/routes/config.js.map +1 -1
- package/lib/beacon/routes/debug.d.ts +32 -95
- package/lib/beacon/routes/debug.js +87 -45
- package/lib/beacon/routes/debug.js.map +1 -1
- package/lib/beacon/routes/events.d.ts +20 -16
- package/lib/beacon/routes/events.js +39 -17
- package/lib/beacon/routes/events.js.map +1 -1
- package/lib/beacon/routes/index.d.ts +19 -19
- package/lib/beacon/routes/index.js +1 -0
- package/lib/beacon/routes/index.js.map +1 -1
- package/lib/beacon/routes/lightclient.d.ts +33 -55
- package/lib/beacon/routes/lightclient.js +107 -47
- package/lib/beacon/routes/lightclient.js.map +1 -1
- package/lib/beacon/routes/lodestar.d.ts +74 -148
- package/lib/beacon/routes/lodestar.js +126 -77
- package/lib/beacon/routes/lodestar.js.map +1 -1
- package/lib/beacon/routes/node.d.ts +48 -82
- package/lib/beacon/routes/node.js +90 -57
- package/lib/beacon/routes/node.js.map +1 -1
- package/lib/beacon/routes/proof.d.ts +25 -31
- package/lib/beacon/routes/proof.js +44 -24
- package/lib/beacon/routes/proof.js.map +1 -1
- package/lib/beacon/routes/validator.d.ts +547 -320
- package/lib/beacon/routes/validator.js +494 -213
- package/lib/beacon/routes/validator.js.map +1 -1
- package/lib/beacon/server/beacon.d.ts +3 -4
- package/lib/beacon/server/beacon.js +4 -57
- package/lib/beacon/server/beacon.js.map +1 -1
- package/lib/beacon/server/config.d.ts +3 -4
- package/lib/beacon/server/config.js +4 -5
- package/lib/beacon/server/config.js.map +1 -1
- package/lib/beacon/server/debug.d.ts +3 -4
- package/lib/beacon/server/debug.js +4 -54
- package/lib/beacon/server/debug.js.map +1 -1
- package/lib/beacon/server/events.d.ts +4 -4
- package/lib/beacon/server/events.js +17 -23
- package/lib/beacon/server/events.js.map +1 -1
- package/lib/beacon/server/index.d.ts +7 -8
- package/lib/beacon/server/index.js +13 -14
- package/lib/beacon/server/index.js.map +1 -1
- package/lib/beacon/server/lightclient.d.ts +3 -4
- package/lib/beacon/server/lightclient.js +4 -5
- package/lib/beacon/server/lightclient.js.map +1 -1
- package/lib/beacon/server/lodestar.d.ts +3 -4
- package/lib/beacon/server/lodestar.js +4 -5
- package/lib/beacon/server/lodestar.js.map +1 -1
- package/lib/beacon/server/node.d.ts +3 -4
- package/lib/beacon/server/node.js +4 -18
- package/lib/beacon/server/node.js.map +1 -1
- package/lib/beacon/server/proof.d.ts +3 -4
- package/lib/beacon/server/proof.js +4 -36
- package/lib/beacon/server/proof.js.map +1 -1
- package/lib/beacon/server/validator.d.ts +3 -4
- package/lib/beacon/server/validator.js +4 -21
- package/lib/beacon/server/validator.js.map +1 -1
- package/lib/builder/client.d.ts +4 -6
- package/lib/builder/client.js +3 -9
- package/lib/builder/client.js.map +1 -1
- package/lib/builder/index.d.ts +8 -5
- package/lib/builder/index.js +4 -1
- package/lib/builder/index.js.map +1 -1
- package/lib/builder/routes.d.ts +24 -38
- package/lib/builder/routes.js +77 -33
- package/lib/builder/routes.js.map +1 -1
- package/lib/builder/server/index.d.ts +6 -6
- package/lib/builder/server/index.js +7 -8
- package/lib/builder/server/index.js.map +1 -1
- package/lib/index.d.ts +9 -6
- package/lib/index.js +5 -4
- package/lib/index.js.map +1 -1
- package/lib/keymanager/client.d.ts +4 -3
- package/lib/keymanager/client.js +4 -7
- package/lib/keymanager/client.js.map +1 -1
- package/lib/keymanager/index.d.ts +5 -4
- package/lib/keymanager/index.js +1 -1
- package/lib/keymanager/index.js.map +1 -1
- package/lib/keymanager/routes.d.ts +155 -177
- package/lib/keymanager/routes.js +236 -123
- package/lib/keymanager/routes.js.map +1 -1
- package/lib/keymanager/server/index.d.ts +6 -6
- package/lib/keymanager/server/index.js +7 -8
- package/lib/keymanager/server/index.js.map +1 -1
- package/lib/server/index.d.ts +2 -0
- package/lib/server/index.js +3 -0
- package/lib/server/index.js.map +1 -0
- package/lib/utils/client/error.d.ts +6 -0
- package/lib/utils/client/error.js +8 -0
- package/lib/utils/client/error.js.map +1 -0
- package/lib/utils/client/httpClient.d.ts +35 -75
- package/lib/utils/client/httpClient.js +201 -153
- package/lib/utils/client/httpClient.js.map +1 -1
- package/lib/utils/client/index.d.ts +6 -2
- package/lib/utils/client/index.js +6 -2
- package/lib/utils/client/index.js.map +1 -1
- package/lib/utils/client/method.d.ts +11 -0
- package/lib/utils/client/method.js +27 -0
- package/lib/utils/client/method.js.map +1 -0
- package/lib/utils/client/request.d.ts +33 -0
- package/lib/utils/client/request.js +66 -0
- package/lib/utils/client/request.js.map +1 -0
- package/lib/utils/client/response.d.ts +35 -0
- package/lib/utils/client/response.js +166 -0
- package/lib/utils/client/response.js.map +1 -0
- package/lib/utils/codecs.d.ts +28 -0
- package/lib/utils/codecs.js +105 -0
- package/lib/utils/codecs.js.map +1 -0
- package/lib/utils/fork.d.ts +8 -0
- package/lib/utils/fork.js +35 -0
- package/lib/utils/fork.js.map +1 -0
- package/lib/utils/headers.d.ts +37 -0
- package/lib/utils/headers.js +134 -0
- package/lib/utils/headers.js.map +1 -0
- package/lib/utils/httpStatusCode.js.map +1 -0
- package/lib/utils/index.d.ts +1 -1
- package/lib/utils/index.js +1 -1
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/metadata.d.ts +88 -0
- package/lib/utils/metadata.js +126 -0
- package/lib/utils/metadata.js.map +1 -0
- package/lib/utils/schema.d.ts +31 -17
- package/lib/utils/schema.js +18 -6
- package/lib/utils/schema.js.map +1 -1
- package/lib/utils/serdes.d.ts +3 -0
- package/lib/utils/serdes.js +13 -0
- package/lib/utils/serdes.js.map +1 -1
- package/lib/utils/server/{errors.d.ts → error.d.ts} +2 -2
- package/lib/utils/server/{errors.js → error.js} +1 -1
- package/lib/utils/server/error.js.map +1 -0
- package/lib/utils/server/handler.d.ts +11 -0
- package/lib/utils/server/handler.js +109 -0
- package/lib/utils/server/handler.js.map +1 -0
- package/lib/utils/server/index.d.ts +5 -4
- package/lib/utils/server/index.js +5 -4
- package/lib/utils/server/index.js.map +1 -1
- package/lib/utils/server/method.d.ts +35 -0
- package/lib/utils/server/method.js +2 -0
- package/lib/utils/server/method.js.map +1 -0
- package/lib/utils/server/parser.d.ts +3 -0
- package/lib/utils/server/parser.js +20 -0
- package/lib/utils/server/parser.js.map +1 -0
- package/lib/utils/server/route.d.ts +20 -0
- package/lib/utils/server/route.js +19 -0
- package/lib/utils/server/route.js.map +1 -0
- package/lib/utils/types.d.ts +116 -104
- package/lib/utils/types.js +2 -155
- package/lib/utils/types.js.map +1 -1
- package/lib/utils/urlFormat.d.ts +2 -2
- package/lib/utils/urlFormat.js +3 -3
- package/lib/utils/urlFormat.js.map +1 -1
- package/lib/utils/wireFormat.d.ts +8 -0
- package/lib/utils/wireFormat.js +23 -0
- package/lib/utils/wireFormat.js.map +1 -0
- package/package.json +9 -6
- package/lib/interfaces.d.ts +0 -44
- package/lib/interfaces.js +0 -2
- package/lib/interfaces.js.map +0 -1
- package/lib/utils/acceptHeader.d.ts +0 -9
- package/lib/utils/acceptHeader.js +0 -62
- package/lib/utils/acceptHeader.js.map +0 -1
- package/lib/utils/client/client.d.ts +0 -29
- package/lib/utils/client/client.js +0 -88
- package/lib/utils/client/client.js.map +0 -1
- package/lib/utils/client/httpStatusCode.js.map +0 -1
- package/lib/utils/routes.d.ts +0 -6
- package/lib/utils/routes.js +0 -31
- package/lib/utils/routes.js.map +0 -1
- package/lib/utils/server/errors.js.map +0 -1
- package/lib/utils/server/genericJsonServer.d.ts +0 -13
- package/lib/utils/server/genericJsonServer.js +0 -32
- package/lib/utils/server/genericJsonServer.js.map +0 -1
- package/lib/utils/server/registerRoute.d.ts +0 -3
- package/lib/utils/server/registerRoute.js +0 -13
- package/lib/utils/server/registerRoute.js.map +0 -1
- package/lib/utils/server/types.d.ts +0 -22
- package/lib/utils/server/types.js +0 -2
- package/lib/utils/server/types.js.map +0 -1
- /package/lib/utils/{client/httpStatusCode.d.ts → httpStatusCode.d.ts} +0 -0
- /package/lib/utils/{client/httpStatusCode.js → httpStatusCode.js} +0 -0
|
@@ -1,9 +1,13 @@
|
|
|
1
|
+
import { ListCompositeType, ValueOf } from "@chainsafe/ssz";
|
|
1
2
|
import { SyncPeriod, allForks } from "@lodestar/types";
|
|
2
3
|
import { ForkName } from "@lodestar/params";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
4
|
+
import { ChainForkConfig } from "@lodestar/config";
|
|
5
|
+
import { Endpoint, RouteDefinitions } from "../../utils/index.js";
|
|
6
|
+
import { VersionMeta } from "../../utils/metadata.js";
|
|
7
|
+
import { EmptyArgs, EmptyMeta, EmptyRequest } from "../../utils/codecs.js";
|
|
8
|
+
export declare const HashListType: ListCompositeType<import("@chainsafe/ssz").ByteVectorType>;
|
|
9
|
+
export type HashList = ValueOf<typeof HashListType>;
|
|
10
|
+
export type Endpoints = {
|
|
7
11
|
/**
|
|
8
12
|
* Returns an array of best updates given a `startPeriod` and `count` number of sync committee period to return.
|
|
9
13
|
* Best is defined by (in order of priority):
|
|
@@ -11,73 +15,47 @@ export type Api = {
|
|
|
11
15
|
* - Has most bits
|
|
12
16
|
* - Oldest update
|
|
13
17
|
*/
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
getLightClientUpdatesByRange: Endpoint<"GET", {
|
|
19
|
+
startPeriod: SyncPeriod;
|
|
20
|
+
count: number;
|
|
21
|
+
}, {
|
|
22
|
+
query: {
|
|
23
|
+
start_period: number;
|
|
24
|
+
count: number;
|
|
25
|
+
};
|
|
26
|
+
}, allForks.LightClientUpdate[], {
|
|
27
|
+
versions: ForkName[];
|
|
28
|
+
}>;
|
|
20
29
|
/**
|
|
21
30
|
* Returns the latest optimistic head update available. Clients should use the SSE type `light_client_optimistic_update`
|
|
22
31
|
* unless to get the very first head update after syncing, or if SSE are not supported by the server.
|
|
23
32
|
*/
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
version: ForkName;
|
|
27
|
-
data: allForks.LightClientOptimisticUpdate;
|
|
28
|
-
};
|
|
29
|
-
}>>;
|
|
30
|
-
getFinalityUpdate(): Promise<ApiClientResponse<{
|
|
31
|
-
[HttpStatusCode.OK]: {
|
|
32
|
-
version: ForkName;
|
|
33
|
-
data: allForks.LightClientFinalityUpdate;
|
|
34
|
-
};
|
|
35
|
-
}>>;
|
|
33
|
+
getLightClientOptimisticUpdate: Endpoint<"GET", EmptyArgs, EmptyRequest, allForks.LightClientOptimisticUpdate, VersionMeta>;
|
|
34
|
+
getLightClientFinalityUpdate: Endpoint<"GET", EmptyArgs, EmptyRequest, allForks.LightClientFinalityUpdate, VersionMeta>;
|
|
36
35
|
/**
|
|
37
36
|
* Fetch a bootstrapping state with a proof to a trusted block root.
|
|
38
37
|
* The trusted block root should be fetched with similar means to a weak subjectivity checkpoint.
|
|
39
38
|
* Only block roots for checkpoints are guaranteed to be available.
|
|
40
39
|
*/
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
getLightClientBootstrap: Endpoint<"GET", {
|
|
41
|
+
blockRoot: string;
|
|
42
|
+
}, {
|
|
43
|
+
params: {
|
|
44
|
+
block_root: string;
|
|
45
45
|
};
|
|
46
|
-
}
|
|
46
|
+
}, allForks.LightClientBootstrap, VersionMeta>;
|
|
47
47
|
/**
|
|
48
48
|
* Returns an array of sync committee hashes based on the provided period and count
|
|
49
49
|
*/
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}>>;
|
|
55
|
-
};
|
|
56
|
-
/**
|
|
57
|
-
* Define javascript values for each route
|
|
58
|
-
*/
|
|
59
|
-
export declare const routesData: RoutesData<Api>;
|
|
60
|
-
export type ReqTypes = {
|
|
61
|
-
getUpdates: {
|
|
62
|
-
query: {
|
|
63
|
-
start_period: number;
|
|
64
|
-
count: number;
|
|
65
|
-
};
|
|
66
|
-
};
|
|
67
|
-
getOptimisticUpdate: ReqEmpty;
|
|
68
|
-
getFinalityUpdate: ReqEmpty;
|
|
69
|
-
getBootstrap: {
|
|
70
|
-
params: {
|
|
71
|
-
block_root: string;
|
|
72
|
-
};
|
|
73
|
-
};
|
|
74
|
-
getCommitteeRoot: {
|
|
50
|
+
getLightClientCommitteeRoot: Endpoint<"GET", {
|
|
51
|
+
startPeriod: SyncPeriod;
|
|
52
|
+
count: number;
|
|
53
|
+
}, {
|
|
75
54
|
query: {
|
|
76
55
|
start_period: number;
|
|
77
56
|
count: number;
|
|
78
57
|
};
|
|
79
|
-
}
|
|
58
|
+
}, HashList, EmptyMeta>;
|
|
80
59
|
};
|
|
81
|
-
export declare function
|
|
82
|
-
export declare function getReturnTypes(): ReturnTypes<Api>;
|
|
60
|
+
export declare function getDefinitions(_config: ChainForkConfig): RouteDefinitions<Endpoints>;
|
|
83
61
|
//# sourceMappingURL=lightclient.d.ts.map
|
|
@@ -1,55 +1,115 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
2
|
+
import { ListCompositeType } from "@chainsafe/ssz";
|
|
1
3
|
import { ssz } from "@lodestar/types";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export
|
|
9
|
-
getUpdates: { url: "/eth/v1/beacon/light_client/updates", method: "GET" },
|
|
10
|
-
getOptimisticUpdate: { url: "/eth/v1/beacon/light_client/optimistic_update", method: "GET" },
|
|
11
|
-
getFinalityUpdate: { url: "/eth/v1/beacon/light_client/finality_update", method: "GET" },
|
|
12
|
-
getBootstrap: { url: "/eth/v1/beacon/light_client/bootstrap/{block_root}", method: "GET" },
|
|
13
|
-
getCommitteeRoot: { url: "/eth/v0/beacon/light_client/committee_root", method: "GET" },
|
|
14
|
-
};
|
|
15
|
-
export function getReqSerializers() {
|
|
4
|
+
import { Schema } from "../../utils/index.js";
|
|
5
|
+
import { VersionCodec } from "../../utils/metadata.js";
|
|
6
|
+
import { getLightClientForkTypes, toForkName } from "../../utils/fork.js";
|
|
7
|
+
import { EmptyRequestCodec, EmptyMetaCodec, WithVersion, JsonOnlyResp, } from "../../utils/codecs.js";
|
|
8
|
+
// See /packages/api/src/routes/index.ts for reasoning and instructions to add new routes
|
|
9
|
+
export const HashListType = new ListCompositeType(ssz.Root, 10000);
|
|
10
|
+
export function getDefinitions(_config) {
|
|
16
11
|
return {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
12
|
+
getLightClientUpdatesByRange: {
|
|
13
|
+
url: "/eth/v1/beacon/light_client/updates",
|
|
14
|
+
method: "GET",
|
|
15
|
+
req: {
|
|
16
|
+
writeReq: ({ startPeriod, count }) => ({ query: { start_period: startPeriod, count } }),
|
|
17
|
+
parseReq: ({ query }) => ({ startPeriod: query.start_period, count: query.count }),
|
|
18
|
+
schema: { query: { start_period: Schema.UintRequired, count: Schema.UintRequired } },
|
|
19
|
+
},
|
|
20
|
+
resp: JsonOnlyResp({
|
|
21
|
+
data: {
|
|
22
|
+
toJson: (data, meta) => {
|
|
23
|
+
const json = [];
|
|
24
|
+
for (const [i, update] of data.entries()) {
|
|
25
|
+
json.push(getLightClientForkTypes(meta.versions[i]).LightClientUpdate.toJson(update));
|
|
26
|
+
}
|
|
27
|
+
return json;
|
|
28
|
+
},
|
|
29
|
+
fromJson: (data, meta) => {
|
|
30
|
+
const updates = data;
|
|
31
|
+
const value = [];
|
|
32
|
+
for (let i = 0; i < updates.length; i++) {
|
|
33
|
+
const version = meta.versions[i];
|
|
34
|
+
value.push(getLightClientForkTypes(version).LightClientUpdate.fromJson(updates[i]));
|
|
35
|
+
}
|
|
36
|
+
return value;
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
meta: {
|
|
40
|
+
toJson: (meta) => meta,
|
|
41
|
+
fromJson: (val) => val,
|
|
42
|
+
toHeadersObject: () => ({}),
|
|
43
|
+
fromHeaders: () => ({ versions: [] }),
|
|
44
|
+
},
|
|
45
|
+
transform: {
|
|
46
|
+
toResponse: (data, meta) => {
|
|
47
|
+
const updates = data;
|
|
48
|
+
const resp = [];
|
|
49
|
+
for (let i = 0; i < updates.length; i++) {
|
|
50
|
+
resp.push({ data: updates[i], version: meta.versions[i] });
|
|
51
|
+
}
|
|
52
|
+
return resp;
|
|
53
|
+
},
|
|
54
|
+
fromResponse: (resp) => {
|
|
55
|
+
if (!Array.isArray(resp)) {
|
|
56
|
+
throw Error("JSON is not an array");
|
|
57
|
+
}
|
|
58
|
+
const updates = [];
|
|
59
|
+
const meta = { versions: [] };
|
|
60
|
+
for (const { data, version } of resp) {
|
|
61
|
+
updates.push(data);
|
|
62
|
+
meta.versions.push(toForkName(version));
|
|
63
|
+
}
|
|
64
|
+
return { data: updates, meta };
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
}),
|
|
21
68
|
},
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
69
|
+
getLightClientOptimisticUpdate: {
|
|
70
|
+
url: "/eth/v1/beacon/light_client/optimistic_update",
|
|
71
|
+
method: "GET",
|
|
72
|
+
req: EmptyRequestCodec,
|
|
73
|
+
resp: {
|
|
74
|
+
data: WithVersion((fork) => getLightClientForkTypes(fork).LightClientOptimisticUpdate),
|
|
75
|
+
meta: VersionCodec,
|
|
76
|
+
},
|
|
28
77
|
},
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
78
|
+
getLightClientFinalityUpdate: {
|
|
79
|
+
url: "/eth/v1/beacon/light_client/finality_update",
|
|
80
|
+
method: "GET",
|
|
81
|
+
req: EmptyRequestCodec,
|
|
82
|
+
resp: {
|
|
83
|
+
data: WithVersion((fork) => getLightClientForkTypes(fork).LightClientFinalityUpdate),
|
|
84
|
+
meta: VersionCodec,
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
getLightClientBootstrap: {
|
|
88
|
+
url: "/eth/v1/beacon/light_client/bootstrap/{block_root}",
|
|
89
|
+
method: "GET",
|
|
90
|
+
req: {
|
|
91
|
+
writeReq: ({ blockRoot }) => ({ params: { block_root: blockRoot } }),
|
|
92
|
+
parseReq: ({ params }) => ({ blockRoot: params.block_root }),
|
|
93
|
+
schema: { params: { block_root: Schema.StringRequired } },
|
|
94
|
+
},
|
|
95
|
+
resp: {
|
|
96
|
+
data: WithVersion((fork) => getLightClientForkTypes(fork).LightClientBootstrap),
|
|
97
|
+
meta: VersionCodec,
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
getLightClientCommitteeRoot: {
|
|
101
|
+
url: "/eth/v0/beacon/light_client/committee_root",
|
|
102
|
+
method: "GET",
|
|
103
|
+
req: {
|
|
104
|
+
writeReq: ({ startPeriod, count }) => ({ query: { start_period: startPeriod, count } }),
|
|
105
|
+
parseReq: ({ query }) => ({ startPeriod: query.start_period, count: query.count }),
|
|
106
|
+
schema: { query: { start_period: Schema.UintRequired, count: Schema.UintRequired } },
|
|
107
|
+
},
|
|
108
|
+
resp: {
|
|
109
|
+
data: HashListType,
|
|
110
|
+
meta: EmptyMetaCodec,
|
|
111
|
+
},
|
|
33
112
|
},
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
export function getReturnTypes() {
|
|
37
|
-
// Form a TypeJson convertor for getUpdates
|
|
38
|
-
const VersionedUpdate = WithVersion((fork) => isForkLightClient(fork) ? ssz.allForksLightClient[fork].LightClientUpdate : ssz.altair.LightClientUpdate);
|
|
39
|
-
const getUpdates = {
|
|
40
|
-
toJson: (updates) => updates.map((data) => VersionedUpdate.toJson(data)),
|
|
41
|
-
fromJson: (updates) => updates.map((data) => VersionedUpdate.fromJson(data)),
|
|
42
|
-
};
|
|
43
|
-
return {
|
|
44
|
-
getUpdates,
|
|
45
|
-
getOptimisticUpdate: WithVersion((fork) => isForkLightClient(fork)
|
|
46
|
-
? ssz.allForksLightClient[fork].LightClientOptimisticUpdate
|
|
47
|
-
: ssz.altair.LightClientOptimisticUpdate),
|
|
48
|
-
getFinalityUpdate: WithVersion((fork) => isForkLightClient(fork)
|
|
49
|
-
? ssz.allForksLightClient[fork].LightClientFinalityUpdate
|
|
50
|
-
: ssz.altair.LightClientFinalityUpdate),
|
|
51
|
-
getBootstrap: WithVersion((fork) => isForkLightClient(fork) ? ssz.allForksLightClient[fork].LightClientBootstrap : ssz.altair.LightClientBootstrap),
|
|
52
|
-
getCommitteeRoot: ContainerData(ArrayOf(ssz.Root)),
|
|
53
113
|
};
|
|
54
114
|
}
|
|
55
115
|
//# sourceMappingURL=lightclient.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lightclient.js","sourceRoot":"","sources":["../../../src/beacon/routes/lightclient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"lightclient.js","sourceRoot":"","sources":["../../../src/beacon/routes/lightclient.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,OAAO,EAAC,iBAAiB,EAAU,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAAC,GAAG,EAAuB,MAAM,iBAAiB,CAAC;AAG1D,OAAO,EAA6B,MAAM,EAAC,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAAC,YAAY,EAAc,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAC,uBAAuB,EAAE,UAAU,EAAC,MAAM,qBAAqB,CAAC;AACxE,OAAO,EAEL,iBAAiB,EAEjB,cAAc,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,CAAC;gBAC9D,QAAQ,EAAE,CAAC,EAAC,MAAM,EAAC,EAAE,EAAE,CAAC,CAAC,EAAC,SAAS,EAAE,MAAM,CAAC,UAAU,EAAC,CAAC;gBACxD,MAAM,EAAE,EAAC,MAAM,EAAE,EAAC,UAAU,EAAE,MAAM,CAAC,cAAc,EAAC,EAAC;aACtD;YACD,IAAI,EAAE;gBACJ,IAAI,EAAE,WAAW,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,uBAAuB,CAAC,IAAI,CAAC,CAAC,oBAAoB,CAAC;gBAC/E,IAAI,EAAE,YAAY;aACnB;SACF;QACD,2BAA2B,EAAE;YAC3B,GAAG,EAAE,4CAA4C;YACjD,MAAM,EAAE,KAAK;YACb,GAAG,EAAE;gBACH,QAAQ,EAAE,CAAC,EAAC,WAAW,EAAE,KAAK,EAAC,EAAE,EAAE,CAAC,CAAC,EAAC,KAAK,EAAE,EAAC,YAAY,EAAE,WAAW,EAAE,KAAK,EAAC,EAAC,CAAC;gBACjF,QAAQ,EAAE,CAAC,EAAC,KAAK,EAAC,EAAE,EAAE,CAAC,CAAC,EAAC,WAAW,EAAE,KAAK,CAAC,YAAY,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAC,CAAC;gBAC9E,MAAM,EAAE,EAAC,KAAK,EAAE,EAAC,YAAY,EAAE,MAAM,CAAC,YAAY,EAAE,KAAK,EAAE,MAAM,CAAC,YAAY,EAAC,EAAC;aACjF;YACD,IAAI,EAAE;gBACJ,IAAI,EAAE,YAAY;gBAClB,IAAI,EAAE,cAAc;aACrB;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { ChainForkConfig } from "@lodestar/config";
|
|
1
2
|
import { Epoch, RootHex, Slot } from "@lodestar/types";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { ReqEmpty, ReturnTypes, ReqSerializers, RoutesData } from "../../utils/index.js";
|
|
3
|
+
import { Endpoint, RouteDefinitions } from "../../utils/index.js";
|
|
4
|
+
import { EmptyArgs, EmptyMeta, EmptyRequest, EmptyResponseData } from "../../utils/codecs.js";
|
|
5
5
|
import { FilterGetPeers, NodePeer, PeerDirection, PeerState } from "./node.js";
|
|
6
6
|
export type SyncChainDebugState = {
|
|
7
7
|
targetRoot: string | null;
|
|
@@ -53,178 +53,104 @@ export type LodestarNodePeer = NodePeer & {
|
|
|
53
53
|
agentVersion: string;
|
|
54
54
|
};
|
|
55
55
|
export type LodestarThreadType = "main" | "network" | "discv5";
|
|
56
|
-
export type
|
|
57
|
-
/** Trigger to write a heapdump
|
|
58
|
-
writeHeapdump
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
56
|
+
export type Endpoints = {
|
|
57
|
+
/** Trigger to write a heapdump to disk at `dirpath`. May take > 1min */
|
|
58
|
+
writeHeapdump: Endpoint<"POST", {
|
|
59
|
+
thread?: LodestarThreadType;
|
|
60
|
+
dirpath?: string;
|
|
61
|
+
}, {
|
|
62
|
+
query: {
|
|
63
|
+
thread?: LodestarThreadType;
|
|
64
|
+
dirpath?: string;
|
|
63
65
|
};
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
66
|
+
}, {
|
|
67
|
+
filepath: string;
|
|
68
|
+
}, EmptyMeta>;
|
|
69
|
+
/** Trigger to write 10m network thread profile to disk */
|
|
70
|
+
writeProfile: Endpoint<"POST", {
|
|
71
|
+
thread?: LodestarThreadType;
|
|
72
|
+
duration?: number;
|
|
73
|
+
dirpath?: string;
|
|
74
|
+
}, {
|
|
75
|
+
query: {
|
|
76
|
+
thread?: LodestarThreadType;
|
|
77
|
+
duration?: number;
|
|
78
|
+
dirpath?: string;
|
|
71
79
|
};
|
|
72
|
-
}
|
|
80
|
+
}, {
|
|
81
|
+
filepath: string;
|
|
82
|
+
}, EmptyMeta>;
|
|
73
83
|
/** TODO: description */
|
|
74
|
-
getLatestWeakSubjectivityCheckpointEpoch
|
|
75
|
-
[HttpStatusCode.OK]: {
|
|
76
|
-
data: Epoch;
|
|
77
|
-
};
|
|
78
|
-
}>>;
|
|
84
|
+
getLatestWeakSubjectivityCheckpointEpoch: Endpoint<"GET", EmptyArgs, EmptyRequest, Epoch, EmptyMeta>;
|
|
79
85
|
/** TODO: description */
|
|
80
|
-
getSyncChainsDebugState
|
|
81
|
-
[HttpStatusCode.OK]: {
|
|
82
|
-
data: SyncChainDebugState[];
|
|
83
|
-
};
|
|
84
|
-
}>>;
|
|
86
|
+
getSyncChainsDebugState: Endpoint<"GET", EmptyArgs, EmptyRequest, SyncChainDebugState[], EmptyMeta>;
|
|
85
87
|
/** Dump all items in a gossip queue, by gossipType */
|
|
86
|
-
getGossipQueueItems
|
|
87
|
-
|
|
88
|
-
|
|
88
|
+
getGossipQueueItems: Endpoint<"GET", {
|
|
89
|
+
gossipType: string;
|
|
90
|
+
}, {
|
|
91
|
+
params: {
|
|
92
|
+
gossipType: string;
|
|
89
93
|
};
|
|
90
|
-
}
|
|
94
|
+
}, unknown[], EmptyMeta>;
|
|
91
95
|
/** Dump all items in the regen queue */
|
|
92
|
-
getRegenQueueItems
|
|
93
|
-
[HttpStatusCode.OK]: {
|
|
94
|
-
data: RegenQueueItem[];
|
|
95
|
-
};
|
|
96
|
-
}>>;
|
|
96
|
+
getRegenQueueItems: Endpoint<"GET", EmptyArgs, EmptyRequest, RegenQueueItem[], EmptyMeta>;
|
|
97
97
|
/** Dump all items in the block processor queue */
|
|
98
|
-
getBlockProcessorQueueItems
|
|
99
|
-
[HttpStatusCode.OK]: {
|
|
100
|
-
data: BlockProcessorQueueItem[];
|
|
101
|
-
};
|
|
102
|
-
}>>;
|
|
98
|
+
getBlockProcessorQueueItems: Endpoint<"GET", EmptyArgs, EmptyRequest, BlockProcessorQueueItem[], EmptyMeta>;
|
|
103
99
|
/** Dump a summary of the states in the block state cache and checkpoint state cache */
|
|
104
|
-
getStateCacheItems
|
|
105
|
-
[HttpStatusCode.OK]: {
|
|
106
|
-
data: StateCacheItem[];
|
|
107
|
-
};
|
|
108
|
-
}>>;
|
|
100
|
+
getStateCacheItems: Endpoint<"GET", EmptyArgs, EmptyRequest, StateCacheItem[], EmptyMeta>;
|
|
109
101
|
/** Dump peer gossip stats by peer */
|
|
110
|
-
getGossipPeerScoreStats
|
|
111
|
-
[HttpStatusCode.OK]: {
|
|
112
|
-
data: GossipPeerScoreStat[];
|
|
113
|
-
};
|
|
114
|
-
}>>;
|
|
102
|
+
getGossipPeerScoreStats: Endpoint<"GET", EmptyArgs, EmptyRequest, GossipPeerScoreStat[], EmptyMeta>;
|
|
115
103
|
/** Dump lodestar score stats by peer */
|
|
116
|
-
getLodestarPeerScoreStats
|
|
117
|
-
[HttpStatusCode.OK]: {
|
|
118
|
-
data: PeerScoreStat[];
|
|
119
|
-
};
|
|
120
|
-
}>>;
|
|
104
|
+
getLodestarPeerScoreStats: Endpoint<"GET", EmptyArgs, EmptyRequest, PeerScoreStat[], EmptyMeta>;
|
|
121
105
|
/** Run GC with `global.gc()` */
|
|
122
|
-
runGC
|
|
123
|
-
[HttpStatusCode.OK]: void;
|
|
124
|
-
}>>;
|
|
106
|
+
runGC: Endpoint<"POST", EmptyArgs, EmptyRequest, EmptyResponseData, EmptyMeta>;
|
|
125
107
|
/** Drop all states in the state cache */
|
|
126
|
-
dropStateCache
|
|
127
|
-
[HttpStatusCode.OK]: void;
|
|
128
|
-
}>>;
|
|
108
|
+
dropStateCache: Endpoint<"POST", EmptyArgs, EmptyRequest, EmptyResponseData, EmptyMeta>;
|
|
129
109
|
/** Connect to peer at this multiaddress */
|
|
130
|
-
connectPeer
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
disconnectPeer(peerId: string): Promise<ApiClientResponse<{
|
|
135
|
-
[HttpStatusCode.OK]: void;
|
|
136
|
-
}>>;
|
|
137
|
-
/** Same to node api with new fields */
|
|
138
|
-
getPeers(filters?: FilterGetPeers): Promise<ApiClientResponse<{
|
|
139
|
-
[HttpStatusCode.OK]: {
|
|
140
|
-
data: LodestarNodePeer[];
|
|
141
|
-
meta: {
|
|
142
|
-
count: number;
|
|
143
|
-
};
|
|
144
|
-
};
|
|
145
|
-
}>>;
|
|
146
|
-
/** Dump Discv5 Kad values */
|
|
147
|
-
discv5GetKadValues(): Promise<ApiClientResponse<{
|
|
148
|
-
[HttpStatusCode.OK]: {
|
|
149
|
-
data: string[];
|
|
150
|
-
};
|
|
151
|
-
}>>;
|
|
152
|
-
/**
|
|
153
|
-
* Dump level-db entry keys for a given Bucket declared in code, or for all buckets.
|
|
154
|
-
* @param bucket must be the string name of a bucket entry: `allForks_blockArchive`
|
|
155
|
-
*/
|
|
156
|
-
dumpDbBucketKeys(bucket: string): Promise<ApiClientResponse<{
|
|
157
|
-
[HttpStatusCode.OK]: {
|
|
158
|
-
data: string[];
|
|
159
|
-
};
|
|
160
|
-
}>>;
|
|
161
|
-
/** Return all entries in the StateArchive index with bucket index_stateArchiveRootIndex */
|
|
162
|
-
dumpDbStateIndex(): Promise<ApiClientResponse<{
|
|
163
|
-
[HttpStatusCode.OK]: {
|
|
164
|
-
data: {
|
|
165
|
-
root: RootHex;
|
|
166
|
-
slot: Slot;
|
|
167
|
-
}[];
|
|
168
|
-
};
|
|
169
|
-
}>>;
|
|
170
|
-
};
|
|
171
|
-
/**
|
|
172
|
-
* Define javascript values for each route
|
|
173
|
-
*/
|
|
174
|
-
export declare const routesData: RoutesData<Api>;
|
|
175
|
-
export type ReqTypes = {
|
|
176
|
-
writeHeapdump: {
|
|
177
|
-
query: {
|
|
178
|
-
thread?: LodestarThreadType;
|
|
179
|
-
dirpath?: string;
|
|
180
|
-
};
|
|
181
|
-
};
|
|
182
|
-
writeProfile: {
|
|
183
|
-
query: {
|
|
184
|
-
thread?: LodestarThreadType;
|
|
185
|
-
duration?: number;
|
|
186
|
-
dirpath?: string;
|
|
187
|
-
};
|
|
188
|
-
};
|
|
189
|
-
getLatestWeakSubjectivityCheckpointEpoch: ReqEmpty;
|
|
190
|
-
getSyncChainsDebugState: ReqEmpty;
|
|
191
|
-
getGossipQueueItems: {
|
|
192
|
-
params: {
|
|
193
|
-
gossipType: string;
|
|
194
|
-
};
|
|
195
|
-
};
|
|
196
|
-
getRegenQueueItems: ReqEmpty;
|
|
197
|
-
getBlockProcessorQueueItems: ReqEmpty;
|
|
198
|
-
getStateCacheItems: ReqEmpty;
|
|
199
|
-
getGossipPeerScoreStats: ReqEmpty;
|
|
200
|
-
getLodestarPeerScoreStats: ReqEmpty;
|
|
201
|
-
runGC: ReqEmpty;
|
|
202
|
-
dropStateCache: ReqEmpty;
|
|
203
|
-
connectPeer: {
|
|
110
|
+
connectPeer: Endpoint<"POST", {
|
|
111
|
+
peerId: string;
|
|
112
|
+
multiaddrs: string[];
|
|
113
|
+
}, {
|
|
204
114
|
query: {
|
|
205
115
|
peerId: string;
|
|
206
116
|
multiaddr: string[];
|
|
207
117
|
};
|
|
208
|
-
}
|
|
209
|
-
|
|
118
|
+
}, EmptyResponseData, EmptyMeta>;
|
|
119
|
+
/** Disconnect peer */
|
|
120
|
+
disconnectPeer: Endpoint<"POST", {
|
|
121
|
+
peerId: string;
|
|
122
|
+
}, {
|
|
210
123
|
query: {
|
|
211
124
|
peerId: string;
|
|
212
125
|
};
|
|
213
|
-
}
|
|
214
|
-
|
|
126
|
+
}, EmptyResponseData, EmptyMeta>;
|
|
127
|
+
/** Same to node api with new fields */
|
|
128
|
+
getPeers: Endpoint<"GET", FilterGetPeers, {
|
|
215
129
|
query: {
|
|
216
130
|
state?: PeerState[];
|
|
217
131
|
direction?: PeerDirection[];
|
|
218
132
|
};
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
|
|
133
|
+
}, LodestarNodePeer[], {
|
|
134
|
+
count: number;
|
|
135
|
+
}>;
|
|
136
|
+
/** Dump Discv5 Kad values */
|
|
137
|
+
discv5GetKadValues: Endpoint<"GET", EmptyArgs, EmptyRequest, string[], EmptyMeta>;
|
|
138
|
+
/**
|
|
139
|
+
* Dump level-db entry keys for a given Bucket declared in code, or for all buckets.
|
|
140
|
+
*/
|
|
141
|
+
dumpDbBucketKeys: Endpoint<"GET", {
|
|
142
|
+
/** Must be the string name of a bucket entry: `allForks_blockArchive` */
|
|
143
|
+
bucket: string;
|
|
144
|
+
}, {
|
|
222
145
|
params: {
|
|
223
146
|
bucket: string;
|
|
224
147
|
};
|
|
225
|
-
}
|
|
226
|
-
|
|
148
|
+
}, string[], EmptyMeta>;
|
|
149
|
+
/** Return all entries in the StateArchive index with bucket index_stateArchiveRootIndex */
|
|
150
|
+
dumpDbStateIndex: Endpoint<"GET", EmptyArgs, EmptyRequest, {
|
|
151
|
+
root: RootHex;
|
|
152
|
+
slot: Slot;
|
|
153
|
+
}[], EmptyMeta>;
|
|
227
154
|
};
|
|
228
|
-
export declare function
|
|
229
|
-
export declare function getReturnTypes(): ReturnTypes<Api>;
|
|
155
|
+
export declare function getDefinitions(_config: ChainForkConfig): RouteDefinitions<Endpoints>;
|
|
230
156
|
//# sourceMappingURL=lodestar.d.ts.map
|