From e50ea377ef10e450ef92c4b92e19bb4fc6238c05 Mon Sep 17 00:00:00 2001 From: vyzo Date: Wed, 12 Aug 2020 21:14:52 +0300 Subject: [PATCH 1/2] gomod: add go-libp2p-noise, remove go-libp2p-secio --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 89460674e..132f99177 100644 --- a/go.mod +++ b/go.mod @@ -87,13 +87,13 @@ require ( github.com/libp2p/go-libp2p-discovery v0.5.0 github.com/libp2p/go-libp2p-kad-dht v0.8.3 github.com/libp2p/go-libp2p-mplex v0.2.4 + github.com/libp2p/go-libp2p-noise v0.1.1 github.com/libp2p/go-libp2p-peer v0.2.0 github.com/libp2p/go-libp2p-peerstore v0.2.6 github.com/libp2p/go-libp2p-pubsub v0.3.4 github.com/libp2p/go-libp2p-quic-transport v0.7.1 github.com/libp2p/go-libp2p-record v0.1.3 github.com/libp2p/go-libp2p-routing-helpers v0.2.3 - github.com/libp2p/go-libp2p-secio v0.2.2 github.com/libp2p/go-libp2p-swarm v0.2.8 github.com/libp2p/go-libp2p-tls v0.1.3 github.com/libp2p/go-libp2p-yamux v0.2.8 From e17732b365a79fe2448b81d4889ba9279e3ce2be Mon Sep 17 00:00:00 2001 From: vyzo Date: Wed, 12 Aug 2020 21:15:16 +0300 Subject: [PATCH 2/2] remove secio support, replace with noise --- node/modules/lp2p/transport.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/node/modules/lp2p/transport.go b/node/modules/lp2p/transport.go index 9dfa7843a..5ea2d1c83 100644 --- a/node/modules/lp2p/transport.go +++ b/node/modules/lp2p/transport.go @@ -3,8 +3,8 @@ package lp2p import ( "github.com/libp2p/go-libp2p" metrics "github.com/libp2p/go-libp2p-core/metrics" + noise "github.com/libp2p/go-libp2p-noise" libp2pquic "github.com/libp2p/go-libp2p-quic-transport" - secio "github.com/libp2p/go-libp2p-secio" tls "github.com/libp2p/go-libp2p-tls" ) @@ -23,9 +23,9 @@ func Security(enabled, preferTLS bool) interface{} { } return func() (opts Libp2pOpts) { if preferTLS { - opts.Opts = append(opts.Opts, libp2p.ChainOptions(libp2p.Security(tls.ID, tls.New), libp2p.Security(secio.ID, secio.New))) + opts.Opts = append(opts.Opts, libp2p.ChainOptions(libp2p.Security(tls.ID, tls.New), libp2p.Security(noise.ID, noise.New))) } else { - opts.Opts = append(opts.Opts, libp2p.ChainOptions(libp2p.Security(secio.ID, secio.New), libp2p.Security(tls.ID, tls.New))) + opts.Opts = append(opts.Opts, libp2p.ChainOptions(libp2p.Security(noise.ID, noise.New), libp2p.Security(tls.ID, tls.New))) } return opts }