Update to latest go-libp2p-pubsub (with renames)

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
This commit is contained in:
Hector Sanjuan 2018-10-29 17:25:52 +01:00
parent 1f29abf754
commit 8a045ae2d2
3 changed files with 13 additions and 12 deletions

View File

@ -5,16 +5,17 @@ package pubsubmon
import (
"bytes"
"context"
"sync"
"github.com/ipfs/ipfs-cluster/api"
"github.com/ipfs/ipfs-cluster/monitor/metrics"
logging "github.com/ipfs/go-log"
floodsub "github.com/libp2p/go-floodsub"
rpc "github.com/libp2p/go-libp2p-gorpc"
host "github.com/libp2p/go-libp2p-host"
peer "github.com/libp2p/go-libp2p-peer"
pubsub "github.com/libp2p/go-libp2p-pubsub"
msgpack "github.com/multiformats/go-multicodec/msgpack"
)
@ -34,8 +35,8 @@ type Monitor struct {
rpcReady chan struct{}
host host.Host
pubsub *floodsub.PubSub
subscription *floodsub.Subscription
pubsub *pubsub.PubSub
subscription *pubsub.Subscription
metrics *metrics.Store
checker *metrics.Checker
@ -59,7 +60,7 @@ func New(h host.Host, cfg *Config) (*Monitor, error) {
mtrs := metrics.NewStore()
checker := metrics.NewChecker(mtrs)
pubsub, err := floodsub.NewGossipSub(ctx, h)
pubsub, err := pubsub.NewGossipSub(ctx, h)
if err != nil {
cancel()
return nil, err

View File

@ -9,10 +9,10 @@ import (
"testing"
"time"
floodsub "github.com/libp2p/go-floodsub"
libp2p "github.com/libp2p/go-libp2p"
peer "github.com/libp2p/go-libp2p-peer"
peerstore "github.com/libp2p/go-libp2p-peerstore"
pubsub "github.com/libp2p/go-libp2p-pubsub"
"github.com/ipfs/ipfs-cluster/api"
"github.com/ipfs/ipfs-cluster/test"
@ -21,7 +21,7 @@ import (
func init() {
// GossipSub needs to heartbeat to discover newly connected hosts
// This speeds things up a little.
floodsub.GossipSubHeartbeatInterval = 50 * time.Millisecond
pubsub.GossipSubHeartbeatInterval = 50 * time.Millisecond
}
type metricFactory struct {

View File

@ -79,12 +79,6 @@
"name": "go-ipfs-api",
"version": "1.4.2"
},
{
"author": "whyrusleeping",
"hash": "Qmc71UCoZWor2ADQAWjNnrSVgEtPpEsQbCXf9Gs7WWz7MV",
"name": "go-libp2p-floodsub",
"version": "100.10.2"
},
{
"author": "whyrusleeping",
"hash": "QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7",
@ -155,6 +149,12 @@
"hash": "QmYgGtLm9WJRgh6iuaZap8qVC1gqixFbZCNfhjLNBhWMCm",
"name": "envconfig",
"version": "1.3.1"
},
{
"author": "whyrusleeping",
"hash": "QmYmrxfax5xGfLF6SL2Bq7SDEzFZFyNcLvGi8ExdC5iiko",
"name": "go-libp2p-pubsub",
"version": "100.11.3"
}
],
"gxVersion": "0.11.0",