feat: use identify protocol instead of separate wakuv2 nodeconfig items

This commit is contained in:
Richard Ramos 2022-11-11 10:49:08 -04:00 committed by RichΛrd
parent 5c9cc84b3c
commit 50b4dacfef
4 changed files with 9 additions and 42 deletions

View File

@ -307,10 +307,7 @@ QtObject:
# TODO: fleet.status.im should have different sections depending on the node type
# or maybe it's not necessary because a node has the identify protocol
result["ClusterConfig"]["RelayNodes"] = %* dnsDiscoveryURL
result["ClusterConfig"]["StoreNodes"] = %* dnsDiscoveryURL
result["ClusterConfig"]["FilterNodes"] = %* dnsDiscoveryURL
result["ClusterConfig"]["LightpushNodes"] = %* dnsDiscoveryURL
result["ClusterConfig"]["WakuNodes"] = %* dnsDiscoveryURL
result["ClusterConfig"]["DiscV5BootstrapNodes"] = %* dnsDiscoveryURL
result["WakuV2Config"]["EnableDiscV5"] = true.newJBool()
@ -328,13 +325,10 @@ QtObject:
if TEST_PEER_ENR != "":
let testPeerENRArr = %* @[TEST_PEER_ENR]
result["ClusterConfig"]["RelayNodes"] = testPeerENRArr
result["ClusterConfig"]["StoreNodes"] = testPeerENRArr
result["ClusterConfig"]["FilterNodes"] = testPeerENRArr
result["ClusterConfig"]["LightpushNodes"] = testPeerENRArr
result["ClusterConfig"]["WakuNodes"] = %* testPeerENRArr
result["ClusterConfig"]["BootNodes"] = %* testPeerENRArr
result["ClusterConfig"]["TrustedMailServers"] = testPeerENRArr
result["ClusterConfig"]["StaticNodes"] = testPeerENRArr
result["ClusterConfig"]["TrustedMailServers"] = %* testPeerENRArr
result["ClusterConfig"]["StaticNodes"] = %* testPeerENRArr
result["ClusterConfig"]["RendezvousNodes"] = %* (@[])
result["ClusterConfig"]["DiscV5BootstrapNodes"] = %* (@[])
result["Rendezvous"] = newJBool(false)

View File

@ -41,11 +41,7 @@ type
TrustedMailServers*: seq[string]
PushNotificationsServers*: seq[string]
RendezvousNodes*: seq[string]
RelayNodes*: seq[string]
StoreNodes*: seq[string]
FilterNodes*: seq[string]
LightpushNodes*: seq[string]
WakuRendezvousNodes*: seq[string]
WakuNodes*: seq[string]
DiscV5BootstrapNodes*: seq[string]
@ -275,30 +271,10 @@ proc toClusterConfig*(jsonObj: JsonNode): ClusterConfig =
for valueObj in arr:
result.RendezvousNodes.add(valueObj.getStr)
if(jsonObj.getProp("RelayNodes", arr)):
if(jsonObj.getProp("WakuNodes", arr)):
if(arr.kind == JArray):
for valueObj in arr:
result.RelayNodes.add(valueObj.getStr)
if(jsonObj.getProp("StoreNodes", arr)):
if(arr.kind == JArray):
for valueObj in arr:
result.StoreNodes.add(valueObj.getStr)
if(jsonObj.getProp("FilterNodes", arr)):
if(arr.kind == JArray):
for valueObj in arr:
result.FilterNodes.add(valueObj.getStr)
if(jsonObj.getProp("LightpushNodes", arr)):
if(arr.kind == JArray):
for valueObj in arr:
result.LightpushNodes.add(valueObj.getStr)
if(jsonObj.getProp("WakuRendezvousNodes", arr)):
if(arr.kind == JArray):
for valueObj in arr:
result.WakuRendezvousNodes.add(valueObj.getStr)
result.WakuNodes.add(valueObj.getStr)
if(jsonObj.getProp("DiscV5BootstrapNodes", arr)):
if(arr.kind == JArray):

View File

@ -215,10 +215,7 @@ proc setFleet*(self: Service, fleet: string): bool =
else:
wakuVersion = 1
newConfiguration.ClusterConfig.RelayNodes = dnsDiscoveryURL
newConfiguration.ClusterConfig.StoreNodes = dnsDiscoveryURL
newConfiguration.ClusterConfig.FilterNodes = dnsDiscoveryURL
newConfiguration.ClusterConfig.LightpushNodes = dnsDiscoveryURL
newConfiguration.ClusterConfig.WakuNodes = dnsDiscoveryURL
newConfiguration.ClusterConfig.DiscV5BootstrapNodes = dnsDiscoveryURL
newConfiguration = setWakuConfig(newConfiguration, wakuVersion)

2
vendor/status-go vendored

@ -1 +1 @@
Subproject commit 3047521bd009091cbc077909a3e4a24513aeece0
Subproject commit 5b69985b189cae2a5e36153fa4be58afe075b446