forked from cosmos/chain-registry
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6960dd5
commit ffc6a02
Showing
112 changed files
with
418 additions
and
334 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import requests | ||
import json | ||
import os | ||
import time | ||
|
||
rootdir = os.getcwd() | ||
headers = { | ||
'accept': 'application/json', | ||
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36' | ||
} | ||
|
||
def getBlock(chain): | ||
with open(".github/workflows/utility/upgrades/chainsUpgrade.json", "r") as file: | ||
data = json.load(file) | ||
chainData = data[chain] | ||
rpcs = chainData["rpc"] | ||
upgradeHeight = chainData["height"] | ||
for item in rpcs: | ||
try: | ||
while True: | ||
data = requests.get(f"{item}/block", headers=headers) | ||
currentHeight = int(data.json()['result']['block']['header']['height']) | ||
if currentHeight < upgradeHeight: | ||
time.sleep(40 * 60) | ||
else: | ||
chainjson = os.path.join(chain, "chain.json") | ||
current = json.load(open(os.path.join(rootdir, chainjson), encoding='utf-8', errors='ignore')) | ||
codebase = current["codebase"] | ||
latestVersion = current["codebase"]["versions"][-1] | ||
|
||
for key, value in latestVersion.iteritems(): | ||
if key != "name" and key != "height" and key != "proposal" and key != "tag" and key != "next_version_name": | ||
codebase[key] = value | ||
|
||
current["codebase"] = codebase | ||
|
||
with open(os.path.join(rootdir, chainjson), "w") as file: | ||
json.dump(current, file, indent=2, ensure_ascii=False) | ||
return | ||
except Exception as e: | ||
print(f"Issue with request to {chain}: {e}") | ||
continue | ||
|
||
def update_codebase(): | ||
chainsFolders = sorted(os.listdir(rootdir)) | ||
for chainfolder in chainsFolders: | ||
if chainfolder == "ethos" or chainfolder == "logos" or chainfolder == "mythos" or chainfolder == "octa": | ||
continue | ||
print(chainfolder) | ||
chainjson = os.path.join(chainfolder, "chain.json") | ||
if os.path.isfile(chainjson): | ||
current = json.load(open(os.path.join(rootdir, chainjson), encoding='utf-8', errors='ignore')) | ||
codebase = current["codebase"] | ||
latestVersion = current["codebase"]["versions"][-1] | ||
|
||
for key, value in latestVersion.items(): | ||
if key != "name" and key != "height" and key != "proposal" and key != "tag" and ke: | ||
codebase[key] = value | ||
|
||
current["codebase"] = codebase | ||
|
||
with open(os.path.join(rootdir, chainjson), "w") as file: | ||
json.dump(current, file, indent=2, ensure_ascii=False) | ||
|
||
update_codebase() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -198,4 +198,4 @@ | |
"account_page": "https://stakeflow.io/agoric/accounts/${accountAddress}" | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -154,4 +154,4 @@ | |
"tx_page": "https://explorer.aioz.network/tx/${txHash}" | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -281,4 +281,4 @@ | |
"account_page": "https://stakeflow.io/akash/accounts/${accountAddress}" | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -138,4 +138,4 @@ | |
"tx_page": "https://explorer.nodexcapital.com/arkhadian/tx/${txHash}" | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -272,4 +272,4 @@ | |
"account_page": "https://bigdipper.live/assetmantle/accounts/${accountAddress}" | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -312,4 +312,4 @@ | |
"account_page": "https://stakeflow.io/axelar/accounts/${accountAddress}" | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -184,4 +184,4 @@ | |
"account_page": "https://stakeflow.io/band-protocol/accounts/${accountAddress}" | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -145,4 +145,4 @@ | |
"account_page": "https://atomscan.com/beezee/accounts/${accountAddress}" | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -209,4 +209,4 @@ | |
"account_page": "https://atomscan.com/bitsong/accounts/${accountAddress}" | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -123,4 +123,4 @@ | |
"account_page": "https://atomscan.com/bostrom/accounts/${accountAddress}" | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -216,4 +216,4 @@ | |
"tx_page": "https://explorer.tcnetwork.io/canto/transaction/${txHash}" | ||
} | ||
] | ||
} | ||
} |
Oops, something went wrong.