mirror of
https://github.com/pezkuwichain/bizinikiwi-connect.git
synced 2026-04-22 00:47:54 +00:00
13 lines
391 B
TypeScript
13 lines
391 B
TypeScript
import * as smoldot from "smoldot/worker"
|
|
import { compileBytecode } from "smoldot/bytecode"
|
|
import { parentPort } from "node:worker_threads"
|
|
|
|
compileBytecode().then((bytecode: any) => parentPort!.postMessage(bytecode))
|
|
|
|
parentPort!.once("message", (data) =>
|
|
smoldot
|
|
.run(data)
|
|
.catch((error: any) => console.error("[smoldot-worker]", error))
|
|
.finally(() => process.exit()),
|
|
)
|