From e5e3d232a3a52de0fb44d1bc663080ad5fbdfebe Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Wed, 29 Sep 2021 15:46:43 +0100 Subject: [PATCH] describe how to use options in README --- README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2acc8b6..4052a60 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ h, err := libp2p.New( ``` The example above will replace the default transports with a single TCP -transport. To add multiple tranports, use `ChainOptions`: +transport. To add multiple transports: ``` go // TCP and QUIC: @@ -79,6 +79,13 @@ h, err := libp2p.New( ) ``` +To use TCP transport options, pass them to the `libp2p.Transport` constructor: +```go +h, err := libp2p.New( + libp2p.Transport(tcp.NewTCPTransport, tcp.DisableReuseport(), tcp.WithConnectionTimeout(20*time.Second)) +) +``` + ## Addresses The TCP transport supports [multiaddrs][multiaddr] that contain a `tcp`