Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion scripts/stage-oracles/generate
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ rm -fr tmp/chronicles
# NOTE you need to have your Github auth setup or this will fail
git clone https://github.com/chronicleprotocol/chronicles.git tmp/chronicles

python scripts/stage-oracles/generate.py
python scripts/stage-oracles/generate.py # Test run
[[ "$?" = "0" ]] || {
echo
echo "!!!! Something went wrong, not updating ..."
exit 1
}
# Do for realz
python scripts/stage-oracles/generate.py > ./docs/Developers/testnet.md
git status
8 changes: 6 additions & 2 deletions scripts/stage-oracles/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,19 @@

from string import Template
from pathlib import Path
import os, re, json
import os, re, json, sys

data = {}
def err(m):
print(m, file=sys.stderr)

with open('tmp/chronicles/deployments/chains.json') as json_data:
o = json.load(json_data)
for chain in o['chains']:
# We may get a chain from chains.json which does not have any contracts
# deployed. We do not want a section for these
if not os.path.exists(f"tmp/chronicles/deployments/stage/{chain['name']}"):
if chain['mainnet'] is False and not os.path.exists(f"tmp/chronicles/deployments/stage/{chain['name']}"):
err(f"Path does not seem to exist? tmp/chronicles/deployments/stage/{chain['name']}")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only stage

continue
data[chain['name']] = {}
data[chain['name']]['info'] = chain
Expand Down