Update to latest go-libp2p-pubsub (with renames)
License: MIT Signed-off-by: Hector Sanjuan <code@hector.link>
This commit is contained in:
parent
1f29abf754
commit
8a045ae2d2
|
@ -5,16 +5,17 @@ package pubsubmon
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/ipfs/ipfs-cluster/api"
|
"github.com/ipfs/ipfs-cluster/api"
|
||||||
"github.com/ipfs/ipfs-cluster/monitor/metrics"
|
"github.com/ipfs/ipfs-cluster/monitor/metrics"
|
||||||
|
|
||||||
logging "github.com/ipfs/go-log"
|
logging "github.com/ipfs/go-log"
|
||||||
floodsub "github.com/libp2p/go-floodsub"
|
|
||||||
rpc "github.com/libp2p/go-libp2p-gorpc"
|
rpc "github.com/libp2p/go-libp2p-gorpc"
|
||||||
host "github.com/libp2p/go-libp2p-host"
|
host "github.com/libp2p/go-libp2p-host"
|
||||||
peer "github.com/libp2p/go-libp2p-peer"
|
peer "github.com/libp2p/go-libp2p-peer"
|
||||||
|
pubsub "github.com/libp2p/go-libp2p-pubsub"
|
||||||
msgpack "github.com/multiformats/go-multicodec/msgpack"
|
msgpack "github.com/multiformats/go-multicodec/msgpack"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -34,8 +35,8 @@ type Monitor struct {
|
||||||
rpcReady chan struct{}
|
rpcReady chan struct{}
|
||||||
|
|
||||||
host host.Host
|
host host.Host
|
||||||
pubsub *floodsub.PubSub
|
pubsub *pubsub.PubSub
|
||||||
subscription *floodsub.Subscription
|
subscription *pubsub.Subscription
|
||||||
|
|
||||||
metrics *metrics.Store
|
metrics *metrics.Store
|
||||||
checker *metrics.Checker
|
checker *metrics.Checker
|
||||||
|
@ -59,7 +60,7 @@ func New(h host.Host, cfg *Config) (*Monitor, error) {
|
||||||
mtrs := metrics.NewStore()
|
mtrs := metrics.NewStore()
|
||||||
checker := metrics.NewChecker(mtrs)
|
checker := metrics.NewChecker(mtrs)
|
||||||
|
|
||||||
pubsub, err := floodsub.NewGossipSub(ctx, h)
|
pubsub, err := pubsub.NewGossipSub(ctx, h)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
cancel()
|
cancel()
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
|
@ -9,10 +9,10 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
floodsub "github.com/libp2p/go-floodsub"
|
|
||||||
libp2p "github.com/libp2p/go-libp2p"
|
libp2p "github.com/libp2p/go-libp2p"
|
||||||
peer "github.com/libp2p/go-libp2p-peer"
|
peer "github.com/libp2p/go-libp2p-peer"
|
||||||
peerstore "github.com/libp2p/go-libp2p-peerstore"
|
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/api"
|
||||||
"github.com/ipfs/ipfs-cluster/test"
|
"github.com/ipfs/ipfs-cluster/test"
|
||||||
|
@ -21,7 +21,7 @@ import (
|
||||||
func init() {
|
func init() {
|
||||||
// GossipSub needs to heartbeat to discover newly connected hosts
|
// GossipSub needs to heartbeat to discover newly connected hosts
|
||||||
// This speeds things up a little.
|
// This speeds things up a little.
|
||||||
floodsub.GossipSubHeartbeatInterval = 50 * time.Millisecond
|
pubsub.GossipSubHeartbeatInterval = 50 * time.Millisecond
|
||||||
}
|
}
|
||||||
|
|
||||||
type metricFactory struct {
|
type metricFactory struct {
|
||||||
|
|
12
package.json
12
package.json
|
@ -79,12 +79,6 @@
|
||||||
"name": "go-ipfs-api",
|
"name": "go-ipfs-api",
|
||||||
"version": "1.4.2"
|
"version": "1.4.2"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"author": "whyrusleeping",
|
|
||||||
"hash": "Qmc71UCoZWor2ADQAWjNnrSVgEtPpEsQbCXf9Gs7WWz7MV",
|
|
||||||
"name": "go-libp2p-floodsub",
|
|
||||||
"version": "100.10.2"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"author": "whyrusleeping",
|
"author": "whyrusleeping",
|
||||||
"hash": "QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7",
|
"hash": "QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7",
|
||||||
|
@ -155,6 +149,12 @@
|
||||||
"hash": "QmYgGtLm9WJRgh6iuaZap8qVC1gqixFbZCNfhjLNBhWMCm",
|
"hash": "QmYgGtLm9WJRgh6iuaZap8qVC1gqixFbZCNfhjLNBhWMCm",
|
||||||
"name": "envconfig",
|
"name": "envconfig",
|
||||||
"version": "1.3.1"
|
"version": "1.3.1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"author": "whyrusleeping",
|
||||||
|
"hash": "QmYmrxfax5xGfLF6SL2Bq7SDEzFZFyNcLvGi8ExdC5iiko",
|
||||||
|
"name": "go-libp2p-pubsub",
|
||||||
|
"version": "100.11.3"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"gxVersion": "0.11.0",
|
"gxVersion": "0.11.0",
|
||||||
|
|
Loading…
Reference in New Issue
Block a user