Change temporarily pubsub engine to FloodSub
This commit is contained in:
parent
1670a6b287
commit
cd671e6165
@ -28,8 +28,13 @@ func ValidateGetTransaction(task *types.DioneTask) error {
|
|||||||
return validation.VerifyExactMatching(task)
|
return validation.VerifyExactMatching(task)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func ValidateGetBlock(task *types.DioneTask) error {
|
||||||
|
return validation.VerifyExactMatching(task)
|
||||||
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
validation.RegisterValidation(rtypes.RPCTypeFilecoin, map[string]func(*types.DioneTask) error{
|
validation.RegisterValidation(rtypes.RPCTypeFilecoin, map[string]func(*types.DioneTask) error{
|
||||||
"getTransaction": ValidateGetTransaction,
|
"getTransaction": ValidateGetTransaction,
|
||||||
|
"getBlock": ValidateGetBlock,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,6 @@ package pubsub
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/fxamacker/cbor/v2"
|
"github.com/fxamacker/cbor/v2"
|
||||||
|
|
||||||
@ -40,19 +39,19 @@ func NewPubSubRouter(h host.Host, oracleTopic string, isBootstrap bool) *PubSubR
|
|||||||
|
|
||||||
if isBootstrap {
|
if isBootstrap {
|
||||||
// turn off the mesh in bootstrappers -- only do gossip and PX
|
// turn off the mesh in bootstrappers -- only do gossip and PX
|
||||||
pubsub.GossipSubD = 0
|
//pubsub.GossipSubD = 0
|
||||||
pubsub.GossipSubDscore = 0
|
//pubsub.GossipSubDscore = 0
|
||||||
pubsub.GossipSubDlo = 0
|
//pubsub.GossipSubDlo = 0
|
||||||
pubsub.GossipSubDhi = 0
|
//pubsub.GossipSubDhi = 0
|
||||||
pubsub.GossipSubDout = 0
|
//pubsub.GossipSubDout = 0
|
||||||
pubsub.GossipSubDlazy = 64
|
//pubsub.GossipSubDlazy = 64
|
||||||
pubsub.GossipSubGossipFactor = 0.25
|
//pubsub.GossipSubGossipFactor = 0.25
|
||||||
pubsub.GossipSubPruneBackoff = 5 * time.Minute
|
//pubsub.GossipSubPruneBackoff = 5 * time.Minute
|
||||||
// turn on PX
|
// 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(),
|
context.TODO(),
|
||||||
psr.node,
|
psr.node,
|
||||||
pbOptions...,
|
pbOptions...,
|
||||||
|
Loading…
Reference in New Issue
Block a user