Interface: P2PNode
Defined in: packages/core/src/node/types.ts:1035
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
account | readonly | NodeAccount | The account itself — its name, synced through the account registry | packages/core/src/node/types.ts:1044 |
automations | readonly | NodeAutomations | The account's own automations, kept in its registry | packages/core/src/node/types.ts:1050 |
carriers | readonly | NodeCarriers | Nodes that keep the account's spaces online without reading them | packages/core/src/node/types.ts:1046 |
collections | readonly | NodeCollections | - | packages/core/src/node/types.ts:1042 |
contacts | readonly | NodeContacts | People: the account's contact list, and asking to be added | packages/core/src/node/types.ts:1052 |
did | readonly | string | The identity this node acts for | packages/core/src/node/types.ts:1037 |
direct | readonly | NodeDirect | Direct messages: text only some members of a space can read | packages/core/src/node/types.ts:1054 |
hosting | readonly | NodeHosting | Hosts the account pays to keep its spaces online | packages/core/src/node/types.ts:1048 |
inbox | readonly | NodeInbox | The inbox: how people you share no space with can ask to become your contact | packages/core/src/node/types.ts:1056 |
network | readonly | NodeNetwork | Relays and connections, for showing why a peer is or is not there | packages/core/src/node/types.ts:1069 |
records | readonly | NodeRecords | - | packages/core/src/node/types.ts:1041 |
sessionDid | readonly | string | The session key that signs and connects; stable for the node's lifetime | packages/core/src/node/types.ts:1039 |
spaces | readonly | NodeSpaces | - | 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
| Parameter | Type |
|---|---|
agent | { keys: CryptoKeyPair; note: Delegation; } |
agent.keys | CryptoKeyPair |
agent.note | Delegation |
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
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
| Parameter | Type |
|---|---|
key | string |
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
| Parameter | Type |
|---|---|
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
| Parameter | Type |
|---|---|
limits | FileLimits |
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
| Parameter | Type |
|---|---|
listener | (event) => void |
Returns
() => void