Skip to content

Commit dc91566

Browse files
committed
Update SDK to ensure compatibility with Hydra 1.1.0
(The minimal example executes successfully)
1 parent 6084d84 commit dc91566

File tree

20 files changed

+4054
-11717
lines changed

20 files changed

+4054
-11717
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@
1313
/.spago/
1414
/.spago2nix/
1515
.psc-ide-port
16+
blockfrost.txt

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ of Hydra-based applications.
2424

2525
| hydra-sdk | hydra-node | cardano-node |
2626
| ----------- | ------------ | ------------ |
27-
| **`0.1.0`** | **`0.19.0`** | **`10.1.2`** |
27+
| **`1.0.0`** | **`0.19.0`** | **`10.1.2`** |
28+
| **`2.0.0`** | **`1.1.0`** | **`10.5.3`** |
2829

2930

3031
## Preliminaries
@@ -167,4 +168,4 @@ for hydra-auction-offchain and hopefully other Hydra applications.
167168
## Applications
168169

169170
Please refer to [hydra-auction-offchain](https://github.com/mlabs-haskell/hydra-auction-offchain)
170-
for a full-fledged example that utilizes this SDK.
171+
for a full-fledged example that utilizes this SDK.

example/minimal/app/Main.purs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import Prelude
66

77
import Aeson (stringifyAeson)
88
import Cardano.AsCbor (decodeCbor, encodeCbor)
9-
import Cardano.Types (Language(PlutusV2), Transaction)
9+
import Cardano.Types (Language(PlutusV3), Transaction)
1010
import Cardano.Types.AuxiliaryData (hashAuxiliaryData)
1111
import Cardano.Types.Transaction (_body, _witnessSet)
1212
import Cardano.Types.TransactionBody (_auxiliaryDataHash)
@@ -185,7 +185,7 @@ messageHandler ws =
185185
setUtxoSnapshot $ HydraSnapshot
186186
{ snapshotNumber: zero
187187
, utxo
188-
, confirmedTransactions: mempty
188+
-- , confirmedTransactions: mempty
189189
}
190190
tx <- runContractInApp $ placeArbitraryDatumL2 $ toUtxoMap utxo
191191
liftEffect $ ws.submitTxL2 tx
@@ -224,7 +224,7 @@ fixCommitTx = reSignTransaction <=< fixScriptIntegrityHash <<< setAuxDataHash
224224
fixScriptIntegrityHash tx = do
225225
pparams <- unwrap <$> getProtocolParameters
226226
let
227-
costModels = Map.filterKeys (eq PlutusV2) pparams.costModels
227+
costModels = Map.filterKeys (eq PlutusV3) pparams.costModels
228228
ws = unwrap (unwrap tx).witnessSet
229229
liftEffect $ setScriptDataHash costModels ws.redeemers ws.plutusData tx
230230

example/minimal/docker/cluster/config-a.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"hydraNodeStartupParams": {
33
"nodeId": "1063b00f-0d5b-46b6-9aff-88114a25f688",
44
"hydraNodeAddress": "0.0.0.0:7000",
5+
"hydraNodeAdvertisedAddress": "delegate-node-a:7000",
56
"hydraNodeApiAddress": "127.0.0.1:7001",
67
"persistDir": "hydra-persist",
78
"hydraSigningKey": "keys/hydra-a.sk",
@@ -12,8 +13,12 @@
1213
},
1314
"nodeSocket": "node-ipc/node.socket",
1415
"pparams": "protocol-parameters.json",
15-
"hydraScriptsTxHash": "03f8deb122fbbd98af8eb58ef56feda37728ec957d39586b78198a0cf624412a",
16-
"contestPeriodSec": 120,
16+
"hydraScripts": [
17+
"152cfeb309be439f3e8a8940bd9e46ba634e469702370789b03bb53219fa42f9",
18+
"d69468c6ea65aee0b1595d25fb8d16b5d32feb20749936a8fd82b112032f4d5f",
19+
"828ff89d3f65ddb600ab8091a4ee27661277029ae5ec0c39457b271db9766c6f"
20+
],
21+
"contestPeriodSec": 60,
1722
"peers": [
1823
{
1924
"hydraNodeAddress": "delegate-node-b:7002",
@@ -22,7 +27,7 @@
2227
}
2328
]
2429
},
25-
"blockfrostApiKey": null,
30+
"blockfrostApiKey": "preprodq4qb2xZcZk6LUFk36DmEcxIFRM8DRwkV",
2631
"logLevel": "trace",
2732
"ctlLogLevel": "warn",
2833
"commitOutRef": null

example/minimal/docker/cluster/config-b.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"hydraNodeStartupParams": {
33
"nodeId": "91fd9af9-1eb8-42e7-8cb3-20bca7a4f13b",
44
"hydraNodeAddress": "0.0.0.0:7002",
5+
"hydraNodeAdvertisedAddress": "delegate-node-b:7002",
56
"hydraNodeApiAddress": "127.0.0.1:7003",
67
"persistDir": "hydra-persist",
78
"hydraSigningKey": "keys/hydra-b.sk",
@@ -12,8 +13,12 @@
1213
},
1314
"nodeSocket": "node-ipc/node.socket",
1415
"pparams": "protocol-parameters.json",
15-
"hydraScriptsTxHash": "03f8deb122fbbd98af8eb58ef56feda37728ec957d39586b78198a0cf624412a",
16-
"contestPeriodSec": 120,
16+
"hydraScripts": [
17+
"152cfeb309be439f3e8a8940bd9e46ba634e469702370789b03bb53219fa42f9",
18+
"d69468c6ea65aee0b1595d25fb8d16b5d32feb20749936a8fd82b112032f4d5f",
19+
"828ff89d3f65ddb600ab8091a4ee27661277029ae5ec0c39457b271db9766c6f"
20+
],
21+
"contestPeriodSec": 60,
1722
"peers": [
1823
{
1924
"hydraNodeAddress": "delegate-node-a:7000",
@@ -22,7 +27,7 @@
2227
}
2328
]
2429
},
25-
"blockfrostApiKey": null,
30+
"blockfrostApiKey": "preprodq4qb2xZcZk6LUFk36DmEcxIFRM8DRwkV",
2631
"logLevel": "trace",
2732
"ctlLogLevel": "warn",
2833
"commitOutRef": null

example/minimal/docker/cluster/docker-compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
services:
22
cardano-node:
3-
image: ghcr.io/intersectmbo/cardano-node:10.1.3
3+
image: ghcr.io/intersectmbo/cardano-node:10.5.3
44
environment:
55
- NETWORK=preprod
66
volumes:

example/minimal/docker/node/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ COPY example/minimal/app app
2323
COPY example/minimal/protocol-parameters.json .
2424
RUN npx --no-install spago build
2525

26-
RUN curl -LO https://github.com/input-output-hk/hydra/releases/download/0.19.0/hydra-x86_64-linux-0.19.0.zip
27-
RUN unzip -d /usr/local/bin/ hydra-x86_64-linux-0.19.0.zip
26+
RUN curl -LO https://github.com/input-output-hk/hydra/releases/download/1.1.0/hydra-x86_64-linux-1.1.0.zip
27+
RUN unzip -d /usr/local/bin/ hydra-x86_64-linux-1.1.0.zip
2828
RUN chmod +x /usr/local/bin/hydra-node
2929

3030
ENTRYPOINT ["npx", "--no-install", "spago", "-q", "run", "--main", "HydraSdk.Example.Minimal.Main", "--exec-args"]

example/minimal/package-lock.json

Lines changed: 29 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/minimal/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "0.1.0",
44
"type": "module",
55
"dependencies": {
6+
"@errfrom/cardano-data-lite": "1.0.1",
67
"@mlabs-haskell/cardano-data-lite": "0.1.0-prerelease8",
78
"@mlabs-haskell/cardano-message-signing": "^1.0.1",
89
"@mlabs-haskell/json-bigint": "2.0.0",

example/minimal/packages.dhall

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ let additions =
175175
, "web-storage"
176176
]
177177
, repo = "https://github.com/Plutonomicon/cardano-transaction-lib.git"
178-
, version = "539385f4e4572dabbccff992802d1490f3106bf8"
178+
, version = "8ba78bf6f1fc3016844cdb95ce8dcde3f0f99927"
179179
}
180180
, codec-aeson =
181181
{ dependencies =

0 commit comments

Comments
 (0)