@@ -16,6 +16,11 @@ import (
16
16
"github.com/ava-labs/avalanchego/utils/logging"
17
17
)
18
18
19
+ const (
20
+ stakingPath = "staking"
21
+ configsPath = "staking"
22
+ )
23
+
19
24
func init () {
20
25
rand .Seed (time .Now ().UnixNano ())
21
26
}
@@ -46,27 +51,27 @@ func writeFiles(networkID uint32, genesis []byte, nodeRootDir string, nodeConfig
46
51
files := []file {
47
52
{
48
53
flagValue : "" ,
49
- path : filepath .Join (nodeRootDir , "staking" , stakingKeyFileName ),
54
+ path : filepath .Join (nodeRootDir , stakingPath , stakingKeyFileName ),
50
55
pathKey : config .StakingTLSKeyPathKey ,
51
56
contents : []byte (nodeConfig .StakingKey ),
52
57
},
53
58
{
54
59
flagValue : "" ,
55
- path : filepath .Join (nodeRootDir , "staking" , stakingCertFileName ),
60
+ path : filepath .Join (nodeRootDir , stakingPath , stakingCertFileName ),
56
61
pathKey : config .StakingCertPathKey ,
57
62
contents : []byte (nodeConfig .StakingCert ),
58
63
},
59
64
{
60
65
flagValue : "" ,
61
- path : filepath .Join (nodeRootDir , "staking" , stakingSigningKeyFileName ),
66
+ path : filepath .Join (nodeRootDir , stakingPath , stakingSigningKeyFileName ),
62
67
pathKey : config .StakingSignerKeyPathKey ,
63
68
contents : decodedStakingSigningKey ,
64
69
},
65
70
}
66
71
if networkID != constants .LocalID {
67
72
files = append (files , file {
68
- flagValue : filepath .Join (nodeRootDir , "configs" , genesisFileName ),
69
- path : filepath .Join (nodeRootDir , "configs" , genesisFileName ),
73
+ flagValue : filepath .Join (nodeRootDir , configsPath , genesisFileName ),
74
+ path : filepath .Join (nodeRootDir , configsPath , genesisFileName ),
70
75
pathKey : config .GenesisFileKey ,
71
76
contents : genesis ,
72
77
})
@@ -134,7 +139,7 @@ func writeConfigFile(nodeRootDir string, nodeConfig *node.Config, flags map[stri
134
139
if err != nil {
135
140
return "" , err
136
141
}
137
- configFilePath := filepath .Join (nodeRootDir , "configs" , configFileName )
142
+ configFilePath := filepath .Join (nodeRootDir , configsPath , configFileName )
138
143
if err := createFileAndWrite (configFilePath , configFileBytes ); err != nil {
139
144
return "" , err
140
145
}
0 commit comments