@lodestar/light-client 1.23.0-dev.ad4ec7713d → 1.23.0-dev.b457778eef
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 +3 -3
- package/lib/utils/api.d.ts +2 -2
- package/lib/utils/api.js +2 -2
- package/lib/utils/api.js.map +1 -1
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -62,7 +62,7 @@ import {
|
|
|
62
62
|
|
|
63
63
|
const config = getChainForkConfigFromNetwork("sepolia");
|
|
64
64
|
const logger = getConsoleLogger({logDebug: Boolean(process.env.DEBUG)});
|
|
65
|
-
const api = getApiFromUrl(
|
|
65
|
+
const api = getApiFromUrl("https://lodestar-sepolia.chainsafe.io", "sepolia");
|
|
66
66
|
|
|
67
67
|
const lightclient = await Lightclient.initializeFromCheckpointRoot({
|
|
68
68
|
config,
|
|
@@ -82,11 +82,11 @@ await lightclient.start();
|
|
|
82
82
|
logger.info("Lightclient synced");
|
|
83
83
|
|
|
84
84
|
lightclient.emitter.on(LightclientEvent.lightClientFinalityHeader, async (finalityUpdate) => {
|
|
85
|
-
logger.info(finalityUpdate);
|
|
85
|
+
logger.info("Received finality update", {slot: finalityUpdate.beacon.slot});
|
|
86
86
|
});
|
|
87
87
|
|
|
88
88
|
lightclient.emitter.on(LightclientEvent.lightClientOptimisticHeader, async (optimisticUpdate) => {
|
|
89
|
-
logger.info(optimisticUpdate);
|
|
89
|
+
logger.info("Received optimistic update", {slot: optimisticUpdate.beacon.slot});
|
|
90
90
|
});
|
|
91
91
|
```
|
|
92
92
|
|
package/lib/utils/api.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ApiClient } from "@lodestar/api";
|
|
1
|
+
import { ApiClient, ApiRequestInit } from "@lodestar/api";
|
|
2
2
|
import { ChainForkConfig } from "@lodestar/config";
|
|
3
3
|
import { NetworkName } from "@lodestar/config/networks";
|
|
4
|
-
export declare function getApiFromUrl(url: string, network: NetworkName): ApiClient;
|
|
4
|
+
export declare function getApiFromUrl(url: string, network: NetworkName, init?: ApiRequestInit): ApiClient;
|
|
5
5
|
export declare function getChainForkConfigFromNetwork(network: NetworkName): ChainForkConfig;
|
|
6
6
|
//# sourceMappingURL=api.d.ts.map
|
package/lib/utils/api.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { getClient } from "@lodestar/api";
|
|
2
2
|
import { createChainForkConfig } from "@lodestar/config";
|
|
3
3
|
import { networksChainConfig } from "@lodestar/config/networks";
|
|
4
|
-
export function getApiFromUrl(url, network) {
|
|
4
|
+
export function getApiFromUrl(url, network, init) {
|
|
5
5
|
if (!(network in networksChainConfig)) {
|
|
6
6
|
throw Error(`Invalid network name "${network}". Valid options are: ${Object.keys(networksChainConfig).join()}`);
|
|
7
7
|
}
|
|
8
|
-
return getClient({ urls: [url] }, { config: createChainForkConfig(networksChainConfig[network]) });
|
|
8
|
+
return getClient({ urls: [url], globalInit: init }, { config: createChainForkConfig(networksChainConfig[network]) });
|
|
9
9
|
}
|
|
10
10
|
export function getChainForkConfigFromNetwork(network) {
|
|
11
11
|
if (!(network in networksChainConfig)) {
|
package/lib/utils/api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/utils/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/utils/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAA4B,MAAM,eAAe,CAAC;AACnE,OAAO,EAAkB,qBAAqB,EAAC,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAAc,mBAAmB,EAAC,MAAM,2BAA2B,CAAC;AAE3E,MAAM,UAAU,aAAa,CAAC,GAAW,EAAE,OAAoB,EAAE,IAAqB;IACpF,IAAI,CAAC,CAAC,OAAO,IAAI,mBAAmB,CAAC,EAAE,CAAC;QACtC,MAAM,KAAK,CAAC,yBAAyB,OAAO,yBAAyB,MAAM,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IAClH,CAAC;IAED,OAAO,SAAS,CAAC,EAAC,IAAI,EAAE,CAAC,GAAG,CAAC,EAAE,UAAU,EAAE,IAAI,EAAC,EAAE,EAAC,MAAM,EAAE,qBAAqB,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC,EAAC,CAAC,CAAC;AACnH,CAAC;AAED,MAAM,UAAU,6BAA6B,CAAC,OAAoB;IAChE,IAAI,CAAC,CAAC,OAAO,IAAI,mBAAmB,CAAC,EAAE,CAAC;QACtC,MAAM,KAAK,CAAC,yBAAyB,OAAO,yBAAyB,MAAM,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IAClH,CAAC;IAED,OAAO,qBAAqB,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC,CAAC;AAC7D,CAAC"}
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"bugs": {
|
|
12
12
|
"url": "https://github.com/ChainSafe/lodestar/issues"
|
|
13
13
|
},
|
|
14
|
-
"version": "1.23.0-dev.
|
|
14
|
+
"version": "1.23.0-dev.b457778eef",
|
|
15
15
|
"type": "module",
|
|
16
16
|
"exports": {
|
|
17
17
|
".": {
|
|
@@ -77,11 +77,11 @@
|
|
|
77
77
|
"@chainsafe/blst": "^0.2.0",
|
|
78
78
|
"@chainsafe/persistent-merkle-tree": "^0.8.0",
|
|
79
79
|
"@chainsafe/ssz": "^0.17.1",
|
|
80
|
-
"@lodestar/api": "1.23.0-dev.
|
|
81
|
-
"@lodestar/config": "1.23.0-dev.
|
|
82
|
-
"@lodestar/params": "1.23.0-dev.
|
|
83
|
-
"@lodestar/types": "1.23.0-dev.
|
|
84
|
-
"@lodestar/utils": "1.23.0-dev.
|
|
80
|
+
"@lodestar/api": "1.23.0-dev.b457778eef",
|
|
81
|
+
"@lodestar/config": "1.23.0-dev.b457778eef",
|
|
82
|
+
"@lodestar/params": "1.23.0-dev.b457778eef",
|
|
83
|
+
"@lodestar/types": "1.23.0-dev.b457778eef",
|
|
84
|
+
"@lodestar/utils": "1.23.0-dev.b457778eef",
|
|
85
85
|
"mitt": "^3.0.0"
|
|
86
86
|
},
|
|
87
87
|
"devDependencies": {
|
|
@@ -98,5 +98,5 @@
|
|
|
98
98
|
"light-client",
|
|
99
99
|
"blockchain"
|
|
100
100
|
],
|
|
101
|
-
"gitHead": "
|
|
101
|
+
"gitHead": "81f7ccc3f487c5808767ed334b2b5cadaaf3fb9a"
|
|
102
102
|
}
|