Skip to content

Commit

Permalink
when snapshots can't be found for version, pick a random version
Browse files Browse the repository at this point in the history
Right now there are no v18 snapshots on xtz-shots, so it's not possible
to kickstart a node. This PR will pick the v17 snapshot instead.
  • Loading branch information
nicolasochem committed Nov 18, 2023
1 parent e5f74d6 commit 207a963
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion utils/config-generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -772,11 +772,14 @@ def create_node_snapshot_config_json(history_mode):
and s.get("chain_name") == network_name
]
if octez_version:
matching_snapshots = [
version_matching_snapshots = [
s
for s in matching_snapshots
if int(octez_version) == s.get("tezos_version").get("version").get("major")
]
if len(version_matching_snapshots):
# If we can't find snapshots of the right octez version, we just pick the most recent available.
matching_snapshots = version_matching_snapshots
matching_snapshots = sorted(matching_snapshots, key=lambda s: s.get("block_height"))

return matching_snapshots[-1] if len(matching_snapshots) else None
Expand Down

0 comments on commit 207a963

Please sign in to comment.