Compare commits
No commits in common. "v0.1.0-develop.3" and "v0.1.0-develop.2" have entirely different histories.
v0.1.0-dev
...
v0.1.0-dev
|
@ -1,5 +1,3 @@
|
||||||
# [0.1.0-develop.3](https://git.lumeweb.com/LumeWeb/kernel-eth/compare/v0.1.0-develop.2...v0.1.0-develop.3) (2023-11-17)
|
|
||||||
|
|
||||||
# [0.1.0-develop.2](https://git.lumeweb.com/LumeWeb/kernel-eth/compare/v0.1.0-develop.1...v0.1.0-develop.2) (2023-10-13)
|
# [0.1.0-develop.2](https://git.lumeweb.com/LumeWeb/kernel-eth/compare/v0.1.0-develop.1...v0.1.0-develop.2) (2023-10-13)
|
||||||
|
|
||||||
# [0.1.0-develop.1](https://git.lumeweb.com/LumeWeb/kernel-eth/compare/v0.0.1...v0.1.0-develop.1) (2023-10-12)
|
# [0.1.0-develop.1](https://git.lumeweb.com/LumeWeb/kernel-eth/compare/v0.0.1...v0.1.0-develop.1) (2023-10-12)
|
||||||
|
|
|
@ -1,20 +1,19 @@
|
||||||
{
|
{
|
||||||
"name": "@lumeweb/kernel-eth",
|
"name": "@lumeweb/kernel-eth",
|
||||||
"version": "0.1.0-develop.3",
|
"version": "0.1.0-develop.2",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@lumeweb/kernel-eth",
|
"name": "@lumeweb/kernel-eth",
|
||||||
"version": "0.1.0-develop.3",
|
"version": "0.1.0-develop.2",
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@lumeweb/bigint-crypto-utils": "1.0.0",
|
"@lumeweb/bigint-crypto-utils": "1.0.0",
|
||||||
"@lumeweb/kernel-lavanet-client": "^0.1.0-develop.6",
|
|
||||||
"@lumeweb/kernel-network-registry-client": "^0.1.0-develop.10",
|
"@lumeweb/kernel-network-registry-client": "^0.1.0-develop.10",
|
||||||
"@lumeweb/kernel-rpc-client": "0.0.2-develop.18",
|
"@lumeweb/kernel-rpc-client": "0.0.2-develop.18",
|
||||||
"@lumeweb/libethsync": "0.1.0-develop.63",
|
"@lumeweb/libethsync": "0.1.0-develop.61",
|
||||||
"@lumeweb/libkernel": "0.1.0-develop.66",
|
"@lumeweb/libkernel": "0.1.0-develop.66",
|
||||||
"level": "^8.0.0",
|
"level": "^8.0.0",
|
||||||
"p-defer": "^4.0.0"
|
"p-defer": "^4.0.0"
|
||||||
|
@ -3102,72 +3101,6 @@
|
||||||
"@lumeweb/relay-cfg": "0.1.9"
|
"@lumeweb/relay-cfg": "0.1.9"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@lumeweb/kernel-lavanet-client": {
|
|
||||||
"version": "0.1.0-develop.6",
|
|
||||||
"resolved": "https://registry.npmjs.org/@lumeweb/kernel-lavanet-client/-/kernel-lavanet-client-0.1.0-develop.6.tgz",
|
|
||||||
"integrity": "sha512-uM8mqiRPQYDaHtNrZXs1/jg9gl3hZj2cA/DMb+FwBMxkuEG87EV3ZNlpGhCKY7WGBwP0LYyXP3Aj7GSLVCb03w==",
|
|
||||||
"dependencies": {
|
|
||||||
"@lumeweb/libkernel": "^0.1.0-develop.67"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@lumeweb/kernel-lavanet-client/node_modules/@lumeweb/libkernel": {
|
|
||||||
"version": "0.1.0-develop.67",
|
|
||||||
"resolved": "https://registry.npmjs.org/@lumeweb/libkernel/-/libkernel-0.1.0-develop.67.tgz",
|
|
||||||
"integrity": "sha512-1GPaMO20agALnxjkqkswaXW+s6CpdqsvwgrdOgC4WkGdY4P4z3mD08FEqkvaVnVQpcJdUqPlLurQddCP+m0Y7g==",
|
|
||||||
"dependencies": {
|
|
||||||
"@lumeweb/libweb": "0.2.0-develop.60",
|
|
||||||
"emittery": "^1.0.1",
|
|
||||||
"p-defer": "^4.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@lumeweb/kernel-lavanet-client/node_modules/@lumeweb/libportal": {
|
|
||||||
"version": "0.2.0-develop.40",
|
|
||||||
"resolved": "https://registry.npmjs.org/@lumeweb/libportal/-/libportal-0.2.0-develop.40.tgz",
|
|
||||||
"integrity": "sha512-vtdYK92JFUGR1VxQxwghcb5eTLXx8J4wlnCWNpfbNlSEkABJPzM+V5BAhfIqO1d3M55FUBLpIb+h4nibxflcRA==",
|
|
||||||
"dependencies": {
|
|
||||||
"@lumeweb/libs5": "^0.1.0-develop.60",
|
|
||||||
"@noble/curves": "^1.1.0",
|
|
||||||
"@noble/hashes": "^1.3.1",
|
|
||||||
"detect-node": "^2.1.0",
|
|
||||||
"multiformats": "^11.0.2",
|
|
||||||
"node-fetch": "^3.3.1",
|
|
||||||
"p-defer": "^4.0.0",
|
|
||||||
"stream-to-blob": "^2.0.1",
|
|
||||||
"tus-js-client": "^3.1.0",
|
|
||||||
"web-streams-polyfill": "^3.2.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@lumeweb/kernel-lavanet-client/node_modules/@lumeweb/libweb": {
|
|
||||||
"version": "0.2.0-develop.60",
|
|
||||||
"resolved": "https://registry.npmjs.org/@lumeweb/libweb/-/libweb-0.2.0-develop.60.tgz",
|
|
||||||
"integrity": "sha512-GNgc+OwRp/Lz8fnQ5r5aWJchdWDoClXS1T+Vg3i3KZ73RMcbBvOG2dwliLW6RWl6spFjw+BunwexQxLz6BzqjA==",
|
|
||||||
"dependencies": {
|
|
||||||
"@lumeweb/community-portals": "^0.1.0-develop.6",
|
|
||||||
"@lumeweb/libportal": "0.2.0-develop.40",
|
|
||||||
"@lumeweb/node-library-preset": "0.2.7",
|
|
||||||
"@noble/ciphers": "^0.3.0",
|
|
||||||
"@noble/curves": "^1.1.0",
|
|
||||||
"@noble/hashes": "^1.3.1",
|
|
||||||
"binconv": "^0.2.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@lumeweb/kernel-lavanet-client/node_modules/node-fetch": {
|
|
||||||
"version": "3.3.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz",
|
|
||||||
"integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==",
|
|
||||||
"dependencies": {
|
|
||||||
"data-uri-to-buffer": "^4.0.0",
|
|
||||||
"fetch-blob": "^3.1.4",
|
|
||||||
"formdata-polyfill": "^4.0.10"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"type": "opencollective",
|
|
||||||
"url": "https://opencollective.com/node-fetch"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@lumeweb/kernel-network-registry-client": {
|
"node_modules/@lumeweb/kernel-network-registry-client": {
|
||||||
"version": "0.1.0-develop.10",
|
"version": "0.1.0-develop.10",
|
||||||
"resolved": "https://registry.npmjs.org/@lumeweb/kernel-network-registry-client/-/kernel-network-registry-client-0.1.0-develop.10.tgz",
|
"resolved": "https://registry.npmjs.org/@lumeweb/kernel-network-registry-client/-/kernel-network-registry-client-0.1.0-develop.10.tgz",
|
||||||
|
@ -3187,9 +3120,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@lumeweb/libethsync": {
|
"node_modules/@lumeweb/libethsync": {
|
||||||
"version": "0.1.0-develop.63",
|
"version": "0.1.0-develop.61",
|
||||||
"resolved": "https://registry.npmjs.org/@lumeweb/libethsync/-/libethsync-0.1.0-develop.63.tgz",
|
"resolved": "https://registry.npmjs.org/@lumeweb/libethsync/-/libethsync-0.1.0-develop.61.tgz",
|
||||||
"integrity": "sha512-mQWFRekVkj7Bc2j5vuZzcYuOAT6M5ybYJjcuZqHFpdDOvVkUX+KY86xpcKFbIytROS4cFl/YYkBc84b/fAdMhA==",
|
"integrity": "sha512-nbRqyam3spbTvrER/Dk6V6UY4gsh4rsyJ21HaIi0QAEXdFYhi8HAuofNwfpXiOBIUkLNVRaUCXayPVqC/2xM4Q==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@chainsafe/as-sha256": "^0.3.1",
|
"@chainsafe/as-sha256": "^0.3.1",
|
||||||
"@chainsafe/bls": "7.1.1",
|
"@chainsafe/bls": "7.1.1",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@lumeweb/kernel-eth",
|
"name": "@lumeweb/kernel-eth",
|
||||||
"version": "0.1.0-develop.3",
|
"version": "0.1.0-develop.2",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"readme": "ERROR: No README data found!",
|
"readme": "ERROR: No README data found!",
|
||||||
|
@ -22,10 +22,9 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@lumeweb/bigint-crypto-utils": "1.0.0",
|
"@lumeweb/bigint-crypto-utils": "1.0.0",
|
||||||
"@lumeweb/kernel-lavanet-client": "^0.1.0-develop.6",
|
|
||||||
"@lumeweb/kernel-network-registry-client": "^0.1.0-develop.10",
|
"@lumeweb/kernel-network-registry-client": "^0.1.0-develop.10",
|
||||||
"@lumeweb/kernel-rpc-client": "0.0.2-develop.18",
|
"@lumeweb/kernel-rpc-client": "0.0.2-develop.18",
|
||||||
"@lumeweb/libethsync": "0.1.0-develop.63",
|
"@lumeweb/libethsync": "0.1.0-develop.61",
|
||||||
"@lumeweb/libkernel": "0.1.0-develop.66",
|
"@lumeweb/libkernel": "0.1.0-develop.66",
|
||||||
"level": "^8.0.0",
|
"level": "^8.0.0",
|
||||||
"p-defer": "^4.0.0"
|
"p-defer": "^4.0.0"
|
||||||
|
|
26
src/index.ts
26
src/index.ts
|
@ -18,10 +18,6 @@ import {
|
||||||
import * as capella from "@lodestar/types/capella";
|
import * as capella from "@lodestar/types/capella";
|
||||||
import defer from "p-defer";
|
import defer from "p-defer";
|
||||||
import { Level } from "level";
|
import { Level } from "level";
|
||||||
import {
|
|
||||||
type LavaNetClient,
|
|
||||||
createClient as createLavanetClient,
|
|
||||||
} from "@lumeweb/kernel-lavanet-client";
|
|
||||||
|
|
||||||
onmessage = handleMessage;
|
onmessage = handleMessage;
|
||||||
|
|
||||||
|
@ -32,7 +28,6 @@ const moduleReadyDefer = defer();
|
||||||
const clientInitDefer = defer();
|
const clientInitDefer = defer();
|
||||||
|
|
||||||
let client: EthClient;
|
let client: EthClient;
|
||||||
let lavanet: LavaNetClient;
|
|
||||||
let rpc: RpcNetwork;
|
let rpc: RpcNetwork;
|
||||||
const db = new Level<number | string, Uint8Array>("consensus", {
|
const db = new Level<number | string, Uint8Array>("consensus", {
|
||||||
valueEncoding: "buffer",
|
valueEncoding: "buffer",
|
||||||
|
@ -117,12 +112,29 @@ async function consensusHandler(method: string, data: any) {
|
||||||
|
|
||||||
async function executionHandler(data: Map<string, string | any>) {
|
async function executionHandler(data: Map<string, string | any>) {
|
||||||
await rpc.ready;
|
await rpc.ready;
|
||||||
return await lavanet.query("ETH1", data);
|
while (true) {
|
||||||
|
let query = await rpc.simpleQuery({
|
||||||
|
query: {
|
||||||
|
module: "eth",
|
||||||
|
method: "execution_request",
|
||||||
|
data,
|
||||||
|
},
|
||||||
|
options: {
|
||||||
|
relayTimeout: 30,
|
||||||
|
queryTimeout: 30,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
let ret = await query.result;
|
||||||
|
|
||||||
|
if (ret.data) {
|
||||||
|
return ret.data;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function setup() {
|
async function setup() {
|
||||||
rpc = createRpcClient();
|
rpc = createRpcClient();
|
||||||
lavanet = createLavanetClient();
|
|
||||||
await db.open();
|
await db.open();
|
||||||
await rpc.ready;
|
await rpc.ready;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue