Skip to content
This repository was archived by the owner on Feb 12, 2026. It is now read-only.

Commit 1012eec

Browse files
committed
golang nit fixes
1 parent 6792092 commit 1012eec

1 file changed

Lines changed: 21 additions & 9 deletions

File tree

src/validator/genesis-creator.go

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@ import (
1010

1111
const VALIDATOR_COUNT = 4
1212
const VALIDATOR_OUTPUT_PREFIX = "validator"
13-
const GENESIS_ACCOUNT = os.Getenv("GENESIS_ACCOUNT")
14-
const PREMINE_NUM_TOKENS_IN_WEI = os.Getenv("PREMINE_NUM_TOKENS_IN_WEI")
15-
const BLOCKCHAIN_NAME = os.Getenv("BLOCKCHAIN_NAME")
13+
var GENESIS_ACCOUNT = os.Getenv("GENESIS_ACCOUNT")
14+
var PREMINE_NUM_TOKENS_IN_WEI = os.Getenv("PREMINE_NUM_TOKENS_IN_WEI")
15+
var BLOCKCHAIN_NAME = os.Getenv("BLOCKCHAIN_NAME")
1616

17-
const BOOTNODE_1_IP = os.Getenv("BOOTNODE_1_IP") //public/private ip (without port)
18-
const BOOTNODE_1_PORT = os.Getenv("BOOTNODE_1_PORT") // libp2p port
17+
var BOOTNODE_1_IP = os.Getenv("BOOTNODE_1_IP") //public/private ip (without port)
18+
var BOOTNODE_1_PORT = os.Getenv("BOOTNODE_1_PORT") // libp2p port
1919

20-
const BOOTNODE_2_IP = os.Getenv("BOOTNODE_2_IP")
21-
const BOOTNODE_2_PORT = os.Getenv("BOOTNODE_2_PORT") // libp2p port
20+
var BOOTNODE_2_IP = os.Getenv("BOOTNODE_2_IP")
21+
var BOOTNODE_2_PORT = os.Getenv("BOOTNODE_2_PORT") // libp2p port
2222

2323
// aws region - used for SSM parameter store
24-
const AWS_REGION = os.Getenv("AWS_REGION")
24+
var AWS_REGION = os.Getenv("AWS_REGION")
2525

2626
func validateGenesisEnvVars(){
2727

@@ -41,6 +41,18 @@ func validateGenesisEnvVars(){
4141
panic("BOOTNODE_1_IP is empty")
4242
}
4343

44+
if BOOTNODE_2_IP == "" {
45+
panic("BOOTNODE_2_IP is empty")
46+
}
47+
48+
if BOOTNODE_1_PORT == "" {
49+
panic("BOOTNODE_1_PORT is empty")
50+
}
51+
52+
if BOOTNODE_2_PORT == "" {
53+
panic("BOOTNODE_2_PORT is empty")
54+
}
55+
4456
if !IS_LOCAL && AWS_REGION == "" {
4557
panic("AWS_REGION shouldn't be empty for non-localhost stage")
4658
}
@@ -129,7 +141,7 @@ func createValidators(){
129141
if IS_LOCAL {
130142
executeBashScript("./create_validators_local.sh")
131143
} else {
132-
executeBashScriptWithArgs("./create_validators.sh", string[]{AWS_REGION})
144+
executeBashScriptWithArgs("./create_validators.sh", []string{AWS_REGION})
133145
}
134146

135147
}

0 commit comments

Comments
 (0)