Skip to content

Documentation / @super-line/adapter-libp2p / Libp2pAdapterOptions

Interface: Libp2pAdapterOptions

Defined in: index.ts:19

Options for createLibp2pAdapter.

Properties

bootstrap?

optional bootstrap?: string[]

Defined in: index.ts:34

Bootstrap seed multiaddrs (incl. /p2p/<peerId>) the built-in node dials on startup.


identity?

optional identity?: PrivateKey | { path: string; }

Defined in: index.ts:42

Peer identity for the built-in node: a raw PrivateKey, or { path } to load-or-create a persistent Ed25519 key on disk (stable peer ID across restarts). Omit for an ephemeral key — convenient for dev, but a startup warning fires since bootstrap lists break on restart.


listen?

optional listen?: string[]

Defined in: index.ts:32

Listen multiaddrs for the built-in node. Defaults to ['/ip4/0.0.0.0/tcp/0'] (or /ws for the WebSocket transport). Seed nodes should use a FIXED port so their multiaddr stays valid in others' bootstrap lists.


node?

optional node?: PubSubLibp2p

Defined in: index.ts:26

Bring your own (started) libp2p node. It must expose a gossipsub pubsub service (the adapter does its own loopback, so emitSelf can be left off). When provided, the adapter does NOT manage the node's lifecycle — close() leaves it running.


presence?

optional presence?: false | { livenessTtlMs?: number; snapshotIntervalMs?: number; }

Defined in: index.ts:49

Cluster presence directory (powers srv.cluster.* / srv.isOnline). On by default; set false to disable (cluster queries then throw). Pass an object to tune timings.


topic?

optional topic?: string

Defined in: index.ts:44

The single shared gossipsub topic every node joins. Defaults to 'super-line/v1'.


transport?

optional transport?: "tcp" | "ws"

Defined in: index.ts:36

Transport for the built-in node. Defaults to 'tcp'.

Released under the MIT License.