From 9e47fd444dd343cf6b7138d7fc6e0236987f1d6a Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Sat, 25 Sep 2021 03:58:33 -0700 Subject: [PATCH] remove the context from the libp2p constructor in README --- README.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index a5ed0d3..2acc8b6 100644 --- a/README.md +++ b/README.md @@ -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) ) ``` @@ -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 )