forked from TrueCloudLab/frostfs-node
[#248] adm: Remove obsolete network parameters
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
parent
4ad0ebb32f
commit
26a78aa366
8 changed files with 2 additions and 26 deletions
|
@ -36,9 +36,7 @@ alphabet-wallets: /path # path to consensus node / alphabet wallets s
|
||||||
network:
|
network:
|
||||||
max_object_size: 67108864 # max size of a single FrostFS object, bytes
|
max_object_size: 67108864 # max size of a single FrostFS object, bytes
|
||||||
epoch_duration: 240 # duration of a FrostFS epoch in blocks, consider block generation frequency in the sidechain
|
epoch_duration: 240 # duration of a FrostFS epoch in blocks, consider block generation frequency in the sidechain
|
||||||
basic_income_rate: 0 # basic income rate, for private consider 0
|
|
||||||
fee:
|
fee:
|
||||||
audit: 0 # network audit fee, for private installation consider 0
|
|
||||||
candidate: 0 # inner ring candidate registration fee, for private installation consider 0
|
candidate: 0 # inner ring candidate registration fee, for private installation consider 0
|
||||||
container: 0 # container creation fee, for private installation consider 0
|
container: 0 # container creation fee, for private installation consider 0
|
||||||
container_alias: 0 # container nice-name registration fee, for private installation consider 0
|
container_alias: 0 # container nice-name registration fee, for private installation consider 0
|
||||||
|
|
|
@ -34,9 +34,7 @@ alphabet-wallets: /home/user/deploy/alphabet-wallets
|
||||||
network:
|
network:
|
||||||
max_object_size: 67108864
|
max_object_size: 67108864
|
||||||
epoch_duration: 240
|
epoch_duration: 240
|
||||||
basic_income_rate: 0
|
|
||||||
fee:
|
fee:
|
||||||
audit: 0
|
|
||||||
candidate: 0
|
candidate: 0
|
||||||
container: 0
|
container: 0
|
||||||
withdraw: 0
|
withdraw: 0
|
||||||
|
|
|
@ -18,8 +18,6 @@ type configTemplate struct {
|
||||||
AlphabetDir string
|
AlphabetDir string
|
||||||
MaxObjectSize int
|
MaxObjectSize int
|
||||||
EpochDuration int
|
EpochDuration int
|
||||||
BasicIncomeRate int
|
|
||||||
AuditFee int
|
|
||||||
CandidateFee int
|
CandidateFee int
|
||||||
ContainerFee int
|
ContainerFee int
|
||||||
ContainerAliasFee int
|
ContainerAliasFee int
|
||||||
|
@ -33,10 +31,8 @@ alphabet-wallets: {{ .AlphabetDir}}
|
||||||
network:
|
network:
|
||||||
max_object_size: {{ .MaxObjectSize}}
|
max_object_size: {{ .MaxObjectSize}}
|
||||||
epoch_duration: {{ .EpochDuration}}
|
epoch_duration: {{ .EpochDuration}}
|
||||||
basic_income_rate: {{ .BasicIncomeRate}}
|
|
||||||
homomorphic_hash_disabled: {{ .HomomorphicHashDisabled}}
|
homomorphic_hash_disabled: {{ .HomomorphicHashDisabled}}
|
||||||
fee:
|
fee:
|
||||||
audit: {{ .AuditFee}}
|
|
||||||
candidate: {{ .CandidateFee}}
|
candidate: {{ .CandidateFee}}
|
||||||
container: {{ .ContainerFee}}
|
container: {{ .ContainerFee}}
|
||||||
container_alias: {{ .ContainerAliasFee }}
|
container_alias: {{ .ContainerAliasFee }}
|
||||||
|
@ -111,9 +107,7 @@ func generateConfigExample(appDir string, credSize int) (string, error) {
|
||||||
Endpoint: "https://neo.rpc.node:30333",
|
Endpoint: "https://neo.rpc.node:30333",
|
||||||
MaxObjectSize: 67108864, // 64 MiB
|
MaxObjectSize: 67108864, // 64 MiB
|
||||||
EpochDuration: 240, // 1 hour with 15s per block
|
EpochDuration: 240, // 1 hour with 15s per block
|
||||||
BasicIncomeRate: 1_0000_0000, // 0.0001 GAS per GiB (Fixed12)
|
|
||||||
HomomorphicHashDisabled: false, // object homomorphic hash is enabled
|
HomomorphicHashDisabled: false, // object homomorphic hash is enabled
|
||||||
AuditFee: 1_0000, // 0.00000001 GAS per audit (Fixed12)
|
|
||||||
CandidateFee: 100_0000_0000, // 100.0 GAS (Fixed8)
|
CandidateFee: 100_0000_0000, // 100.0 GAS (Fixed8)
|
||||||
ContainerFee: 1000, // 0.000000001 * 7 GAS per container (Fixed12)
|
ContainerFee: 1000, // 0.000000001 * 7 GAS per container (Fixed12)
|
||||||
ContainerAliasFee: 500, // ContainerFee / 2
|
ContainerAliasFee: 500, // ContainerFee / 2
|
||||||
|
|
|
@ -28,8 +28,6 @@ func TestGenerateConfigExample(t *testing.T) {
|
||||||
require.Equal(t, filepath.Join(appDir, "alphabet-wallets"), v.GetString("alphabet-wallets"))
|
require.Equal(t, filepath.Join(appDir, "alphabet-wallets"), v.GetString("alphabet-wallets"))
|
||||||
require.Equal(t, 67108864, v.GetInt("network.max_object_size"))
|
require.Equal(t, 67108864, v.GetInt("network.max_object_size"))
|
||||||
require.Equal(t, 240, v.GetInt("network.epoch_duration"))
|
require.Equal(t, 240, v.GetInt("network.epoch_duration"))
|
||||||
require.Equal(t, 100000000, v.GetInt("network.basic_income_rate"))
|
|
||||||
require.Equal(t, 10000, v.GetInt("network.fee.audit"))
|
|
||||||
require.Equal(t, 10000000000, v.GetInt("network.fee.candidate"))
|
require.Equal(t, 10000000000, v.GetInt("network.fee.candidate"))
|
||||||
require.Equal(t, 1000, v.GetInt("network.fee.container"))
|
require.Equal(t, 1000, v.GetInt("network.fee.container"))
|
||||||
require.Equal(t, 100000000, v.GetInt("network.fee.withdraw"))
|
require.Equal(t, 100000000, v.GetInt("network.fee.withdraw"))
|
||||||
|
|
|
@ -54,8 +54,7 @@ func dumpNetworkConfig(cmd *cobra.Command, _ []string) error {
|
||||||
}
|
}
|
||||||
for k, v := range m {
|
for k, v := range m {
|
||||||
switch k {
|
switch k {
|
||||||
case netmap.AuditFeeConfig, netmap.BasicIncomeRateConfig,
|
case netmap.ContainerFeeConfig, netmap.ContainerAliasFeeConfig,
|
||||||
netmap.ContainerFeeConfig, netmap.ContainerAliasFeeConfig,
|
|
||||||
netmap.EpochDurationConfig, netmap.IrCandidateFeeConfig,
|
netmap.EpochDurationConfig, netmap.IrCandidateFeeConfig,
|
||||||
netmap.MaxObjectSizeConfig, netmap.WithdrawFeeConfig:
|
netmap.MaxObjectSizeConfig, netmap.WithdrawFeeConfig:
|
||||||
nbuf := make([]byte, 8)
|
nbuf := make([]byte, 8)
|
||||||
|
@ -134,8 +133,7 @@ func parseConfigPair(kvStr string, force bool) (key string, val any, err error)
|
||||||
valRaw := v
|
valRaw := v
|
||||||
|
|
||||||
switch key {
|
switch key {
|
||||||
case netmap.AuditFeeConfig, netmap.BasicIncomeRateConfig,
|
case netmap.ContainerFeeConfig, netmap.ContainerAliasFeeConfig,
|
||||||
netmap.ContainerFeeConfig, netmap.ContainerAliasFeeConfig,
|
|
||||||
netmap.EpochDurationConfig, netmap.IrCandidateFeeConfig,
|
netmap.EpochDurationConfig, netmap.IrCandidateFeeConfig,
|
||||||
netmap.MaxObjectSizeConfig, netmap.WithdrawFeeConfig:
|
netmap.MaxObjectSizeConfig, netmap.WithdrawFeeConfig:
|
||||||
val, err = strconv.ParseInt(valRaw, 10, 64)
|
val, err = strconv.ParseInt(valRaw, 10, 64)
|
||||||
|
|
|
@ -69,10 +69,8 @@ var (
|
||||||
netmapConfigKeys = []string{
|
netmapConfigKeys = []string{
|
||||||
netmap.EpochDurationConfig,
|
netmap.EpochDurationConfig,
|
||||||
netmap.MaxObjectSizeConfig,
|
netmap.MaxObjectSizeConfig,
|
||||||
netmap.AuditFeeConfig,
|
|
||||||
netmap.ContainerFeeConfig,
|
netmap.ContainerFeeConfig,
|
||||||
netmap.ContainerAliasFeeConfig,
|
netmap.ContainerAliasFeeConfig,
|
||||||
netmap.BasicIncomeRateConfig,
|
|
||||||
netmap.IrCandidateFeeConfig,
|
netmap.IrCandidateFeeConfig,
|
||||||
netmap.WithdrawFeeConfig,
|
netmap.WithdrawFeeConfig,
|
||||||
netmap.HomomorphicHashingDisabledKey,
|
netmap.HomomorphicHashingDisabledKey,
|
||||||
|
|
|
@ -12,10 +12,8 @@ func getDefaultNetmapContractConfigMap() map[string]any {
|
||||||
m := make(map[string]any)
|
m := make(map[string]any)
|
||||||
m[netmap.EpochDurationConfig] = viper.GetInt64(epochDurationInitFlag)
|
m[netmap.EpochDurationConfig] = viper.GetInt64(epochDurationInitFlag)
|
||||||
m[netmap.MaxObjectSizeConfig] = viper.GetInt64(maxObjectSizeInitFlag)
|
m[netmap.MaxObjectSizeConfig] = viper.GetInt64(maxObjectSizeInitFlag)
|
||||||
m[netmap.AuditFeeConfig] = viper.GetInt64(auditFeeInitFlag)
|
|
||||||
m[netmap.ContainerFeeConfig] = viper.GetInt64(containerFeeInitFlag)
|
m[netmap.ContainerFeeConfig] = viper.GetInt64(containerFeeInitFlag)
|
||||||
m[netmap.ContainerAliasFeeConfig] = viper.GetInt64(containerAliasFeeInitFlag)
|
m[netmap.ContainerAliasFeeConfig] = viper.GetInt64(containerAliasFeeInitFlag)
|
||||||
m[netmap.BasicIncomeRateConfig] = viper.GetInt64(incomeRateInitFlag)
|
|
||||||
m[netmap.IrCandidateFeeConfig] = viper.GetInt64(candidateFeeInitFlag)
|
m[netmap.IrCandidateFeeConfig] = viper.GetInt64(candidateFeeInitFlag)
|
||||||
m[netmap.WithdrawFeeConfig] = viper.GetInt64(withdrawFeeInitFlag)
|
m[netmap.WithdrawFeeConfig] = viper.GetInt64(withdrawFeeInitFlag)
|
||||||
m[netmap.HomomorphicHashingDisabledKey] = viper.GetBool(homomorphicHashDisabledInitFlag)
|
m[netmap.HomomorphicHashingDisabledKey] = viper.GetBool(homomorphicHashDisabledInitFlag)
|
||||||
|
|
|
@ -18,10 +18,6 @@ const (
|
||||||
maxObjectSizeCLIFlag = "max-object-size"
|
maxObjectSizeCLIFlag = "max-object-size"
|
||||||
epochDurationInitFlag = "network.epoch_duration"
|
epochDurationInitFlag = "network.epoch_duration"
|
||||||
epochDurationCLIFlag = "epoch-duration"
|
epochDurationCLIFlag = "epoch-duration"
|
||||||
incomeRateInitFlag = "network.basic_income_rate"
|
|
||||||
incomeRateCLIFlag = "basic-income-rate"
|
|
||||||
auditFeeInitFlag = "network.fee.audit"
|
|
||||||
auditFeeCLIFlag = "audit-fee"
|
|
||||||
containerFeeInitFlag = "network.fee.container"
|
containerFeeInitFlag = "network.fee.container"
|
||||||
containerAliasFeeInitFlag = "network.fee.container_alias"
|
containerAliasFeeInitFlag = "network.fee.container_alias"
|
||||||
containerFeeCLIFlag = "container-fee"
|
containerFeeCLIFlag = "container-fee"
|
||||||
|
@ -69,9 +65,7 @@ var (
|
||||||
_ = viper.BindPFlag(endpointFlag, cmd.Flags().Lookup(endpointFlag))
|
_ = viper.BindPFlag(endpointFlag, cmd.Flags().Lookup(endpointFlag))
|
||||||
_ = viper.BindPFlag(epochDurationInitFlag, cmd.Flags().Lookup(epochDurationCLIFlag))
|
_ = viper.BindPFlag(epochDurationInitFlag, cmd.Flags().Lookup(epochDurationCLIFlag))
|
||||||
_ = viper.BindPFlag(maxObjectSizeInitFlag, cmd.Flags().Lookup(maxObjectSizeCLIFlag))
|
_ = viper.BindPFlag(maxObjectSizeInitFlag, cmd.Flags().Lookup(maxObjectSizeCLIFlag))
|
||||||
_ = viper.BindPFlag(incomeRateInitFlag, cmd.Flags().Lookup(incomeRateCLIFlag))
|
|
||||||
_ = viper.BindPFlag(homomorphicHashDisabledInitFlag, cmd.Flags().Lookup(homomorphicHashDisabledCLIFlag))
|
_ = viper.BindPFlag(homomorphicHashDisabledInitFlag, cmd.Flags().Lookup(homomorphicHashDisabledCLIFlag))
|
||||||
_ = viper.BindPFlag(auditFeeInitFlag, cmd.Flags().Lookup(auditFeeCLIFlag))
|
|
||||||
_ = viper.BindPFlag(candidateFeeInitFlag, cmd.Flags().Lookup(candidateFeeCLIFlag))
|
_ = viper.BindPFlag(candidateFeeInitFlag, cmd.Flags().Lookup(candidateFeeCLIFlag))
|
||||||
_ = viper.BindPFlag(containerFeeInitFlag, cmd.Flags().Lookup(containerFeeCLIFlag))
|
_ = viper.BindPFlag(containerFeeInitFlag, cmd.Flags().Lookup(containerFeeCLIFlag))
|
||||||
_ = viper.BindPFlag(containerAliasFeeInitFlag, cmd.Flags().Lookup(containerAliasFeeCLIFlag))
|
_ = viper.BindPFlag(containerAliasFeeInitFlag, cmd.Flags().Lookup(containerAliasFeeCLIFlag))
|
||||||
|
|
Loading…
Reference in a new issue