Commit 197b42ca authored by gpestana's avatar gpestana
Browse files

docs: Document defaults #382

parent 77b7d8f0
...@@ -27,8 +27,27 @@ func ChainOptions(opts ...Option) Option { ...@@ -27,8 +27,27 @@ func ChainOptions(opts ...Option) Option {
} }
} }
// New constructs a new libp2p node with the given options (falling back on // New constructs a new libp2p node with the given options, falling back on
// reasonable defaults). // reasonable defaults. The defaults are:
//
// - If no transport and listen addresses are provided, the node listens to
// the multiaddresses "/ip4/0.0.0.0/tcp/0" and "/ip6/::/tcp/0";
//
// - If no transport options are provided, the node uses TPC and websocket
// transport protocols;
//
// - If no multiplexer configuration is provided, the node is configured by
// default to use the "yamux/1.0.0" and "mplux/6.7.0" stream connection
// multiplexers;
//
// - If no security transport is provided, the host uses the go-libp2p's secio
// encrypted transport to encrypt all traffic;
//
// - If no peer identity is provided, it generates a random RSA 2048 key-par
// and derives a new identity from it;
//
// - If no peerstore is provided, the host is initialized with an empty
// peerstore.
// //
// Canceling the passed context will stop the returned libp2p node. // Canceling the passed context will stop the returned libp2p node.
func New(ctx context.Context, opts ...Option) (host.Host, error) { func New(ctx context.Context, opts ...Option) (host.Host, error) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment