-
Notifications
You must be signed in to change notification settings - Fork 151
/
params.go
34 lines (28 loc) · 1.22 KB
/
params.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package migrator
import (
"time"
flag "github.com/spf13/pflag"
"github.com/iotaledger/hornet/pkg/model/migrator"
"github.com/iotaledger/hornet/pkg/node"
)
const (
// CfgMigratorStateFilePath configures the path to the state file of the migrator.
CfgMigratorStateFilePath = "migrator.stateFilePath"
// CfgMigratorReceiptMaxEntries defines the max amount of entries to embed within a receipt.
CfgMigratorReceiptMaxEntries = "migrator.receiptMaxEntries"
// CfgMigratorQueryCooldownPeriod configures the cooldown period for the service to ask for new data
// from the legacy node in case the migrator encounters an error.
CfgMigratorQueryCooldownPeriod = "migrator.queryCooldownPeriod"
)
var params = &node.PluginParams{
Params: map[string]*flag.FlagSet{
"nodeConfig": func() *flag.FlagSet {
fs := flag.NewFlagSet("", flag.ContinueOnError)
fs.String(CfgMigratorStateFilePath, "migrator.state", "path to the state file of the migrator")
fs.Int(CfgMigratorReceiptMaxEntries, migrator.SensibleMaxEntriesCount, "the max amount of entries to embed within a receipt")
fs.Duration(CfgMigratorQueryCooldownPeriod, 5*time.Second, "the cooldown period of the service to ask for new data")
return fs
}(),
},
Masked: nil,
}