[#927] neofs-adm: provide container alias fee on deploy

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
Evgenii Stratonikov 2021-10-18 15:01:38 +03:00 committed by Alex Vanin
parent 0866c1fb90
commit 26e11a732d
5 changed files with 56 additions and 45 deletions

View file

@ -42,6 +42,7 @@ network:
audit: 0 # network audit fee, for private installation consider 0 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
withdraw: 0 # withdraw fee, for private installation consider 0 withdraw: 0 # withdraw fee, for private installation consider 0
credentials: # passwords for consensus node / alphabet wallets credentials: # passwords for consensus node / alphabet wallets
az: password1 az: password1

View file

@ -23,6 +23,7 @@ type configTemplate struct {
AuditFee int AuditFee int
CandidateFee int CandidateFee int
ContainerFee int ContainerFee int
ContainerAliasFee int
WithdrawFee int WithdrawFee int
Glagolitics []string Glagolitics []string
} }
@ -37,6 +38,7 @@ network:
audit: {{ .AuditFee}} audit: {{ .AuditFee}}
candidate: {{ .CandidateFee}} candidate: {{ .CandidateFee}}
container: {{ .ContainerFee}} container: {{ .ContainerFee}}
container_alias: {{ .ContainerAliasFee }}
withdraw: {{ .WithdrawFee}} withdraw: {{ .WithdrawFee}}
# if credentials section is omitted, then neofs-adm will require manual password input # if credentials section is omitted, then neofs-adm will require manual password input
credentials:{{ range.Glagolitics}} credentials:{{ range.Glagolitics}}
@ -111,6 +113,7 @@ func generateConfigExample(appDir string, credSize int) (string, error) {
AuditFee: 1_0000, // 0.00000001 GAS per audit (Fixed12) 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
WithdrawFee: 1_0000_0000, // 1.0 GAS (Fixed8) WithdrawFee: 1_0000_0000, // 1.0 GAS (Fixed8)
Glagolitics: make([]string, 0, credSize), Glagolitics: make([]string, 0, credSize),
} }

View file

@ -149,7 +149,8 @@ func dumpNetworkConfig(cmd *cobra.Command, _ []string) error {
switch string(k) { switch string(k) {
case netmapAuditFeeKey, netmapBasicIncomeRateKey, case netmapAuditFeeKey, netmapBasicIncomeRateKey,
netmapContainerFeeKey, netmapEigenTrustIterationsKey, netmapContainerFeeKey, netmapContainerAliasFeeKey,
netmapEigenTrustIterationsKey,
netmapEpochKey, netmapInnerRingCandidateFeeKey, netmapEpochKey, netmapInnerRingCandidateFeeKey,
netmapMaxObjectSizeKey, netmapWithdrawFeeKey: netmapMaxObjectSizeKey, netmapWithdrawFeeKey:
nbuf := make([]byte, 8) nbuf := make([]byte, 8)

View file

@ -38,6 +38,7 @@ const (
netmapMaxObjectSizeKey = "MaxObjectSize" netmapMaxObjectSizeKey = "MaxObjectSize"
netmapAuditFeeKey = "AuditFee" netmapAuditFeeKey = "AuditFee"
netmapContainerFeeKey = "ContainerFee" netmapContainerFeeKey = "ContainerFee"
netmapContainerAliasFeeKey = "ContainerAliasFee"
netmapEigenTrustIterationsKey = "EigenTrustIterations" netmapEigenTrustIterationsKey = "EigenTrustIterations"
netmapEigenTrustAlphaKey = "EigenTrustAlpha" netmapEigenTrustAlphaKey = "EigenTrustAlpha"
netmapBasicIncomeRateKey = "BasicIncomeRate" netmapBasicIncomeRateKey = "BasicIncomeRate"
@ -339,6 +340,8 @@ func (c *initializeContext) getContractDeployData(ctrName string, keysParam []sm
{Type: smartcontract.IntegerType, Value: viper.GetInt64(auditFeeInitFlag)}, {Type: smartcontract.IntegerType, Value: viper.GetInt64(auditFeeInitFlag)},
{Type: smartcontract.StringType, Value: netmapContainerFeeKey}, {Type: smartcontract.StringType, Value: netmapContainerFeeKey},
{Type: smartcontract.IntegerType, Value: viper.GetInt64(containerFeeInitFlag)}, {Type: smartcontract.IntegerType, Value: viper.GetInt64(containerFeeInitFlag)},
{Type: smartcontract.StringType, Value: netmapContainerAliasFeeKey},
{Type: smartcontract.IntegerType, Value: viper.GetInt64(containerAliasFeeInitFlag)},
{Type: smartcontract.StringType, Value: netmapEigenTrustIterationsKey}, {Type: smartcontract.StringType, Value: netmapEigenTrustIterationsKey},
{Type: smartcontract.IntegerType, Value: int64(defaultEigenTrustIterations)}, {Type: smartcontract.IntegerType, Value: int64(defaultEigenTrustIterations)},
{Type: smartcontract.StringType, Value: netmapEigenTrustAlphaKey}, {Type: smartcontract.StringType, Value: netmapEigenTrustAlphaKey},

View file

@ -22,7 +22,9 @@ const (
auditFeeInitFlag = "network.fee.audit" auditFeeInitFlag = "network.fee.audit"
auditFeeCLIFlag = "audit-fee" auditFeeCLIFlag = "audit-fee"
containerFeeInitFlag = "network.fee.container" containerFeeInitFlag = "network.fee.container"
containerAliasFeeInitFlag = "network.fee.container_alias"
containerFeeCLIFlag = "container-fee" containerFeeCLIFlag = "container-fee"
containerAliasFeeCLIFlag = "container-alias-fee"
candidateFeeInitFlag = "network.fee.candidate" candidateFeeInitFlag = "network.fee.candidate"
candidateFeeCLIFlag = "candidate-fee" candidateFeeCLIFlag = "candidate-fee"
withdrawFeeInitFlag = "network.fee.withdraw" withdrawFeeInitFlag = "network.fee.withdraw"
@ -62,6 +64,7 @@ var (
_ = viper.BindPFlag(auditFeeInitFlag, cmd.Flags().Lookup(auditFeeCLIFlag)) _ = 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(withdrawFeeInitFlag, cmd.Flags().Lookup(withdrawFeeCLIFlag)) _ = viper.BindPFlag(withdrawFeeInitFlag, cmd.Flags().Lookup(withdrawFeeCLIFlag))
}, },
RunE: initializeSideChainCmd, RunE: initializeSideChainCmd,