forked from ava-labs/avalanchego
-
Notifications
You must be signed in to change notification settings - Fork 0
/
genesis_local.go
83 lines (70 loc) · 2.57 KB
/
genesis_local.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package genesis
import (
"time"
_ "embed"
"github.com/ava-labs/avalanchego/utils/cb58"
"github.com/ava-labs/avalanchego/utils/crypto/secp256k1"
"github.com/ava-labs/avalanchego/utils/units"
"github.com/ava-labs/avalanchego/utils/wrappers"
"github.com/ava-labs/avalanchego/vms/platformvm/reward"
)
// PrivateKey-vmRQiZeXEXYMyJhEiqdC2z5JhuDbxL8ix9UVvjgMu2Er1NepE => P-local1g65uqn6t77p656w64023nh8nd9updzmxyymev2
// PrivateKey-ewoqjP7PxY4yr3iLTpLisriqt94hdyDFNgchSxGGztUrTXtNN => X-local18jma8ppw3nhx5r4ap8clazz0dps7rv5u00z96u
// 56289e99c94b6912bfc12adc093c9b51124f0dc54ac7a766b2bc5ccf558d8027 => 0x8db97C7cEcE249c2b98bDC0226Cc4C2A57BF52FC
const (
VMRQKeyStr = "vmRQiZeXEXYMyJhEiqdC2z5JhuDbxL8ix9UVvjgMu2Er1NepE"
VMRQKeyFormattedStr = secp256k1.PrivateKeyPrefix + VMRQKeyStr
EWOQKeyStr = "ewoqjP7PxY4yr3iLTpLisriqt94hdyDFNgchSxGGztUrTXtNN"
EWOQKeyFormattedStr = secp256k1.PrivateKeyPrefix + EWOQKeyStr
)
var (
VMRQKey *secp256k1.PrivateKey
EWOQKey *secp256k1.PrivateKey
//go:embed genesis_local.json
localGenesisConfigJSON []byte
// LocalParams are the params used for local networks
LocalParams = Params{
TxFeeConfig: TxFeeConfig{
TxFee: units.MilliAvax,
CreateAssetTxFee: units.MilliAvax,
CreateSubnetTxFee: 100 * units.MilliAvax,
TransformSubnetTxFee: 100 * units.MilliAvax,
CreateBlockchainTxFee: 100 * units.MilliAvax,
AddPrimaryNetworkValidatorFee: 0,
AddPrimaryNetworkDelegatorFee: 0,
AddSubnetValidatorFee: units.MilliAvax,
AddSubnetDelegatorFee: units.MilliAvax,
},
StakingConfig: StakingConfig{
UptimeRequirement: .8, // 80%
MinValidatorStake: 2 * units.KiloAvax,
MaxValidatorStake: 3 * units.MegaAvax,
MinDelegatorStake: 25 * units.Avax,
MinDelegationFee: 20000, // 2%
MinStakeDuration: 24 * time.Hour,
MaxStakeDuration: 365 * 24 * time.Hour,
RewardConfig: reward.Config{
MaxConsumptionRate: .12 * reward.PercentDenominator,
MinConsumptionRate: .10 * reward.PercentDenominator,
MintingPeriod: 365 * 24 * time.Hour,
SupplyCap: 720 * units.MegaAvax,
},
},
}
)
func init() {
errs := wrappers.Errs{}
vmrqBytes, err := cb58.Decode(VMRQKeyStr)
errs.Add(err)
ewoqBytes, err := cb58.Decode(EWOQKeyStr)
errs.Add(err)
VMRQKey, err = secp256k1.ToPrivateKey(vmrqBytes)
errs.Add(err)
EWOQKey, err = secp256k1.ToPrivateKey(ewoqBytes)
errs.Add(err)
if errs.Err != nil {
panic(errs.Err)
}
}