the non-optional binding options
Gets the binding options (read-only).
Provides the libp2p binding with application-specific options as value of
the CommunicationOptions.binding property in the agent container
configuration.
To be used as follows:
import { Libp2pBinding } from "@coaty/binding.libp2p";
const configuration: Configuration = {
...
communication: {
binding: Libp2pBinding.withOptions({
...
}),
...
},
...
};
options available for libp2p binding
Generated using TypeDoc
Defines a peer-to-peer based communication binding for transmitting Coaty communication events via a libp2p pubsub messaging protocol. A detailed explanation can be found here.
With this binding, TCP connections between Coaty agent peers are secured by default, i.e. messages are encryped and signed using public key cryptography.
As this binding is based on peer-to-peer communication, the emitted communication state is
Onlineas long as the binding is inJoinedstate and the libp2p peer node is not isolated, i.e. has at least one active libp2p connection to remote libp2p peers. However, note that an isolated offline peer can communicate with itself.This binding supports Raw events with plain topic strings that contain no wildcard tokens. Topic strings must be non-empty and may include arbitrary Unicode characters.
This binding does not support the
shouldEnableCrossNamespacingoption. Coaty communication events published by agents in a different namespace cannot be observed.This binding poses the following restrictions on its
namespaceoption: namespace must not include consecutive dots or end with a dot, and namespace must not contain more than 236 characters.In case you are running multiple isolated Coaty applications on the same local network, you should specify different namespaces for each of them. This ensures that peer connections are only set up between Coaty agents sharing the same namespace.
This binding supports two peer discovery methods:
Multicast DNS(mDNS) to discover peers in a local network, andBootstrap Peersto discover peers across networks. mDNS discovery cannot be used across multiple IP subnets. It should be used in networks having a small number of nodes as mDNS queries and responses are transmitted in multicast mode and consecutively generate large volume of traffic. Bootstrap peer discovery uses a list of preconfigured bootstrap nodes. Depending on the application use case, both methods can be combined or used exclusively.To enable debug mode of the underlying
libp2plibraries, set global variableDEBUGto a comma-separated list of libp2p packages to be debugged before loading this binding. To debug the base libp2p system, uselibp2p, to debug a specific module uselibp2p:<module>, to debug all modules uselibp2p,libp2p:*. For example, to restrict debug mode to the used libp2p pubsub module, set global variableDEBUGtolibp2p:floodsub. Valid module names includefloodsub,mdns,mplex,dialer,connection-manager,transports,bootstrap,peer-store, etc.This binding requires Node.js 12 or higher. Support for browsers is work in progress.