minca
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

ParameterTypeDefault valueDescription
workerWorkerLikeundefinedRunning runNodeWorker, as @minca/core/node-worker does
configWorkerNodeConfig & objectundefined-
startTimeoutMs?number30_000How 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

On this page