Skip to content

Commit

Permalink
Merge pull request #573 from ipfs/feat/gossipsub
Browse files Browse the repository at this point in the history
Pubsubmon: Gossipsub
  • Loading branch information
hsanjuan committed Oct 18, 2018
2 parents f669d75 + fcbfc7f commit 3c9945f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion monitor/pubsubmon/pubsubmon.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func New(h host.Host, cfg *Config) (*Monitor, error) {
mtrs := metrics.NewStore()
checker := metrics.NewChecker(mtrs)

pubsub, err := floodsub.NewFloodSub(ctx, h)
pubsub, err := floodsub.NewGossipSub(ctx, h)
if err != nil {
cancel()
return nil, err
Expand Down
9 changes: 8 additions & 1 deletion monitor/pubsubmon/pubsubmon_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,27 @@ package pubsubmon
import (
"context"
"fmt"

"strconv"
"sync"
"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"

"github.com/ipfs/ipfs-cluster/api"
"github.com/ipfs/ipfs-cluster/test"
)

func init() {
// GossipSub needs to heartbeat to discover newly connected hosts
// This speeds things up a little.
floodsub.GossipSubHeartbeatInterval = 50 * time.Millisecond
}

type metricFactory struct {
l sync.Mutex
counter int
Expand Down

0 comments on commit 3c9945f

Please sign in to comment.