feat: enable filter full node via node config

This commit is contained in:
Richard Ramos 2023-09-27 16:06:53 -04:00 committed by richΛrd
parent bd6f9b098b
commit 7d03ae8272
5 changed files with 10 additions and 1 deletions

View File

@ -1 +1 @@
0.167.2 0.167.4

View File

@ -314,6 +314,7 @@ func (b *StatusNode) wakuV2Service(nodeConfig *params.NodeConfig, telemetryServe
Rendezvous: nodeConfig.Rendezvous, Rendezvous: nodeConfig.Rendezvous,
WakuNodes: nodeConfig.ClusterConfig.WakuNodes, WakuNodes: nodeConfig.ClusterConfig.WakuNodes,
PeerExchange: nodeConfig.WakuV2Config.PeerExchange, PeerExchange: nodeConfig.WakuV2Config.PeerExchange,
EnableFilterFullNode: nodeConfig.WakuV2Config.EnableFilterFullNode,
EnableStore: nodeConfig.WakuV2Config.EnableStore, EnableStore: nodeConfig.WakuV2Config.EnableStore,
StoreCapacity: nodeConfig.WakuV2Config.StoreCapacity, StoreCapacity: nodeConfig.WakuV2Config.StoreCapacity,
StoreSeconds: nodeConfig.WakuV2Config.StoreSeconds, StoreSeconds: nodeConfig.WakuV2Config.StoreSeconds,

View File

@ -212,6 +212,9 @@ type WakuV2Config struct {
// StoreSeconds indicates the maximum number of seconds before a message is removed from the store // StoreSeconds indicates the maximum number of seconds before a message is removed from the store
StoreSeconds int StoreSeconds int
// EnableFilterNode indicates if WakuFilter Full Node should be enabled
EnableFilterFullNode bool
} }
// ---------- // ----------

View File

@ -44,6 +44,7 @@ type Config struct {
StoreCapacity int `toml:",omitempty"` StoreCapacity int `toml:",omitempty"`
StoreSeconds int `toml:",omitempty"` StoreSeconds int `toml:",omitempty"`
TelemetryServerURL string `toml:",omitempty"` TelemetryServerURL string `toml:",omitempty"`
EnableFilterFullNode bool `toml:",omitempty"`
} }
var DefaultConfig = Config{ var DefaultConfig = Config{

View File

@ -306,6 +306,10 @@ func New(nodeKey string, fleet string, cfg *Config, logger *zap.Logger, appDB *s
opts = append(opts, node.WithMessageProvider(dbStore)) opts = append(opts, node.WithMessageProvider(dbStore))
} }
if cfg.EnableFilterFullNode {
opts = append(opts, node.WithWakuFilterFullNode())
}
if appDB != nil { if appDB != nil {
waku.protectedTopicStore, err = persistence.NewProtectedTopicsStore(logger, appDB) waku.protectedTopicStore, err = persistence.NewProtectedTopicsStore(logger, appDB)
if err != nil { if err != nil {