Skip to content
This repository has been archived by the owner on Nov 16, 2022. It is now read-only.

Commit

Permalink
add query voting power
Browse files Browse the repository at this point in the history
  • Loading branch information
Benzbeeb committed May 13, 2020
1 parent 6bb979d commit fe67084
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
17 changes: 17 additions & 0 deletions research/validator-sampling/random/getcosmosvp.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

import requests

url = "https://rpc.cosmos.network/validators"
r = requests.get(url)

jsonData = r.json()["result"]["validators"]
l = []
ll = []
for x in jsonData:
l.append(int(x["voting_power"]))

for x in jsonData:
ll.append(x["address"])
print(l)
print(ll)
print(len(l))
16 changes: 16 additions & 0 deletions research/validator-sampling/random/getkavavp.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import requests

url = "https://data.kava.io/staking/validators"
r = requests.get(url)

jsonData = r.json()["result"]
l = []
ll = []
for x in jsonData:
l.append(int(x["tokens"]))

for x in jsonData:
ll.append(x["operator_address"])
print(l)
print(ll)
print(len(l))

0 comments on commit fe67084

Please sign in to comment.