Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-Leshiy committed Mar 26, 2024
1 parent 57a2e82 commit e91b14a
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions earthly/mithril_snapshot/scripts/std_load.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

# This script loads latest mithril snapshot archive


class NetworkType(enum.Enum):
Mainnet = "mainnet"
Testnet = "testnet"
Expand All @@ -28,7 +29,7 @@ def get_aggregator_url(self):
return (
"https://aggregator.pre-release-preview.api.mithril.network/aggregator"
)

# taken from https://github.com/input-output-hk/mithril/tree/main/mithril-infra/configuration
def get_genesis_verification_key(self):
if self == NetworkType.Mainnet:
Expand All @@ -38,9 +39,7 @@ def get_genesis_verification_key(self):
if self == NetworkType.Preprod:
return "5b3132372c37332c3132342c3136312c362c3133372c3133312c3231332c3230372c3131372c3139382c38352c3137362c3139392c3136322c3234312c36382c3132332c3131392c3134352c31332c3233322c3234332c34392c3232392c322c3234392c3230352c3230352c33392c3233352c34345d"
if self == NetworkType.Preview:
return (
"5b3132372c37332c3132342c3136312c362c3133372c3133312c3231332c3230372c3131372c3139382c38352c3137362c3139392c3136322c3234312c36382c3132332c3131392c3134352c31332c3233322c3234332c34392c3232392c322c3234392c3230352c3230352c33392c3233352c34345d"
)
return "5b3132372c37332c3132342c3136312c362c3133372c3133312c3231332c3230372c3131372c3139382c38352c3137362c3139392c3136322c3234312c36382c3132332c3131392c3134352c31332c3233322c3234332c34392c3232392c322c3234392c3230352c3230352c33392c3233352c34345d"


def main():
Expand All @@ -58,18 +57,20 @@ def main():
results = exec_manager.Results("Mithril snapshot loading.")

# download latest snapshot
exec_manager.cli_run(
" ".join(
[
f"GENESIS_VERIFICATION_KEY={args.network.get_genesis_verification_key()}",
f"AGGREGATOR_ENDPOINT={args.network.get_aggregator_url()}",
"mithril-client",
"cardano-db",
"download",
"latest",
]
),
name="Dowload latest mithril snapshot",
results.add(
exec_manager.cli_run(
" ".join(
[
f"GENESIS_VERIFICATION_KEY={args.network.get_genesis_verification_key()}",
f"AGGREGATOR_ENDPOINT={args.network.get_aggregator_url()}",
"mithril-client",
"cardano-db",
"download",
"latest",
]
),
name=f"Dowload latest mithril snapshot for {args.network}",
)
)

results.print()
Expand Down

0 comments on commit e91b14a

Please sign in to comment.