frostfs-node/pkg/innerring/processors/neofs/process_config.go
Pavel Karpy 923f84722a Move to frostfs-node
Signed-off-by: Pavel Karpy <p.karpy@yadro.com>
2022-12-28 15:04:29 +03:00

28 lines
725 B
Go

package frostfs
import (
nmClient "github.com/TrueCloudLab/frostfs-node/pkg/morph/client/netmap"
frostfsEvent "github.com/TrueCloudLab/frostfs-node/pkg/morph/event/neofs"
"go.uber.org/zap"
)
// Process config event by setting configuration value from the mainchain in
// the sidechain.
func (np *Processor) processConfig(config *frostfsEvent.Config) {
if !np.alphabetState.IsAlphabet() {
np.log.Info("non alphabet mode, ignore config")
return
}
prm := nmClient.SetConfigPrm{}
prm.SetID(config.ID())
prm.SetKey(config.Key())
prm.SetValue(config.Value())
prm.SetHash(config.TxHash())
err := np.netmapClient.SetConfig(prm)
if err != nil {
np.log.Error("can't relay set config event", zap.Error(err))
}
}