Skip to content

Commit

Permalink
Merge pull request #1214 from input-output-hk/remove-pparams-from-hyd…
Browse files Browse the repository at this point in the history
…ra-cluster

Remove protocol parameters from hydra-cluster
  • Loading branch information
v0d1ch authored Dec 24, 2023
2 parents f5b1e4f + ac73f6b commit f15b322
Show file tree
Hide file tree
Showing 20 changed files with 258 additions and 542 deletions.
2 changes: 1 addition & 1 deletion demo/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: "3.9"

services:
cardano-node:
image: inputoutput/cardano-node:8.7.2
image: ghcr.io/input-output-hk/cardano-node:8.7.2
volumes:
- ./devnet:/devnet
environment:
Expand Down
1 change: 0 additions & 1 deletion demo/prepare-devnet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ TARGETDIR="devnet"

cp -af "$BASEDIR/hydra-cluster/config/devnet/" "$TARGETDIR"
cp -af "$BASEDIR/hydra-cluster/config/credentials" "$TARGETDIR"
cp -af "$BASEDIR/hydra-cluster/config/protocol-parameters.json" "$TARGETDIR"
echo '{"Producers": []}' > "$TARGETDIR/topology.json"
sed -i.bak "s/\"startTime\": [0-9]*/\"startTime\": $(date +%s)/" "$TARGETDIR/genesis-byron.json" && \
sed -i.bak "s/\"systemStart\": \".*\"/\"systemStart\": \"$(date -u +%FT%TZ)\"/" "$TARGETDIR/genesis-shelley.json"
Expand Down
8 changes: 8 additions & 0 deletions demo/seed-devnet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,13 @@ function publishReferenceScripts() {
--cardano-signing-key devnet/credentials/faucet.sk
}

function queryPParams() {
echo >&2 "Query Protocol parameters"
docker exec demo-cardano-node-1 cardano-cli query protocol-parameters --testnet-magic ${NETWORK_ID} --out-file /dev/stdout \
| jq ".txFeeFixed = 0 | .txFeePerByte = 0 | .executionUnitPrices.priceMemory = 0 | .executionUnitPrices.priceSteps = 0" > protocol-parameters.json
echo >&2 "Saved in protocol-parameters.json"
}

echo >&2 "Fueling up hydra nodes of alice, bob and carol..."
seedFaucet "alice" 30000000 # 30 Ada to the node
seedFaucet "bob" 30000000 # 30 Ada to the node
Expand All @@ -103,6 +110,7 @@ echo >&2 "Distributing funds to alice, bob and carol..."
seedFaucet "alice-funds" 100000000 # 100 Ada to commit
seedFaucet "bob-funds" 50000000 # 50 Ada to commit
seedFaucet "carol-funds" 25000000 # 25 Ada to commit
queryPParams
echo "HYDRA_SCRIPTS_TX_ID=$(publishReferenceScripts)" > .env
echo >&2 "Environment variable stored in '.env'"
echo >&2 -e "\n\t$(cat .env)\n"
2 changes: 2 additions & 0 deletions fourmolu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ fixities:
- infixl 3 <|>
- infixr 3 &&
- infixl 1 <&>
- infixl 4 <$>
- infixl 4 <*>
16 changes: 8 additions & 8 deletions hydra-cluster/bench/Bench/EndToEnd.hs
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,12 @@ bench startingNodeId timeoutSeconds workDir dataset@Dataset{clientDatasets, titl
let parties = Set.fromList (deriveParty <$> hydraKeys)
let clusterSize = fromIntegral $ length clientDatasets
withOSStats workDir $
withCardanoNodeDevnet (contramap FromCardanoNode tracer) workDir $ \node@RunningNode{nodeSocket} -> do
withCardanoNodeDevnet (contramap FromCardanoNode tracer) workDir $ \node@RunningNode{nodeSocket, pparams} -> do
putTextLn "Seeding network"
let hydraTracer = contramap FromHydraNode tracer
hydraScriptsTxId <- seedNetwork node dataset (contramap FromFaucet tracer)
let contestationPeriod = UnsafeContestationPeriod 10
withHydraCluster hydraTracer workDir nodeSocket startingNodeId cardanoKeys hydraKeys hydraScriptsTxId contestationPeriod $ \(leader :| followers) -> do
withHydraCluster hydraTracer workDir nodeSocket startingNodeId cardanoKeys hydraKeys hydraScriptsTxId pparams contestationPeriod $ \(leader :| followers) -> do
let clients = leader : followers
waitForNodesConnected hydraTracer 20 clients

Expand Down Expand Up @@ -408,12 +408,12 @@ waitForAllConfirmations n1 Registry{processedTxs} allIds = do
snapshot <- v ^? key "snapshot"
SnapshotConfirmed
<$> snapshot
^? key "confirmedTransactions"
. _Array
. to toList
<*> snapshot
^? key "snapshotNumber"
. _Number
^? key "confirmedTransactions"
. _Array
. to toList
<*> snapshot
^? key "snapshotNumber"
. _Number

confirmTx ::
TVar IO (Map.Map TxId Event) ->
Expand Down
Loading

0 comments on commit f15b322

Please sign in to comment.