Skip to content

Commit

Permalink
update libp2p again and switch to noise by default
Browse files Browse the repository at this point in the history
  • Loading branch information
Stebalien committed Aug 19, 2020
1 parent d7f609c commit 695cb66
Show file tree
Hide file tree
Showing 5 changed files with 105 additions and 117 deletions.
6 changes: 3 additions & 3 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,9 @@ func NewDefaultConfig() Config {
Port: 0,
},
Security: Security{
SECIO: true,
Noise: false,
TLS: false,
SECIO: false,
Noise: true,
TLS: true,
},
}
}
12 changes: 2 additions & 10 deletions daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (

multierror "github.com/hashicorp/go-multierror"
logging "github.com/ipfs/go-log"
autonat "github.com/libp2p/go-libp2p-autonat-svc"
dht "github.com/libp2p/go-libp2p-kad-dht"
dhtopts "github.com/libp2p/go-libp2p-kad-dht/opts"
ps "github.com/libp2p/go-libp2p-pubsub"
Expand All @@ -32,9 +31,8 @@ type Daemon struct {
host host.Host
listener manet.Listener

dht *dht.IpfsDHT
pubsub *ps.PubSub
autonat *autonat.AutoNATService
dht *dht.IpfsDHT
pubsub *ps.PubSub

mx sync.Mutex
// stream handlers: map of protocol.ID to multi-address
Expand Down Expand Up @@ -126,12 +124,6 @@ func (d *Daemon) EnablePubsub(router string, sign, strict bool) error {

}

func (d *Daemon) EnableAutoNAT(opts ...libp2p.Option) error {
svc, err := autonat.NewAutoNATService(d.ctx, d.host, opts...)
d.autonat = svc
return err
}

func (d *Daemon) ID() peer.ID {
return d.host.ID()
}
Expand Down
40 changes: 15 additions & 25 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,28 @@ module github.com/libp2p/go-libp2p-daemon
go 1.12

require (
github.com/benbjohnson/clock v1.0.2 // indirect
github.com/gogo/protobuf v1.3.1
github.com/golang/protobuf v1.4.2 // indirect
github.com/hashicorp/go-multierror v1.1.0
github.com/ipfs/go-cid v0.0.6
github.com/ipfs/go-cid v0.0.7
github.com/ipfs/go-log v1.0.4
github.com/ipfs/go-log/v2 v2.1.1 // indirect
github.com/libp2p/go-libp2p v0.9.2
github.com/libp2p/go-libp2p-autonat-svc v0.1.0
github.com/libp2p/go-libp2p-circuit v0.2.3
github.com/libp2p/go-libp2p-connmgr v0.2.3
github.com/libp2p/go-libp2p-core v0.5.6
github.com/libp2p/go-libp2p-kad-dht v0.8.1
github.com/libp2p/go-libp2p-kbucket v0.4.2 // indirect
github.com/libp2p/go-libp2p v0.10.3
github.com/libp2p/go-libp2p-circuit v0.3.1
github.com/libp2p/go-libp2p-connmgr v0.2.4
github.com/libp2p/go-libp2p-core v0.6.1
github.com/libp2p/go-libp2p-kad-dht v0.8.3
github.com/libp2p/go-libp2p-noise v0.1.1
github.com/libp2p/go-libp2p-peerstore v0.2.4
github.com/libp2p/go-libp2p-pubsub v0.3.1
github.com/libp2p/go-libp2p-quic-transport v0.5.0
github.com/libp2p/go-libp2p-record v0.1.3 // indirect
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-secio v0.2.2
github.com/libp2p/go-libp2p-swarm v0.2.5 // indirect
github.com/libp2p/go-libp2p-tls v0.1.3
github.com/libp2p/go-libp2p-yamux v0.2.8 // indirect
github.com/mr-tron/base58 v1.2.0 // indirect
github.com/multiformats/go-multiaddr v0.2.2
github.com/multiformats/go-multiaddr-net v0.1.5
github.com/multiformats/go-multihash v0.0.13
github.com/prometheus/client_golang v1.6.0
github.com/prometheus/common v0.10.0 // indirect
github.com/stretchr/testify v1.6.0
github.com/multiformats/go-multiaddr v0.3.0
github.com/multiformats/go-multiaddr-net v0.2.0
github.com/multiformats/go-multihash v0.0.14
github.com/prometheus/client_golang v1.7.1
github.com/stretchr/testify v1.6.1
golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37 // indirect
golang.org/x/net v0.0.0-20200602114024-627f9648deb9 // indirect
golang.org/x/sys v0.0.0-20200602100848-8d3cce7afc34 // indirect
google.golang.org/protobuf v1.24.0 // indirect
gopkg.in/yaml.v2 v2.3.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20200602154603-c1a7af8cc6cd // indirect
Expand Down
Loading

0 comments on commit 695cb66

Please sign in to comment.