File tree 1 file changed +12
-2
lines changed
1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 49
49
rpcUrl string
50
50
coreBridgeAddr string
51
51
credentialsFile string
52
+ network string
52
53
)
53
54
54
55
// Make a bigtable row key from a VAA
@@ -128,6 +129,7 @@ func loadEnvVars() {
128
129
rpcUrl = verifyEnvVar ("RPC_URL" )
129
130
coreBridgeAddr = verifyEnvVar ("CORE_BRIDGE_ADDR" )
130
131
credentialsFile = verifyEnvVar ("CREDENTIALS_FILE" )
132
+ network = verifyEnvVar ("NETWORK" )
131
133
}
132
134
133
135
func verifyEnvVar (key string ) string {
@@ -140,8 +142,16 @@ func verifyEnvVar(key string) string {
140
142
141
143
func main () {
142
144
loadEnvVars ()
143
- p2pNetworkID = p2p .MainnetNetworkId
144
- p2pBootstrap = p2p .MainnetBootstrapPeers
145
+ if network == "mainnet" {
146
+ p2pNetworkID = p2p .MainnetNetworkId
147
+ p2pBootstrap = p2p .MainnetBootstrapPeers
148
+ } else if network == "testnet" {
149
+ p2pNetworkID = p2p .TestnetNetworkId
150
+ p2pBootstrap = p2p .TestnetBootstrapPeers
151
+ } else {
152
+ p2pNetworkID = p2p .DevnetNetworkId
153
+ p2pBootstrap = ""
154
+ }
145
155
146
156
lvl , err := ipfslog .LevelFromString (logLevel )
147
157
if err != nil {
You can’t perform that action at this time.
0 commit comments