forked from TrueCloudLab/frostfs-node
[#932] neofs-cli: Support ContainerAliasFee
global config parameter
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
parent
751147793f
commit
eaecc438f8
2 changed files with 28 additions and 9 deletions
|
@ -128,6 +128,10 @@ func (x *netCfgWriter) ContainerFee(v uint64) {
|
||||||
x.print("Container fee", v, false)
|
x.print("Container fee", v, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (x *netCfgWriter) ContainerAliasFee(v uint64) {
|
||||||
|
x.print("Container alias fee", v, false)
|
||||||
|
}
|
||||||
|
|
||||||
func (x *netCfgWriter) EigenTrustIterations(v uint64) {
|
func (x *netCfgWriter) EigenTrustIterations(v uint64) {
|
||||||
x.print("Number EigenTrust of iterations", v, false)
|
x.print("Number EigenTrust of iterations", v, false)
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,15 +9,16 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
maxObjectSizeConfig = "MaxObjectSize"
|
maxObjectSizeConfig = "MaxObjectSize"
|
||||||
basicIncomeRateConfig = "BasicIncomeRate"
|
basicIncomeRateConfig = "BasicIncomeRate"
|
||||||
auditFeeConfig = "AuditFee"
|
auditFeeConfig = "AuditFee"
|
||||||
epochDurationConfig = "EpochDuration"
|
epochDurationConfig = "EpochDuration"
|
||||||
containerFeeConfig = "ContainerFee"
|
containerFeeConfig = "ContainerFee"
|
||||||
etIterationsConfig = "EigenTrustIterations"
|
containerAliasFeeConfig = "ContainerAliasFee"
|
||||||
etAlphaConfig = "EigenTrustAlpha"
|
etIterationsConfig = "EigenTrustIterations"
|
||||||
irCandidateFeeConfig = "InnerRingCandidateFee"
|
etAlphaConfig = "EigenTrustAlpha"
|
||||||
withdrawFeeConfig = "WithdrawFee"
|
irCandidateFeeConfig = "InnerRingCandidateFee"
|
||||||
|
withdrawFeeConfig = "WithdrawFee"
|
||||||
)
|
)
|
||||||
|
|
||||||
// MaxObjectSize receives max object size configuration
|
// MaxObjectSize receives max object size configuration
|
||||||
|
@ -74,6 +75,17 @@ func (w *Wrapper) ContainerFee() (uint64, error) {
|
||||||
return fee, nil
|
return fee, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ContainerAliasFee returns additional fee paid by container owner to each
|
||||||
|
// alphabet node for container nice name registration.
|
||||||
|
func (w *Wrapper) ContainerAliasFee() (uint64, error) {
|
||||||
|
fee, err := w.readUInt64Config(containerAliasFeeConfig)
|
||||||
|
if err != nil {
|
||||||
|
return 0, fmt.Errorf("(%T) could not get container alias fee: %w", w, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return fee, nil
|
||||||
|
}
|
||||||
|
|
||||||
// EigenTrustIterations returns global configuration value of iteration cycles
|
// EigenTrustIterations returns global configuration value of iteration cycles
|
||||||
// for EigenTrust algorithm per epoch.
|
// for EigenTrust algorithm per epoch.
|
||||||
func (w *Wrapper) EigenTrustIterations() (uint64, error) {
|
func (w *Wrapper) EigenTrustIterations() (uint64, error) {
|
||||||
|
@ -185,6 +197,7 @@ type ConfigWriter interface {
|
||||||
AuditFee(uint64)
|
AuditFee(uint64)
|
||||||
EpochDuration(uint64)
|
EpochDuration(uint64)
|
||||||
ContainerFee(uint64)
|
ContainerFee(uint64)
|
||||||
|
ContainerAliasFee(uint64)
|
||||||
EigenTrustIterations(uint64)
|
EigenTrustIterations(uint64)
|
||||||
EigenTrustAlpha(float64)
|
EigenTrustAlpha(float64)
|
||||||
InnerRingCandidateFee(uint64)
|
InnerRingCandidateFee(uint64)
|
||||||
|
@ -209,6 +222,8 @@ func WriteConfig(dst ConfigWriter, iterator func(func(key, val []byte) error) er
|
||||||
dst.EpochDuration(bigint.FromBytes(val).Uint64())
|
dst.EpochDuration(bigint.FromBytes(val).Uint64())
|
||||||
case containerFeeConfig:
|
case containerFeeConfig:
|
||||||
dst.ContainerFee(bigint.FromBytes(val).Uint64())
|
dst.ContainerFee(bigint.FromBytes(val).Uint64())
|
||||||
|
case containerAliasFeeConfig:
|
||||||
|
dst.ContainerAliasFee(bigint.FromBytes(val).Uint64())
|
||||||
case etIterationsConfig:
|
case etIterationsConfig:
|
||||||
dst.EigenTrustIterations(bigint.FromBytes(val).Uint64())
|
dst.EigenTrustIterations(bigint.FromBytes(val).Uint64())
|
||||||
case etAlphaConfig:
|
case etAlphaConfig:
|
||||||
|
|
Loading…
Reference in a new issue