minca
ApiSessionFunctions

Function: startConnectedNode()

function startConnectedNode(params): Promise<P2PNode>;

Defined in: packages/core/src/session/connect.ts:638

Starts a node acting for the account, under a grant.

It joins the granted spaces (again, harmlessly, on later starts) and keeps its data in this site's storage. It has no account key: it sees the spaces it was given, not the account's whole list.

In a space that names a keeper it holds only the collections the app uses (cache); pass cache: false to hold every space whole.

Parameters

ParameterTypeDescription
params{ cache?: | false | CacheConfig; grant: Grant; key?: AppKey; network?: NodeNetworkConfig; stores?: StoreFactory; worker?: () => WorkerLike; }-
params.cache?| false | CacheConfig-
params.grantGrant-
params.key?AppKey-
params.network?NodeNetworkConfig-
params.stores?StoreFactory-
params.worker?() => WorkerLikeRuns the node in a worker, off the page's main thread. Not with stores, which a worker can't be handed.

Returns

Promise<P2PNode>

On this page