Skip to content

Commit b89cccb

Browse files
committed
address PR comments
1 parent 02f3e9d commit b89cccb

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

local/helpers.go

+11-6
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ import (
1616
"github.com/ava-labs/avalanchego/utils/logging"
1717
)
1818

19+
const (
20+
stakingPath = "staking"
21+
configsPath = "staking"
22+
)
23+
1924
func init() {
2025
rand.Seed(time.Now().UnixNano())
2126
}
@@ -46,27 +51,27 @@ func writeFiles(networkID uint32, genesis []byte, nodeRootDir string, nodeConfig
4651
files := []file{
4752
{
4853
flagValue: "",
49-
path: filepath.Join(nodeRootDir, "staking", stakingKeyFileName),
54+
path: filepath.Join(nodeRootDir, stakingPath, stakingKeyFileName),
5055
pathKey: config.StakingTLSKeyPathKey,
5156
contents: []byte(nodeConfig.StakingKey),
5257
},
5358
{
5459
flagValue: "",
55-
path: filepath.Join(nodeRootDir, "staking", stakingCertFileName),
60+
path: filepath.Join(nodeRootDir, stakingPath, stakingCertFileName),
5661
pathKey: config.StakingCertPathKey,
5762
contents: []byte(nodeConfig.StakingCert),
5863
},
5964
{
6065
flagValue: "",
61-
path: filepath.Join(nodeRootDir, "staking", stakingSigningKeyFileName),
66+
path: filepath.Join(nodeRootDir, stakingPath, stakingSigningKeyFileName),
6267
pathKey: config.StakingSignerKeyPathKey,
6368
contents: decodedStakingSigningKey,
6469
},
6570
}
6671
if networkID != constants.LocalID {
6772
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),
7075
pathKey: config.GenesisFileKey,
7176
contents: genesis,
7277
})
@@ -134,7 +139,7 @@ func writeConfigFile(nodeRootDir string, nodeConfig *node.Config, flags map[stri
134139
if err != nil {
135140
return "", err
136141
}
137-
configFilePath := filepath.Join(nodeRootDir, "configs", configFileName)
142+
configFilePath := filepath.Join(nodeRootDir, configsPath, configFileName)
138143
if err := createFileAndWrite(configFilePath, configFileBytes); err != nil {
139144
return "", err
140145
}

0 commit comments

Comments
 (0)