From e2bab1cc5a21dbad20e8efef6ec247a3e1b749d2 Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Tue, 27 Jul 2021 19:27:56 +0200 Subject: [PATCH] remove secio from examples --- examples/go.mod | 2 +- examples/go.sum | 2 -- examples/ipfs-camp-2019/05-Discovery/main.go | 6 +++--- examples/ipfs-camp-2019/06-Pubsub/main.go | 4 ++-- examples/ipfs-camp-2019/07-Messaging/main.go | 6 +++--- examples/ipfs-camp-2019/08-End/main.go | 6 +++--- examples/ipfs-camp-2019/go.mod | 2 +- examples/ipfs-camp-2019/go.sum | 2 -- examples/libp2p-host/README.md | 4 ++-- examples/libp2p-host/host.go | 8 ++++---- examples/routed-echo/main.go | 4 +--- 11 files changed, 20 insertions(+), 26 deletions(-) diff --git a/examples/go.mod b/examples/go.mod index a03f6819..f9f9e1d0 100644 --- a/examples/go.mod +++ b/examples/go.mod @@ -13,8 +13,8 @@ require ( github.com/libp2p/go-libp2p-core v0.8.5 github.com/libp2p/go-libp2p-discovery v0.5.0 github.com/libp2p/go-libp2p-kad-dht v0.11.1 + github.com/libp2p/go-libp2p-noise v0.2.0 github.com/libp2p/go-libp2p-quic-transport v0.10.0 - github.com/libp2p/go-libp2p-secio v0.2.2 github.com/libp2p/go-libp2p-swarm v0.5.0 github.com/libp2p/go-libp2p-tls v0.1.3 github.com/multiformats/go-multiaddr v0.3.3 diff --git a/examples/go.sum b/examples/go.sum index a1472c77..691574a9 100644 --- a/examples/go.sum +++ b/examples/go.sum @@ -400,8 +400,6 @@ github.com/libp2p/go-libp2p-record v0.1.2/go.mod h1:pal0eNcT5nqZaTV7UGhqeGqxFgGd github.com/libp2p/go-libp2p-record v0.1.3 h1:R27hoScIhQf/A8XJZ8lYpnqh9LatJ5YbHs28kCIfql0= github.com/libp2p/go-libp2p-record v0.1.3/go.mod h1:yNUff/adKIfPnYQXgp6FQmNu3gLJ6EMg7+/vv2+9pY4= github.com/libp2p/go-libp2p-routing-helpers v0.2.3/go.mod h1:795bh+9YeoFl99rMASoiVgHdi5bjack0N1+AFAdbvBw= -github.com/libp2p/go-libp2p-secio v0.2.2 h1:rLLPvShPQAcY6eNurKNZq3eZjPWfU9kXF2eI9jIYdrg= -github.com/libp2p/go-libp2p-secio v0.2.2/go.mod h1:wP3bS+m5AUnFA+OFO7Er03uO1mncHG0uVwGrwvjYlNY= github.com/libp2p/go-libp2p-swarm v0.2.8/go.mod h1:JQKMGSth4SMqonruY0a8yjlPVIkb0mdNSwckW7OYziM= github.com/libp2p/go-libp2p-swarm v0.3.0/go.mod h1:hdv95GWCTmzkgeJpP+GK/9D9puJegb7H57B5hWQR5Kk= github.com/libp2p/go-libp2p-swarm v0.3.1/go.mod h1:hdv95GWCTmzkgeJpP+GK/9D9puJegb7H57B5hWQR5Kk= diff --git a/examples/ipfs-camp-2019/05-Discovery/main.go b/examples/ipfs-camp-2019/05-Discovery/main.go index f82da84e..e7d1acf9 100644 --- a/examples/ipfs-camp-2019/05-Discovery/main.go +++ b/examples/ipfs-camp-2019/05-Discovery/main.go @@ -10,9 +10,9 @@ import ( "github.com/libp2p/go-libp2p" "github.com/libp2p/go-libp2p-core/peer" mplex "github.com/libp2p/go-libp2p-mplex" - secio "github.com/libp2p/go-libp2p-secio" + tls "github.com/libp2p/go-libp2p-tls" yamux "github.com/libp2p/go-libp2p-yamux" - tcp "github.com/libp2p/go-tcp-transport" + "github.com/libp2p/go-tcp-transport" ws "github.com/libp2p/go-ws-transport" "github.com/multiformats/go-multiaddr" ) @@ -31,7 +31,7 @@ func main() { libp2p.Muxer("/mplex/6.7.0", mplex.DefaultTransport), ) - security := libp2p.Security(secio.ID, secio.New) + security := libp2p.Security(tls.ID, tls.New) listenAddrs := libp2p.ListenAddrStrings( "/ip4/0.0.0.0/tcp/0", diff --git a/examples/ipfs-camp-2019/06-Pubsub/main.go b/examples/ipfs-camp-2019/06-Pubsub/main.go index 7697fd2b..2522db87 100644 --- a/examples/ipfs-camp-2019/06-Pubsub/main.go +++ b/examples/ipfs-camp-2019/06-Pubsub/main.go @@ -16,7 +16,7 @@ import ( disc "github.com/libp2p/go-libp2p-discovery" kaddht "github.com/libp2p/go-libp2p-kad-dht" mplex "github.com/libp2p/go-libp2p-mplex" - secio "github.com/libp2p/go-libp2p-secio" + tls "github.com/libp2p/go-libp2p-tls" yamux "github.com/libp2p/go-libp2p-yamux" "github.com/libp2p/go-libp2p/p2p/discovery" tcp "github.com/libp2p/go-tcp-transport" @@ -50,7 +50,7 @@ func main() { libp2p.Muxer("/mplex/6.7.0", mplex.DefaultTransport), ) - security := libp2p.Security(secio.ID, secio.New) + security := libp2p.Security(tls.ID, tls.New) listenAddrs := libp2p.ListenAddrStrings( "/ip4/0.0.0.0/tcp/0", diff --git a/examples/ipfs-camp-2019/07-Messaging/main.go b/examples/ipfs-camp-2019/07-Messaging/main.go index 216671b3..04ef4c55 100644 --- a/examples/ipfs-camp-2019/07-Messaging/main.go +++ b/examples/ipfs-camp-2019/07-Messaging/main.go @@ -15,10 +15,10 @@ import ( kaddht "github.com/libp2p/go-libp2p-kad-dht" mplex "github.com/libp2p/go-libp2p-mplex" pubsub "github.com/libp2p/go-libp2p-pubsub" - secio "github.com/libp2p/go-libp2p-secio" + tls "github.com/libp2p/go-libp2p-tls" yamux "github.com/libp2p/go-libp2p-yamux" "github.com/libp2p/go-libp2p/p2p/discovery" - tcp "github.com/libp2p/go-tcp-transport" + "github.com/libp2p/go-tcp-transport" ws "github.com/libp2p/go-ws-transport" "github.com/multiformats/go-multiaddr" ) @@ -46,7 +46,7 @@ func main() { libp2p.Muxer("/mplex/6.7.0", mplex.DefaultTransport), ) - security := libp2p.Security(secio.ID, secio.New) + security := libp2p.Security(tls.ID, tls.New) listenAddrs := libp2p.ListenAddrStrings( "/ip4/0.0.0.0/tcp/0", diff --git a/examples/ipfs-camp-2019/08-End/main.go b/examples/ipfs-camp-2019/08-End/main.go index 032e905d..d9384933 100644 --- a/examples/ipfs-camp-2019/08-End/main.go +++ b/examples/ipfs-camp-2019/08-End/main.go @@ -15,10 +15,10 @@ import ( kaddht "github.com/libp2p/go-libp2p-kad-dht" mplex "github.com/libp2p/go-libp2p-mplex" pubsub "github.com/libp2p/go-libp2p-pubsub" - secio "github.com/libp2p/go-libp2p-secio" + tls "github.com/libp2p/go-libp2p-tls" yamux "github.com/libp2p/go-libp2p-yamux" "github.com/libp2p/go-libp2p/p2p/discovery" - tcp "github.com/libp2p/go-tcp-transport" + "github.com/libp2p/go-tcp-transport" ws "github.com/libp2p/go-ws-transport" "github.com/multiformats/go-multiaddr" ) @@ -46,7 +46,7 @@ func main() { libp2p.Muxer("/mplex/6.7.0", mplex.DefaultTransport), ) - security := libp2p.Security(secio.ID, secio.New) + security := libp2p.Security(tls.ID, tls.New) listenAddrs := libp2p.ListenAddrStrings( "/ip4/0.0.0.0/tcp/0", diff --git a/examples/ipfs-camp-2019/go.mod b/examples/ipfs-camp-2019/go.mod index 0818d921..b6d1ac5f 100644 --- a/examples/ipfs-camp-2019/go.mod +++ b/examples/ipfs-camp-2019/go.mod @@ -10,7 +10,7 @@ require ( github.com/libp2p/go-libp2p-kad-dht v0.11.1 github.com/libp2p/go-libp2p-mplex v0.4.1 github.com/libp2p/go-libp2p-pubsub v0.4.1 - github.com/libp2p/go-libp2p-secio v0.2.2 + github.com/libp2p/go-libp2p-tls v0.1.3 github.com/libp2p/go-libp2p-yamux v0.5.4 github.com/libp2p/go-tcp-transport v0.2.4 github.com/libp2p/go-ws-transport v0.4.0 diff --git a/examples/ipfs-camp-2019/go.sum b/examples/ipfs-camp-2019/go.sum index 11049d65..6736c6e0 100644 --- a/examples/ipfs-camp-2019/go.sum +++ b/examples/ipfs-camp-2019/go.sum @@ -402,8 +402,6 @@ github.com/libp2p/go-libp2p-record v0.1.2/go.mod h1:pal0eNcT5nqZaTV7UGhqeGqxFgGd github.com/libp2p/go-libp2p-record v0.1.3 h1:R27hoScIhQf/A8XJZ8lYpnqh9LatJ5YbHs28kCIfql0= github.com/libp2p/go-libp2p-record v0.1.3/go.mod h1:yNUff/adKIfPnYQXgp6FQmNu3gLJ6EMg7+/vv2+9pY4= github.com/libp2p/go-libp2p-routing-helpers v0.2.3/go.mod h1:795bh+9YeoFl99rMASoiVgHdi5bjack0N1+AFAdbvBw= -github.com/libp2p/go-libp2p-secio v0.2.2 h1:rLLPvShPQAcY6eNurKNZq3eZjPWfU9kXF2eI9jIYdrg= -github.com/libp2p/go-libp2p-secio v0.2.2/go.mod h1:wP3bS+m5AUnFA+OFO7Er03uO1mncHG0uVwGrwvjYlNY= github.com/libp2p/go-libp2p-swarm v0.2.8/go.mod h1:JQKMGSth4SMqonruY0a8yjlPVIkb0mdNSwckW7OYziM= github.com/libp2p/go-libp2p-swarm v0.3.0/go.mod h1:hdv95GWCTmzkgeJpP+GK/9D9puJegb7H57B5hWQR5Kk= github.com/libp2p/go-libp2p-swarm v0.3.1/go.mod h1:hdv95GWCTmzkgeJpP+GK/9D9puJegb7H57B5hWQR5Kk= diff --git a/examples/libp2p-host/README.md b/examples/libp2p-host/README.md index f33213b7..081f2719 100644 --- a/examples/libp2p-host/README.md +++ b/examples/libp2p-host/README.md @@ -56,8 +56,8 @@ h2, err := libp2p.New(ctx, ), // support TLS connections libp2p.Security(libp2ptls.ID, libp2ptls.New), - // support secio connections - libp2p.Security(secio.ID, secio.New), + // support Noise connections + libp2p.Security(noise.ID, noise.New), // support QUIC libp2p.Transport(libp2pquic.NewTransport), // support any other default transports (TCP) diff --git a/examples/libp2p-host/host.go b/examples/libp2p-host/host.go index 797c63e0..fcb768a6 100644 --- a/examples/libp2p-host/host.go +++ b/examples/libp2p-host/host.go @@ -9,10 +9,10 @@ import ( connmgr "github.com/libp2p/go-libp2p-connmgr" "github.com/libp2p/go-libp2p-core/crypto" "github.com/libp2p/go-libp2p-core/host" - routing "github.com/libp2p/go-libp2p-core/routing" + "github.com/libp2p/go-libp2p-core/routing" dht "github.com/libp2p/go-libp2p-kad-dht" + noise "github.com/libp2p/go-libp2p-noise" libp2pquic "github.com/libp2p/go-libp2p-quic-transport" - secio "github.com/libp2p/go-libp2p-secio" libp2ptls "github.com/libp2p/go-libp2p-tls" ) @@ -59,8 +59,8 @@ func run() { ), // support TLS connections libp2p.Security(libp2ptls.ID, libp2ptls.New), - // support secio connections - libp2p.Security(secio.ID, secio.New), + // support noise connections + libp2p.Security(noise.ID, noise.New), // support QUIC - experimental libp2p.Transport(libp2pquic.NewTransport), // support any other default transports (TCP) diff --git a/examples/routed-echo/main.go b/examples/routed-echo/main.go index af1c1e2f..5d1110eb 100644 --- a/examples/routed-echo/main.go +++ b/examples/routed-echo/main.go @@ -27,10 +27,8 @@ import ( ) // makeRoutedHost creates a LibP2P host with a random peer ID listening on the -// given multiaddress. It will use secio if secio is true. It will bootstrap using the -// provided PeerInfo +// given multiaddress. It will bootstrap using the provided PeerInfo. func makeRoutedHost(listenPort int, randseed int64, bootstrapPeers []peer.AddrInfo, globalFlag string) (host.Host, error) { - // If the seed is zero, use real cryptographic randomness. Otherwise, use a // deterministic randomness source to make generated keys stay the same // across multiple runs