Skip to content

Commit f15b322

Browse files
authored
Merge pull request #1214 from input-output-hk/remove-pparams-from-hydra-cluster
Remove protocol parameters from hydra-cluster
2 parents f5b1e4f + ac73f6b commit f15b322

File tree

20 files changed

+258
-542
lines changed

20 files changed

+258
-542
lines changed

demo/docker-compose.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: "3.9"
22

33
services:
44
cardano-node:
5-
image: inputoutput/cardano-node:8.7.2
5+
image: ghcr.io/input-output-hk/cardano-node:8.7.2
66
volumes:
77
- ./devnet:/devnet
88
environment:

demo/prepare-devnet.sh

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ TARGETDIR="devnet"
1111

1212
cp -af "$BASEDIR/hydra-cluster/config/devnet/" "$TARGETDIR"
1313
cp -af "$BASEDIR/hydra-cluster/config/credentials" "$TARGETDIR"
14-
cp -af "$BASEDIR/hydra-cluster/config/protocol-parameters.json" "$TARGETDIR"
1514
echo '{"Producers": []}' > "$TARGETDIR/topology.json"
1615
sed -i.bak "s/\"startTime\": [0-9]*/\"startTime\": $(date +%s)/" "$TARGETDIR/genesis-byron.json" && \
1716
sed -i.bak "s/\"systemStart\": \".*\"/\"systemStart\": \"$(date -u +%FT%TZ)\"/" "$TARGETDIR/genesis-shelley.json"

demo/seed-devnet.sh

+8
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,13 @@ function publishReferenceScripts() {
9595
--cardano-signing-key devnet/credentials/faucet.sk
9696
}
9797

98+
function queryPParams() {
99+
echo >&2 "Query Protocol parameters"
100+
docker exec demo-cardano-node-1 cardano-cli query protocol-parameters --testnet-magic ${NETWORK_ID} --out-file /dev/stdout \
101+
| jq ".txFeeFixed = 0 | .txFeePerByte = 0 | .executionUnitPrices.priceMemory = 0 | .executionUnitPrices.priceSteps = 0" > protocol-parameters.json
102+
echo >&2 "Saved in protocol-parameters.json"
103+
}
104+
98105
echo >&2 "Fueling up hydra nodes of alice, bob and carol..."
99106
seedFaucet "alice" 30000000 # 30 Ada to the node
100107
seedFaucet "bob" 30000000 # 30 Ada to the node
@@ -103,6 +110,7 @@ echo >&2 "Distributing funds to alice, bob and carol..."
103110
seedFaucet "alice-funds" 100000000 # 100 Ada to commit
104111
seedFaucet "bob-funds" 50000000 # 50 Ada to commit
105112
seedFaucet "carol-funds" 25000000 # 25 Ada to commit
113+
queryPParams
106114
echo "HYDRA_SCRIPTS_TX_ID=$(publishReferenceScripts)" > .env
107115
echo >&2 "Environment variable stored in '.env'"
108116
echo >&2 -e "\n\t$(cat .env)\n"

fourmolu.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,5 @@ fixities:
1313
- infixl 3 <|>
1414
- infixr 3 &&
1515
- infixl 1 <&>
16+
- infixl 4 <$>
17+
- infixl 4 <*>

hydra-cluster/bench/Bench/EndToEnd.hs

+8-8
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,12 @@ bench startingNodeId timeoutSeconds workDir dataset@Dataset{clientDatasets, titl
8787
let parties = Set.fromList (deriveParty <$> hydraKeys)
8888
let clusterSize = fromIntegral $ length clientDatasets
8989
withOSStats workDir $
90-
withCardanoNodeDevnet (contramap FromCardanoNode tracer) workDir $ \node@RunningNode{nodeSocket} -> do
90+
withCardanoNodeDevnet (contramap FromCardanoNode tracer) workDir $ \node@RunningNode{nodeSocket, pparams} -> do
9191
putTextLn "Seeding network"
9292
let hydraTracer = contramap FromHydraNode tracer
9393
hydraScriptsTxId <- seedNetwork node dataset (contramap FromFaucet tracer)
9494
let contestationPeriod = UnsafeContestationPeriod 10
95-
withHydraCluster hydraTracer workDir nodeSocket startingNodeId cardanoKeys hydraKeys hydraScriptsTxId contestationPeriod $ \(leader :| followers) -> do
95+
withHydraCluster hydraTracer workDir nodeSocket startingNodeId cardanoKeys hydraKeys hydraScriptsTxId pparams contestationPeriod $ \(leader :| followers) -> do
9696
let clients = leader : followers
9797
waitForNodesConnected hydraTracer 20 clients
9898

@@ -408,12 +408,12 @@ waitForAllConfirmations n1 Registry{processedTxs} allIds = do
408408
snapshot <- v ^? key "snapshot"
409409
SnapshotConfirmed
410410
<$> snapshot
411-
^? key "confirmedTransactions"
412-
. _Array
413-
. to toList
414-
<*> snapshot
415-
^? key "snapshotNumber"
416-
. _Number
411+
^? key "confirmedTransactions"
412+
. _Array
413+
. to toList
414+
<*> snapshot
415+
^? key "snapshotNumber"
416+
. _Number
417417

418418
confirmTx ::
419419
TVar IO (Map.Map TxId Event) ->

0 commit comments

Comments
 (0)