mirror of https://github.com/status-im/go-waku.git
chore: remove `--persist-messages` flag
This commit is contained in:
parent
57a525f71e
commit
b242389e05
8
waku.go
8
waku.go
|
@ -135,12 +135,6 @@ func main() {
|
||||||
Usage: "Use SQLiteDB to persist information",
|
Usage: "Use SQLiteDB to persist information",
|
||||||
Destination: &options.UseDB,
|
Destination: &options.UseDB,
|
||||||
},
|
},
|
||||||
&cli.BoolFlag{
|
|
||||||
Name: "persist-messages",
|
|
||||||
Usage: "Enable message persistence",
|
|
||||||
Destination: &options.Store.PersistMessages,
|
|
||||||
Value: false,
|
|
||||||
},
|
|
||||||
&cli.BoolFlag{
|
&cli.BoolFlag{
|
||||||
Name: "persist-peers",
|
Name: "persist-peers",
|
||||||
Usage: "Enable peer persistence",
|
Usage: "Enable peer persistence",
|
||||||
|
@ -219,7 +213,7 @@ func main() {
|
||||||
},
|
},
|
||||||
&cli.BoolFlag{
|
&cli.BoolFlag{
|
||||||
Name: "store",
|
Name: "store",
|
||||||
Usage: "Enable relay protocol",
|
Usage: "Enable store protocol to persist messages",
|
||||||
Destination: &options.Store.Enable,
|
Destination: &options.Store.Enable,
|
||||||
},
|
},
|
||||||
&cli.BoolFlag{
|
&cli.BoolFlag{
|
||||||
|
|
|
@ -205,15 +205,12 @@ func Execute(options Options) {
|
||||||
nodeOpts = append(nodeOpts, node.WithWakuFilter(!options.Filter.DisableFullNode, filter.WithTimeout(options.Filter.Timeout)))
|
nodeOpts = append(nodeOpts, node.WithWakuFilter(!options.Filter.DisableFullNode, filter.WithTimeout(options.Filter.Timeout)))
|
||||||
}
|
}
|
||||||
|
|
||||||
if options.Store.Enable {
|
nodeOpts = append(nodeOpts, node.WithWakuStore(options.Store.Enable, options.Store.ShouldResume))
|
||||||
if options.Store.PersistMessages {
|
if options.Store.Enable && options.UseDB {
|
||||||
nodeOpts = append(nodeOpts, node.WithWakuStore(true, options.Store.ShouldResume))
|
|
||||||
dbStore, err := persistence.NewDBStore(logger, persistence.WithDB(db), persistence.WithRetentionPolicy(options.Store.RetentionMaxMessages, options.Store.RetentionTime))
|
dbStore, err := persistence.NewDBStore(logger, persistence.WithDB(db), persistence.WithRetentionPolicy(options.Store.RetentionMaxMessages, options.Store.RetentionTime))
|
||||||
failOnErr(err, "DBStore")
|
failOnErr(err, "DBStore")
|
||||||
nodeOpts = append(nodeOpts, node.WithMessageProvider(dbStore))
|
nodeOpts = append(nodeOpts, node.WithMessageProvider(dbStore))
|
||||||
} else {
|
|
||||||
nodeOpts = append(nodeOpts, node.WithWakuStore(false, false))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if options.LightPush.Enable {
|
if options.LightPush.Enable {
|
||||||
|
|
|
@ -83,7 +83,6 @@ type LightpushOptions struct {
|
||||||
// node and provide message history to nodes that ask for it.
|
// node and provide message history to nodes that ask for it.
|
||||||
type StoreOptions struct {
|
type StoreOptions struct {
|
||||||
Enable bool
|
Enable bool
|
||||||
PersistMessages bool
|
|
||||||
ShouldResume bool
|
ShouldResume bool
|
||||||
RetentionTime time.Duration
|
RetentionTime time.Duration
|
||||||
RetentionMaxMessages int
|
RetentionMaxMessages int
|
||||||
|
|
Loading…
Reference in New Issue