Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove secio from examples #1143

Merged
merged 1 commit into from
Jul 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions examples/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
6 changes: 3 additions & 3 deletions examples/ipfs-camp-2019/05-Discovery/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand All @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions examples/ipfs-camp-2019/06-Pubsub/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions examples/ipfs-camp-2019/07-Messaging/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions examples/ipfs-camp-2019/08-End/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion examples/ipfs-camp-2019/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions examples/ipfs-camp-2019/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
4 changes: 2 additions & 2 deletions examples/libp2p-host/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions examples/libp2p-host/host.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down Expand Up @@ -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)
Expand Down
4 changes: 1 addition & 3 deletions examples/routed-echo/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down