frostfs-node/pkg/innerring/processors/frostfs/process_config.go
Alex Vanin 20de74a505 Rename package name
Due to source code relocation from GitHub.

Signed-off-by: Alex Vanin <a.vanin@yadro.com>
2023-03-07 16:38:26 +03:00

28 lines
739 B
Go

package frostfs
import (
nmClient "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/morph/client/netmap"
frostfsEvent "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/morph/event/frostfs"
"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))
}
}