minca
ApiCoreInterfaces

Interface: P2PNode

Defined in: packages/core/src/node/types.ts:1035

Properties

PropertyModifierTypeDescriptionDefined in
accountreadonlyNodeAccountThe account itself — its name, synced through the account registrypackages/core/src/node/types.ts:1044
automationsreadonlyNodeAutomationsThe account's own automations, kept in its registrypackages/core/src/node/types.ts:1050
carriersreadonlyNodeCarriersNodes that keep the account's spaces online without reading thempackages/core/src/node/types.ts:1046
collectionsreadonlyNodeCollections-packages/core/src/node/types.ts:1042
contactsreadonlyNodeContactsPeople: the account's contact list, and asking to be addedpackages/core/src/node/types.ts:1052
didreadonlystringThe identity this node acts forpackages/core/src/node/types.ts:1037
directreadonlyNodeDirectDirect messages: text only some members of a space can readpackages/core/src/node/types.ts:1054
hostingreadonlyNodeHostingHosts the account pays to keep its spaces onlinepackages/core/src/node/types.ts:1048
inboxreadonlyNodeInboxThe inbox: how people you share no space with can ask to become your contactpackages/core/src/node/types.ts:1056
networkreadonlyNodeNetworkRelays and connections, for showing why a peer is or is not therepackages/core/src/node/types.ts:1069
recordsreadonlyNodeRecords-packages/core/src/node/types.ts:1041
sessionDidreadonlystringThe session key that signs and connects; stable for the node's lifetimepackages/core/src/node/types.ts:1039
spacesreadonlyNodeSpaces-packages/core/src/node/types.ts:1040

Methods

asAgent()

asAgent(agent): Promise<P2PNode>;

Defined in: packages/core/src/node/types.ts:1074

The same node acting as an agent, only in the spaces its note names (node/api.ts).

Parameters

ParameterType
agent{ keys: CryptoKeyPair; note: Delegation; }
agent.keysCryptoKeyPair
agent.noteDelegation

Returns

Promise<P2PNode>

Throws

When the note is not an agent's, has run out, or is not made out to keys


close()

close(): Promise<void>;

Defined in: packages/core/src/node/types.ts:1086

Returns

Promise<void>


delegation()

delegation(): Delegation;

Defined in: packages/core/src/node/types.ts:1058

The delegation the session key currently writes under (root → session)

Returns

Delegation


iceServers()

iceServers(): Promise<readonly RTCIceServer[]>;

Defined in: packages/core/src/node/types.ts:1060

ICE servers for the app's own WebRTC: the configured ones, and a relay's TURN servers

Returns

Promise<readonly RTCIceServer[]>


revokeKey()

revokeKey(key, options?): Promise<boolean>;

Defined in: packages/core/src/node/types.ts:1080

Revokes a key of this account in spaces, or everywhere the account writes. True once a peer took each in, or at once without waitMs.

Parameters

ParameterType
keystring
options?RevokeOptions & object

Returns

Promise<boolean>


revokeSelf()

revokeSelf(options?): Promise<void>;

Defined in: packages/core/src/node/types.ts:1085

Revokes this node's own key everywhere and forgets a lasting one: for signing out

Parameters

ParameterType
options?RevokeOptions

Returns

Promise<void>


setFileLimits()

setFileLimits(limits): Promise<void>;

Defined in: packages/core/src/node/types.ts:1067

How much of others' files this device fetches before anyone reads them, and keeps per space, from now on: a person's choice, such as fewer downloads on a phone. Not kept: give it again each time the node starts.

Parameters

ParameterType
limitsFileLimits

Returns

Promise<void>

Throws

When either is not a byte count of 0 or more


subscribe()

subscribe(listener): () => void;

Defined in: packages/core/src/node/types.ts:1075

Parameters

ParameterType
listener(event) => void

Returns

() => void

On this page