@@ -18,11 +18,11 @@ import (
18
18
const (
19
19
baseExtendedURL = "https://raw.githubusercontent.com/threefoldtech/zos-config/main/"
20
20
21
- hubURL = "https://hub.threefold.me"
22
- v4HubURL = "https://v4.hub.threefold.me"
21
+ defaultHubURL = "https://hub.threefold.me"
22
+ defaultV4HubURL = "https://v4.hub.threefold.me"
23
23
24
- flistURL = "redis://hub.threefold.me:9900"
25
- v4FlistURL = "redis://v4.hub.threefold.me:9940"
24
+ defaultFlistURL = "redis://hub.threefold.me:9900"
25
+ defaultV4FlistURL = "redis://v4.hub.threefold.me:9940"
26
26
27
27
defaultHubStorage = "zdb://hub.threefold.me:9900"
28
28
defaultV4HubStorage = "zdb://v4.hub.threefold.me:9940"
@@ -55,11 +55,12 @@ type Environment struct {
55
55
RunningMode RunMode
56
56
57
57
FlistURL string
58
- HubURL string
59
- V4HubURL string
60
58
HubStorage string
61
59
BinRepo string
62
60
61
+ HubURL string
62
+ V4HubURL string
63
+
63
64
FarmID pkg.FarmID
64
65
Orphan bool
65
66
@@ -142,9 +143,9 @@ var (
142
143
"https://activation.dev.grid.tf/activation/activate" ,
143
144
"https://activation.02.dev.grid.tf/activation/activate" ,
144
145
},
145
- FlistURL : flistURL ,
146
- HubURL : hubURL ,
147
- V4HubURL : v4HubURL ,
146
+ FlistURL : defaultFlistURL ,
147
+ HubURL : defaultHubURL ,
148
+ V4HubURL : defaultV4HubURL ,
148
149
HubStorage : defaultHubStorage ,
149
150
BinRepo : "tf-zos-v3-bins.dev" ,
150
151
GraphQL : []string {
@@ -170,9 +171,9 @@ var (
170
171
"https://activation.test.grid.tf/activation/activate" ,
171
172
"https://activation.02.test.grid.tf/activation/activate" ,
172
173
},
173
- FlistURL : flistURL ,
174
- HubURL : hubURL ,
175
- V4HubURL : v4HubURL ,
174
+ FlistURL : defaultFlistURL ,
175
+ HubURL : defaultHubURL ,
176
+ V4HubURL : defaultV4HubURL ,
176
177
HubStorage : defaultHubStorage ,
177
178
BinRepo : "tf-zos-v3-bins.test" ,
178
179
GraphQL : []string {
@@ -198,9 +199,9 @@ var (
198
199
"https://activation.qa.grid.tf/activation/activate" ,
199
200
"https://activation.02.qa.grid.tf/activation/activate" ,
200
201
},
201
- FlistURL : flistURL ,
202
- HubURL : hubURL ,
203
- V4HubURL : v4HubURL ,
202
+ FlistURL : defaultFlistURL ,
203
+ HubURL : defaultHubURL ,
204
+ V4HubURL : defaultV4HubURL ,
204
205
HubStorage : defaultHubStorage ,
205
206
BinRepo : "tf-zos-v3-bins.qanet" ,
206
207
GraphQL : []string {
@@ -226,19 +227,19 @@ var (
226
227
// "wss://relay.02.grid.tf",
227
228
},
228
229
ActivationURL : []string {
229
- "https://activation.grid.threefold.me/activation/activate" ,
230
230
"https://activation.grid.tf/activation/activate" ,
231
231
"https://activation.02.grid.tf/activation/activate" ,
232
+ "https://activation.grid.threefold.me/activation/activate" ,
232
233
},
233
- FlistURL : flistURL ,
234
- HubURL : hubURL ,
235
- V4HubURL : v4HubURL ,
234
+ FlistURL : defaultFlistURL ,
235
+ HubURL : defaultHubURL ,
236
+ V4HubURL : defaultV4HubURL ,
236
237
HubStorage : defaultHubStorage ,
237
238
BinRepo : "tf-zos-v3-bins" ,
238
239
GraphQL : []string {
239
- "https://graphql.grid.threefold.me/graphql" ,
240
240
"https://graphql.grid.tf/graphql" ,
241
241
"https://graphql.02.grid.tf/graphql" ,
242
+ "https://graphql.grid.threefold.me/graphql" ,
242
243
},
243
244
KycURL : "https://kyc.threefold.me" ,
244
245
RegistrarURL : "https://registrar.prod4.threefold.me" ,
@@ -326,29 +327,24 @@ func getEnvironmentFromParams(params kernel.Params) (Environment, error) {
326
327
if err != nil {
327
328
// maybe the node can't reach the internet right now
328
329
// this will enforce node to skip config
330
+ // or we can keep retrying untill it can fetch config
329
331
config = Config {}
330
332
}
331
333
332
- if substrate , ok := params .Get ("substrate" ); ok {
333
- if len (substrate ) > 0 {
334
- env .SubstrateURL = substrate
335
- }
334
+ if substrate , ok := params .Get ("substrate" ); ok && len (substrate ) > 0 {
335
+ env .SubstrateURL = substrate
336
336
} else if substrate := config .SubstrateURL ; len (substrate ) > 0 {
337
337
env .SubstrateURL = substrate
338
338
}
339
339
340
- if relay , ok := params .Get ("relay" ); ok {
341
- if len (relay ) > 0 {
342
- env .relaysURLs = relay
343
- }
340
+ if relay , ok := params .Get ("relay" ); ok && len (relay ) > 0 {
341
+ env .relaysURLs = relay
344
342
} else if relay := config .RelaysURLs ; len (relay ) > 0 {
345
343
env .relaysURLs = relay
346
344
}
347
345
348
- if activation , ok := params .Get ("activation" ); ok {
349
- if len (activation ) > 0 {
350
- env .ActivationURL = activation
351
- }
346
+ if activation , ok := params .Get ("activation" ); ok && len (activation ) > 0 {
347
+ env .ActivationURL = activation
352
348
} else if activation := config .ActivationURL ; len (activation ) > 0 {
353
349
env .ActivationURL = activation
354
350
}
@@ -392,7 +388,7 @@ func getEnvironmentFromParams(params kernel.Params) (Environment, error) {
392
388
393
389
// if the node running v4 chage urls to use v4 hub
394
390
if params .IsV4 () {
395
- env .FlistURL = v4FlistURL
391
+ env .FlistURL = defaultV4FlistURL
396
392
if flist := config .V4FlistURL ; len (flist ) > 0 {
397
393
env .FlistURL = flist
398
394
}
0 commit comments