From 8d18dabf0381b225d159469d7acb309fc0cae3f2 Mon Sep 17 00:00:00 2001 From: Noon van der Silk Date: Mon, 9 Dec 2024 11:32:53 +0000 Subject: [PATCH] Parse scripts from list as well --- demo/seed-devnet.sh | 4 +++- hydra-node/src/Hydra/Options.hs | 17 ++++++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/demo/seed-devnet.sh b/demo/seed-devnet.sh index d6b87456cc5..58b5d94ed37 100755 --- a/demo/seed-devnet.sh +++ b/demo/seed-devnet.sh @@ -98,7 +98,9 @@ function publishReferenceScripts() { hnode publish-scripts \ --testnet-magic ${NETWORK_ID} \ --node-socket ${DEVNET_DIR}/node.socket \ - --cardano-signing-key devnet/credentials/faucet.sk + --cardano-signing-key devnet/credentials/faucet.sk \ + | tr '\n' ',' \ + | head -c -1 } function queryPParams() { diff --git a/hydra-node/src/Hydra/Options.hs b/hydra-node/src/Hydra/Options.hs index 2b1b210d779..b214259ee19 100644 --- a/hydra-node/src/Hydra/Options.hs +++ b/hydra-node/src/Hydra/Options.hs @@ -455,7 +455,7 @@ directChainConfigParser = DirectChainConfig <$> networkIdParser <*> nodeSocketParser - <*> many hydraScriptsTxIdParser + <*> (hydraScriptsTxIdsParser <|> many hydraScriptsTxIdParser) <*> cardanoSigningKeyFileParser <*> many cardanoVerificationKeyFileParser <*> optional startChainFromParser @@ -700,6 +700,21 @@ startChainFromParser = _emptyOrSingularList -> Nothing +hydraScriptsTxIdsParser :: Parser [TxId] +hydraScriptsTxIdsParser = + option + (eitherReader $ left show . parseFromHex . BSC.split ',' . BSC.pack) + ( long "hydra-scripts-tx-id" + <> metavar "TXID" + <> help + "The transaction which is expected to have published Hydra scripts as \ + \reference scripts in its outputs. Note: All scripts need to be in the \ + \first 10 outputs. See release notes for pre-published versions. You \ + \can use the 'publish-scripts' sub-command to publish them yourself." + ) + where + parseFromHex = mapM (deserialiseFromRawBytesHex AsTxId) + hydraScriptsTxIdParser :: Parser TxId hydraScriptsTxIdParser = option