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

Commit

Permalink
Merge pull request #101 from libp2p/remove-context-readme
Browse files Browse the repository at this point in the history
remove the context from the libp2p constructor in README
  • Loading branch information
marten-seemann authored Sep 25, 2021
2 parents b2842b2 + 9e47fd4 commit 097fa25
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,12 @@ To explicitly enable the TCP transport while constructing a host, use the
``` go

import (
"context"

libp2p "github.com/libp2p/go-libp2p"
tcp "github.com/libp2p/go-tcp-transport"
)

ctx := context.Background()

// TCP only:
h, err := libp2p.New(ctx,
h, err := libp2p.New(
libp2p.Transport(tcp.NewTCPTransport)
)
```
Expand All @@ -77,7 +73,7 @@ transport. To add multiple tranports, use `ChainOptions`:

``` go
// TCP and QUIC:
h, err := libp2p.New(ctx,
h, err := libp2p.New(
libp2p.Transport(tcp.NewTCPTransport),
libp2p.Transport(quic.NewTransport), // see https://github.com/libp2p/go-libp2p-quic-transport
)
Expand Down

0 comments on commit 097fa25

Please sign in to comment.