From 197b42caeafd32c916fc14e844f9374c2e220eeb Mon Sep 17 00:00:00 2001 From: gpestana Date: Sun, 5 Aug 2018 20:28:00 +0300 Subject: [PATCH] docs: Document defaults #382 --- libp2p.go | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/libp2p.go b/libp2p.go index 936b2220..7d0621c9 100644 --- a/libp2p.go +++ b/libp2p.go @@ -27,8 +27,27 @@ func ChainOptions(opts ...Option) Option { } } -// New constructs a new libp2p node with the given options (falling back on -// reasonable defaults). +// New constructs a new libp2p node with the given options, falling back on +// 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. func New(ctx context.Context, opts ...Option) (host.Host, error) {