Change temporarily pubsub engine to FloodSub

This commit is contained in:
ChronosX88 2021-07-29 00:47:09 +03:00
parent 1670a6b287
commit cd671e6165
Signed by: ChronosXYZ
GPG Key ID: 085A69A82C8C511A
2 changed files with 15 additions and 11 deletions

View File

@ -28,8 +28,13 @@ func ValidateGetTransaction(task *types.DioneTask) error {
return validation.VerifyExactMatching(task)
}
func ValidateGetBlock(task *types.DioneTask) error {
return validation.VerifyExactMatching(task)
}
func init() {
validation.RegisterValidation(rtypes.RPCTypeFilecoin, map[string]func(*types.DioneTask) error{
"getTransaction": ValidateGetTransaction,
"getBlock": ValidateGetBlock,
})
}

View File

@ -2,7 +2,6 @@ package pubsub
import (
"context"
"time"
"github.com/fxamacker/cbor/v2"
@ -40,19 +39,19 @@ func NewPubSubRouter(h host.Host, oracleTopic string, isBootstrap bool) *PubSubR
if isBootstrap {
// turn off the mesh in bootstrappers -- only do gossip and PX
pubsub.GossipSubD = 0
pubsub.GossipSubDscore = 0
pubsub.GossipSubDlo = 0
pubsub.GossipSubDhi = 0
pubsub.GossipSubDout = 0
pubsub.GossipSubDlazy = 64
pubsub.GossipSubGossipFactor = 0.25
pubsub.GossipSubPruneBackoff = 5 * time.Minute
//pubsub.GossipSubD = 0
//pubsub.GossipSubDscore = 0
//pubsub.GossipSubDlo = 0
//pubsub.GossipSubDhi = 0
//pubsub.GossipSubDout = 0
//pubsub.GossipSubDlazy = 64
//pubsub.GossipSubGossipFactor = 0.25
//pubsub.GossipSubPruneBackoff = 5 * time.Minute
// turn on PX
pbOptions = append(pbOptions, pubsub.WithPeerExchange(true))
//pbOptions = append(pbOptions, pubsub.WithPeerExchange(true))
}
pb, err := pubsub.NewGossipSub(
pb, err := pubsub.NewFloodSub(
context.TODO(),
psr.node,
pbOptions...,