Skip to content

Commit

Permalink
Fix invocation of cardano-cli and pin-point the root cause
Browse files Browse the repository at this point in the history
  • Loading branch information
ch1bo committed Jan 3, 2024
1 parent 4a69ba4 commit 6a2fb64
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion hydra-cluster/src/CardanoNode.hs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import Hydra.Cardano.Api (
AsType (AsPaymentKey),
File (..),
NetworkId,
NetworkMagic (..),
PaymentKey,
SigningKey,
SocketPath,
Expand Down Expand Up @@ -441,7 +442,7 @@ cliQueryProtocolParameters nodeSocket networkId = do
]
<> case networkId of
Api.Mainnet -> ["--mainnet"]
Api.Testnet magic -> ["--testnet-magic", show magic]
Api.Testnet (NetworkMagic magic) -> ["--testnet-magic", show magic]
<> [ "--out-file"
, "/dev/stdout"
]
Expand Down
2 changes: 1 addition & 1 deletion hydra-cluster/src/HydraNode.hs
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ withHydraNode' chainConfig workDir hydraNodeId hydraSKey hydraVKeys allNodeIds p
withSystemTempDirectory "hydra-node" $ \dir -> do
let cardanoLedgerProtocolParametersFile = dir </> "protocol-parameters.json"
case chainConfig of
Offline _ -> undefined
Offline _ -> undefined -- TODO: should write default ProtocolParameters to cardanoLedgerProtocolParametersFile
Direct DirectChainConfig{nodeSocket, networkId} -> do
-- NOTE: This implicitly tests of cardano-cli with hydra-node
protocolParameters <- cliQueryProtocolParameters nodeSocket networkId
Expand Down
2 changes: 2 additions & 0 deletions hydra-node/src/Hydra/Ledger/Cardano/Configuration.hs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ newGlobals genesisParameters = do

-- * LedgerEnv

-- | Decode protocol parameters using the 'ProtocolParameters' instance as this
-- is used by cardano-cli and matches the schema. TODO: define the schema
pparamsFromJson :: Json.Value -> Json.Parser (PParams LedgerEra)
pparamsFromJson = parseJSON

Expand Down

0 comments on commit 6a2fb64

Please sign in to comment.