Skip to content

Commit a384854

Browse files
committed
refactor: remove waku dbstore
iterates: #6792
1 parent 4f19a94 commit a384854

File tree

6 files changed

+3
-502
lines changed

6 files changed

+3
-502
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
DROP INDEX IF EXISTS store_message_senderTimestamp;
2+
DROP INDEX IF EXISTS store_message_receiverTimestamp;
3+
DROP TABLE IF EXISTS store_messages;

messaging/waku/config.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,6 @@ type Config struct {
5353
DiscoveryLimit int `toml:",omitempty"` // Indicates the number of nodes to discover with peer exchange client
5454
AutoUpdate bool `toml:",omitempty"`
5555
UDPPort int `toml:",omitempty"`
56-
EnableStore bool `toml:",omitempty"`
57-
StoreCapacity int `toml:",omitempty"`
58-
StoreSeconds int `toml:",omitempty"`
5956
MetricsEnabled bool `toml:",omitempty"`
6057
DefaultShardPubsubTopic string `toml:",omitempty"` // Pubsub topic to be used by default for messages that do not have a topic assigned (depending whether sharding is used or not)
6158
DefaultShardedPubsubTopics []string `toml:", omitempty"`

messaging/waku/gowaku.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -343,18 +343,6 @@ func New(nodeKey *ecdsa.PrivateKey, cfg *Config, logger *zap.Logger, appDB *sql.
343343
cfg.EnableStoreConfirmationForMessagesSent = true
344344
}
345345

346-
if cfg.EnableStore {
347-
if appDB == nil {
348-
return nil, errors.New("appDB is required for store")
349-
}
350-
opts = append(opts, node.WithWakuStore())
351-
dbStore, err := persistence.NewDBStore(logger, persistence.WithDB(appDB), persistence.WithRetentionPolicy(cfg.StoreCapacity, time.Duration(cfg.StoreSeconds)*time.Second))
352-
if err != nil {
353-
return nil, err
354-
}
355-
opts = append(opts, node.WithMessageProvider(dbStore))
356-
}
357-
358346
if !cfg.LightClient {
359347
opts = append(opts, node.WithWakuFilterFullNode(filter.WithMaxSubscribers(20)))
360348
opts = append(opts, node.WithLightPush(lightpush.WithRateLimiter(5, 10)))

messaging/waku/nwaku.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1698,7 +1698,6 @@ func gowakuToNwakuConfig(cfg *Config, logger *zap.Logger) *bindingscommon.WakuCo
16981698
nwakuCfg.Discv5Discovery = cfg.EnableDiscV5
16991699
nwakuCfg.Discv5EnrAutoUpdate = cfg.AutoUpdate
17001700
nwakuCfg.Discv5UdpPort = cfg.UDPPort
1701-
nwakuCfg.Store = cfg.EnableStore
17021701

17031702
if cfg.Nameserver != "" {
17041703
nwakuCfg.DnsAddrsNameServers = []string{cfg.Nameserver}
@@ -1728,12 +1727,6 @@ func gowakuToNwakuConfig(cfg *Config, logger *zap.Logger) *bindingscommon.WakuCo
17281727
nwakuCfg.Shards = append(nwakuCfg.Shards, sharded.Shard())
17291728
}
17301729

1731-
if cfg.StoreCapacity > 0 {
1732-
nwakuCfg.StoreMessageRetentionPolicy = fmt.Sprintf("capacity:%d", cfg.StoreCapacity)
1733-
} else if cfg.StoreSeconds > 0 {
1734-
nwakuCfg.StoreMessageRetentionPolicy = fmt.Sprintf("time:%d", cfg.StoreSeconds)
1735-
}
1736-
17371730
if !cfg.LightClient {
17381731
nwakuCfg.Discv5Discovery = true
17391732
nwakuCfg.Relay = true

messaging/waku/persistence/dbkey.go

Lines changed: 0 additions & 56 deletions
This file was deleted.

0 commit comments

Comments
 (0)