-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(node-wasm)!: Webpack compatibility (#377)
Signed-off-by: Mikołaj Florkiewicz <[email protected]> Co-authored-by: Maciej Zwoliński <[email protected]>
- Loading branch information
Showing
15 changed files
with
529 additions
and
566 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/** | ||
* Spawn a worker running lumina node and get the `NodeClient` connected to it. | ||
*/ | ||
export function spawnNode(): Promise<NodeClient>; | ||
export * from "lumina-node-wasm"; | ||
export default function init(): Promise<void>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import init, { NodeClient } from "lumina-node-wasm" | ||
|
||
/** | ||
* Spawn a worker running lumina node and get the `NodeClient` connected to it. | ||
*/ | ||
export async function spawnNode() { | ||
await init(); | ||
let worker = new Worker(new URL("worker.js", import.meta.url)); | ||
let client = await new NodeClient(worker); | ||
return client; | ||
} | ||
|
||
export * from "lumina-node-wasm"; | ||
export default init; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"name": "lumina-node", | ||
"type": "module", | ||
"collaborators": [ | ||
"Eiger <[email protected]>" | ||
], | ||
"description": "Lumina node for Celestia, running in browser", | ||
"version": "0.2.0", | ||
"license": "Apache-2.0", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/eigerco/lumina.git" | ||
}, | ||
"files": [ | ||
"index.js", | ||
"index.d.ts", | ||
"worker.js" | ||
], | ||
"main": "index.js", | ||
"homepage": "https://www.eiger.co", | ||
"dependencies": { | ||
"lumina-node-wasm": "0.2.0" | ||
}, | ||
"keywords": [ | ||
"blockchain", | ||
"celestia", | ||
"lumina", | ||
"node", | ||
"browser" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import init, { NodeWorker, NodeClient } from "lumina-node-wasm" | ||
|
||
Error.stackTraceLimit = 99; | ||
|
||
init().then(async () => { | ||
let worker = new NodeWorker(self); | ||
console.log("starting worker: ", worker); | ||
|
||
await worker.run(); | ||
}); |
Oops, something went wrong.