ApiCoreFunctions
Function: startNodeInWorker()
function startNodeInWorker(
worker,
config,
startTimeoutMs?
): Promise<P2PNode>;Defined in: packages/core/src/node/worker.ts:85
Starts a node in worker, or joins the one it already runs for the same
account and stores (a SharedWorker), and returns it, used from here.
Closing it lets go of it from this tab: the signer and connections kept
here stop, a dedicated worker ends, and a shared node closes once no tab
uses it.
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
worker | WorkerLike | undefined | Running runNodeWorker, as @minca/core/node-worker does |
config | WorkerNodeConfig & object | undefined | - |
startTimeoutMs? | number | 30_000 | How long to wait for the worker to say the node started. Default 30 s. |
Returns
Promise<P2PNode>
Throws
When the worker could not start the node, with its reason, or said nothing in time