An implementation of the js-libp2p connection. + Any libp2p transport should use an upgrader to return this connection.
+Reference to the close function of the raw connection
+Reference to the getStreams function of the muxer
+Reference to the new stream function of the multiplexer
+Connection metadata.
+Connection identifier.
+Observed multiaddr of the local peer
+Local peer id.
+Connection streams registry
+Observed multiaddr of the remote peer
+Remote peer id.
+User provided tags
+Get connection metadata
+Get all the streams of the muxer.
+Add a stream when it is opened to the registry.
+a muxed stream
+Close the connection.
+Create a new stream from this connection
+intended protocol for the stream
+++} with muxed+multistream-selected stream and selected protocol
+
Remove stream registry after it is closed.
+identifier of the stream
+Checks if the given value is a Connection
instance.
PubsubBaseProtocol handles the peers and connections logic for pubsub routers + and specifies the API that pubsub routers should have.
+If router can relay received messages, even if not subscribed
+if publish should emit to self, if subscribed
+The signature policy to follow by default
+Map of peer streams
+List of our subscriptions
+Topic validator map
+Keyed by topic + Topic validators are functions with the following input:
+Map of topics to which peers are subscribed to
+This symbol shall be used to install a listener for only monitoring 'error'
+ events. Listeners installed using this symbol are called before the regular
+ 'error'
listeners are called.
Installing a listener using this symbol does not change the behavior once an
+ 'error'
event is emitted, therefore the process will still crash if no
+ regular 'error'
listener is installed.
Whether to accept a message from a peer + Override to create a graylist
+Notifies the router that a peer has been connected
+Normalizes the message and signs it, if signing is enabled. + Should be used by the routers to create the message to send.
+Decode Uint8Array into an RPC object. + This can be override to use a custom router protobuf.
+Emit a message from a peer
+Encode RPC object into a Uint8Array. + This can be override to use a custom router protobuf.
+On an inbound stream opened.
+Registrar notifies an established connection with pubsub protocol.
+remote peer-id
+connection to the peer
+Responsible for processing each RPC message received by other peers.
+peer id string in base58
+inbound stream
+PubSub peer
+Handles an rpc request from a peer
+Handles an message from a peer
+Handles a subscription change from a peer
+Overriding the implementation of publish should handle the appropriate algorithms for the publish/subscriber implementation. + For example, a Floodsub implementation might simply publish each message to each topic for every peer
+Notifies the router that a peer has been disconnected.
+Send an rpc object to a peer
+peer id
+Send subscroptions to a peer
+peer id
+set to false for unsubscriptions
+The default msgID implementation + Child class can override this.
+the message object
+message id as bytes
+Get a list of the peer-ids that are subscribed to one topic.
+Get the list of topics which the peer is subscribed to.
+Publishes messages to all subscribed peers
+Register the pubsub protocol onto the libp2p node.
+Unregister the pubsub protocol and the streams with other peers will be closed.
+Subscribes to a given topic.
+Unsubscribe from the given topic.
+Validates the given message. The signature will be checked for authenticity. + Throws an error on invalid messages
+Thin wrapper around a peer's inbound / outbound pubsub streams
+An AbortController for controlled shutdown of the inbound stream
+The raw inbound stream, as retrieved from the callback from libp2p.handle
+The raw outbound stream, as retrieved from conn.newStream
+Read stream
+Write stream -- its preferable to use the write method
+Established protocol
+This symbol shall be used to install a listener for only monitoring 'error'
+ events. Listeners installed using this symbol are called before the regular
+ 'error'
listeners are called.
Installing a listener using this symbol does not change the behavior once an
+ 'error'
event is emitted, therefore the process will still crash if no
+ regular 'error'
listener is installed.
Do we have a connection to read from?
+Do we have a connection to write on?
+Attach a raw inbound stream and setup a read stream
+Attach a raw outbound stream and setup a write stream
+Closes the open connection to peer
+Send a message to this peer.
+ Throws if there is no stream
to write to available.
Set of peers that support the protocol.
+Notify about peer disconnected event.
+Checks if the given value is a Topology instance.
+Set of peers that support the protocol.
+Verify if a new connected peer has a topology multicodec and call _onConnect.
+Notify about peer disconnected event.
+Checks if the given value is a MulticodecTopology
instance.
Checks if the given value is a Topology instance.
+++ +Contains test suites and interfaces you can use to implement the various components of libp2p.
+
For posterity, here are links to the original repositories for each of the interfaces (if they had one).
+Feel free to join in. All welcome. Open an issue!
+This repository falls under the IPFS Code of Conduct.
+ + +MIT - Protocol Labs 2019
+
An implementation of the js-libp2p connection. + Any libp2p transport should use an upgrader to return this connection.
+