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

Commit

Permalink
remove contexts from libp2p constructors in README (#111)
Browse files Browse the repository at this point in the history
  • Loading branch information
marten-seemann authored Jan 4, 2022
1 parent 0bac7be commit 1201f0d
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 @@ -59,16 +59,12 @@ To explicitly enable the WebSocket transport while constructing a host, use the
``` go

import (
"context"

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

ctx := context.Background()

// WebSockets only:
h, err := libp2p.New(ctx,
h, err := libp2p.New(
libp2p.Transport(ws.New)
)
```
Expand All @@ -78,7 +74,7 @@ transport. To add multiple tranports, use `ChainOptions`:

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

0 comments on commit 1201f0d

Please sign in to comment.