modulepackage
1.6.12
Repository: https://github.com/vulcanize/go-libp2p-net.git
Documentation: pkg.go.dev
# README
go-libp2p-net
Network interfaces for go-libp2p
The IPFS Network package handles all of the peer-to-peer networking. It connects to other hosts, it encrypts communications, it muxes messages between the network's client services and target hosts. It has multiple subcomponents:
Conn
- a connection to a single PeerMultiConn
- a set of connections to a single PeerSecureConn
- an encrypted (tls-like) connection
Swarm
- holds connections to Peers, multiplexes from/to eachMultiConn
Muxer
- multiplexes betweenServices
andSwarm
. HandlesRequet/Reply
.Service
- connects between an outside client service and Network.Handler
- the client service part that handles requests
It looks a bit like this:
Install
go get libp2p/go-libp2p-net
Contribute
Feel free to join in. All welcome. Open an issue!
Check out our contributing document for more information on how we work, and about contributing in general. Please be aware that all interactions related to libp2p are subject to the IPFS Code of Conduct.
Small note: If editing the README, please conform to the standard-readme specification.
Want to hack on IPFS?
License
MIT © 2016 Jeromy Johnson
# Constants
CanConnect means recently connected to peer, terminated gracefully.
CannotConnect means recently attempted connecting but failed to connect.
Connected means has an open, live connection to peer.
4MB.
NotConnected means no connection to peer, and no extra information (default).
# Interfaces
Conn is a connection to a remote peer.
Dialer represents a service that can dial out to peers (this is usually just a Network, but other services may not need the whole stack, and thus it becomes easier to mock).
Network is the interface used to connect to the outside world.
Notifiee is an interface for an object wishing to receive notifications from a Network.
Stream represents a bidirectional channel between two agents in the IPFS network.
# Type aliases
Connectedness signals the capacity for a connection with a given node.
ConnHandler is the type of function used to listen for connections opened by the remote side.
StreamHandler is the type of function used to listen for streams opened by the remote side.