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

Pubsubmon: Gossipsub #573

Merged
merged 2 commits into from
Oct 18, 2018
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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