feat: enable filter full node via node config
This commit is contained in:
parent
bd6f9b098b
commit
7d03ae8272
|
@ -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,
|
||||||
|
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------
|
// ----------
|
||||||
|
|
|
@ -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{
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
Loading…
Reference in New Issue