Skip to content

Commit

Permalink
Add all data from StellarBeat to each node
Browse files Browse the repository at this point in the history
  • Loading branch information
Hidenori committed Jun 18, 2020
1 parent 09a9449 commit cbff06d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion scripts/OverlaySurvey.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,12 @@ def augment(args):
data = requests.get("https://api.stellarbeat.io/v1/nodes").json()
for obj in data:
if graph.has_node(obj["publicKey"]):
graph.add_node(obj["publicKey"], ip=obj["ip"], name=obj["name"])
# NetworkX doesn't allow dictionary properties,
# so we will turn them into strings.
dict_properties = ["geoData", "quorumSet", "statistics"]
for dict_property in dict_properties:
obj[dict_property] = json.dumps(obj[dict_property])
graph.add_node(obj["publicKey"], **obj)
nx.write_graphml(graph, args.graphmlOutput)
sys.exit(0)

Expand Down

0 comments on commit cbff06d

Please sign in to comment.