Skip to content
This repository has been archived by the owner on May 26, 2022. It is now read-only.

Commit

Permalink
describe how to use options in README
Browse files Browse the repository at this point in the history
  • Loading branch information
marten-seemann committed Sep 29, 2021
1 parent 21ea663 commit e5e3d23
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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`
Expand Down

0 comments on commit e5e3d23

Please sign in to comment.