Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
go-libp2p
Commits
197b42ca
Commit
197b42ca
authored
Aug 05, 2018
by
gpestana
Browse files
docs: Document defaults #382
parent
77b7d8f0
Changes
1
Hide whitespace changes
Inline
Side-by-side
libp2p.go
View file @
197b42ca
...
...
@@ -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
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment