Add config for durable store
This commit is contained in:
parent
8045b4cfbb
commit
de0ba7fea6
@ -44,6 +44,8 @@ func addNitroFlags(command *cobra.Command) {
|
||||
command.PersistentFlags().String("nitro-naAddress", "", "nitro naAddress")
|
||||
command.PersistentFlags().String("nitro-vpaAddress", "", "nitro vpaAddress")
|
||||
command.PersistentFlags().String("nitro-caAddress", "", "nitro caAddress")
|
||||
command.PersistentFlags().Bool("nitro-useDurableStore", false, "nitro useDurableStore")
|
||||
command.PersistentFlags().String("nitro-durableStoreFolder", "", "nitro durableStoreFolder")
|
||||
|
||||
// nitro flag bindings
|
||||
viper.BindPFlag("nitro.pk", command.PersistentFlags().Lookup("nitro-pk"))
|
||||
@ -52,4 +54,6 @@ func addNitroFlags(command *cobra.Command) {
|
||||
viper.BindPFlag("nitro.naAddress", command.PersistentFlags().Lookup("nitro-naAddress"))
|
||||
viper.BindPFlag("nitro.vpaAddress", command.PersistentFlags().Lookup("nitro-vpaAddress"))
|
||||
viper.BindPFlag("nitro.caAddress", command.PersistentFlags().Lookup("nitro-caAddress"))
|
||||
viper.BindPFlag("nitro.useDurableStore", command.PersistentFlags().Lookup("nitro-useDurableStore"))
|
||||
viper.BindPFlag("nitro.durableStoreFolder", command.PersistentFlags().Lookup("nitro-durableStoreFolder"))
|
||||
}
|
||||
|
@ -392,8 +392,8 @@ func init() {
|
||||
func initializeNitroNode(nitroConfig *s.NitroConfig) (*nitroNode.Node, error) {
|
||||
// TODO: Configure
|
||||
pkString := nitroConfig.Pk
|
||||
useDurableStore := true
|
||||
durableStoreFolder := "./data/nitro-store"
|
||||
useDurableStore := nitroConfig.UseDurableStore
|
||||
durableStoreFolder := nitroConfig.DurableStoreFolder
|
||||
msgPort := 3005
|
||||
wsMsgPort := 5005
|
||||
chainUrl := nitroConfig.ChainUrl
|
||||
|
@ -39,3 +39,5 @@
|
||||
naAddress = ""
|
||||
vpaAddress = ""
|
||||
caAddress = ""
|
||||
useDurableStore = false # NITRO_USE_DURABLE_STORE
|
||||
durableStoreFolder = "" # NITRO_DURABLE_STORE_FOLDER
|
||||
|
@ -86,6 +86,8 @@ const (
|
||||
NITRO_NA_ADDRESS = "NITRO_NA_ADDRESS"
|
||||
NITRO_VPA_ADDRESS = "NITRO_VPA_ADDRESS"
|
||||
NITRO_CA_ADDRESS = "NITRO_CA_ADDRESS"
|
||||
NITRO_USE_DURABLE_STORE = "NITRO_USE_DURABLE_STORE"
|
||||
NITRO_DURABLE_STORE_FOLDER = "NITRO_DURABLE_STORE_FOLDER"
|
||||
)
|
||||
|
||||
type NitroConfig struct {
|
||||
@ -95,6 +97,8 @@ type NitroConfig struct {
|
||||
NaAddress string
|
||||
VpaAddress string
|
||||
CaAddress string
|
||||
UseDurableStore bool
|
||||
DurableStoreFolder string
|
||||
}
|
||||
|
||||
// Config struct
|
||||
@ -309,6 +313,8 @@ func (c *Config) loadNitroConfig() {
|
||||
viper.BindEnv("nitro.naAddress", NITRO_NA_ADDRESS)
|
||||
viper.BindEnv("nitro.vpaAddress", NITRO_VPA_ADDRESS)
|
||||
viper.BindEnv("nitro.caAddress", NITRO_CA_ADDRESS)
|
||||
viper.BindEnv("nitro.useDurableStore", NITRO_USE_DURABLE_STORE)
|
||||
viper.BindEnv("nitro.durableStoreFolder", NITRO_DURABLE_STORE_FOLDER)
|
||||
|
||||
c.Nitro.Pk = viper.GetString("nitro.pk")
|
||||
c.Nitro.ChainPk = viper.GetString("nitro.chainPk")
|
||||
@ -316,6 +322,8 @@ func (c *Config) loadNitroConfig() {
|
||||
c.Nitro.NaAddress = viper.GetString("nitro.naAddress")
|
||||
c.Nitro.VpaAddress = viper.GetString("nitro.vpaAddress")
|
||||
c.Nitro.CaAddress = viper.GetString("nitro.caAddress")
|
||||
c.Nitro.UseDurableStore = viper.GetBool("nitro.useDurableStore")
|
||||
c.Nitro.DurableStoreFolder = viper.GetString("nitro.durableStoreFolder")
|
||||
}
|
||||
|
||||
func (c *Config) loadGroupCacheConfig() {
|
||||
|
Loading…
Reference in New Issue
Block a user