# Function: startNodeInWorker()

```ts
function startNodeInWorker(
   worker, 
   config, 
   startTimeoutMs?
): Promise<P2PNode>;
```

Defined in: [packages/core/src/node/worker.ts:85](https://github.com/leifriksheim/minca/blob/main/core/src/node/worker.ts#L85)

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`](https://minca.dev/api/core/interfaces/WorkerLike.md) | `undefined` | Running `runNodeWorker`, as `@minca/core/node-worker` does |
| `config` | [`WorkerNodeConfig`](https://minca.dev/api/core/interfaces/WorkerNodeConfig.md) & `object` | `undefined` | - |
| `startTimeoutMs?` | `number` | `30_000` | How long to wait for the worker to say the node started. Default 30 s. |

## Returns

`Promise`\<[`P2PNode`](https://minca.dev/api/core/interfaces/P2PNode.md)\>

## Throws

When the worker could not start the node, with its reason, or said nothing in time
