From 343239f252c0ec03e3d57e4931f9102bf64ca618 Mon Sep 17 00:00:00 2001 From: Mircea Hasegan Date: Mon, 4 Nov 2024 12:11:48 +0100 Subject: [PATCH 1/9] chore: upgrade versions --- compose/aarch64.yml | 8 +- compose/common.yml | 8 +- packages/cardano-services/config/.gitrepo | 4 +- .../mainnet/cardano-node/topology.json | 4 +- .../sanchonet/cardano-node/config.json | 4 +- .../network/sanchonet/genesis/conway.json | 37 +++-- packages/cardano-services/package.json | 2 +- packages/core/package.json | 4 +- .../CardanoNode/types/CardanoNodeErrors.ts | 2 + packages/crypto/package.json | 2 +- packages/e2e/local-network/Dockerfile | 4 +- .../e2e/local-network/scripts/make-babbage.sh | 8 +- .../e2e/local-network/scripts/mint-handles.sh | 16 +- .../e2e/local-network/scripts/mint-tokens.sh | 8 +- .../scripts/plutus-transaction.sh | 12 +- .../scripts/pools/update-node-utils.sh | 144 +++++++++--------- .../scripts/reference-input-transaction.sh | 42 ++--- .../scripts/setup-new-delegator-keys.sh | 34 +++-- .../local-network/scripts/setup-wallets.sh | 6 +- packages/e2e/local-network/scripts/start.sh | 3 +- packages/e2e/package.json | 2 +- packages/ogmios/package.json | 6 +- packages/ogmios/src/ogmiosToCore/tx.ts | 11 +- packages/ogmios/test/ogmiosToCore/testData.ts | 29 ++++ packages/wallet/package.json | 2 +- yarn-project.nix | 4 +- yarn.lock | 34 ++--- 27 files changed, 242 insertions(+), 198 deletions(-) diff --git a/compose/aarch64.yml b/compose/aarch64.yml index e022f0ae47e..631df93b81c 100644 --- a/compose/aarch64.yml +++ b/compose/aarch64.yml @@ -2,10 +2,10 @@ services: cardano-db-sync: - image: ghcr.io/input-output-hk/ogmios-tracker/cardano-db-sync:${CARDANO_DB_SYNC_VERSION:-13.3.0.0} + image: ghcr.io/input-output-hk/ogmios-tracker/cardano-db-sync:${CARDANO_DB_SYNC_VERSION:-13.6.0.0-pre} cardano-node: - image: ghcr.io/input-output-hk/ogmios-tracker/cardano-node:${CARDANO_NODE_VERSION:-9.1.0} + image: ghcr.io/input-output-hk/ogmios-tracker/cardano-node:${CARDANO_NODE_VERSION:-10.1.2} ogmios: - image: ghcr.io/input-output-hk/ogmios-tracker/ogmios:v${OGMIOS_VERSION:-6.5.0} + image: ghcr.io/input-output-hk/ogmios-tracker/ogmios:v${OGMIOS_VERSION:-6.9.0} cardano-submit-api: - image: ghcr.io/input-output-hk/ogmios-tracker/cardano-submit-api:${CARDANO_NODE_VERSION:-9.1.0} + image: ghcr.io/input-output-hk/ogmios-tracker/cardano-submit-api:${CARDANO_NODE_VERSION:-10.1.2} diff --git a/compose/common.yml b/compose/common.yml index 9f3cc53fb16..70cc598ce92 100644 --- a/compose/common.yml +++ b/compose/common.yml @@ -121,7 +121,7 @@ x-sdk-environment: &sdk-environment services: blockfrost-ryo: build: - context: 'https://github.com/ginnun/blockfrost-backend-ryo.git#feat/custom-network-support' + context: 'https://github.com/mirceahasegan/blockfrost-backend-ryo.git#feat/custom-network-support' dockerfile: Dockerfile environment: BLOCKFROST_CONFIG_SERVER_LISTEN_ADDRESS: 0.0.0.0 @@ -179,7 +179,7 @@ services: cardano-node: <<: *logging - image: ghcr.io/intersectmbo/cardano-node:${CARDANO_NODE_VERSION:-9.1.1} + image: ghcr.io/intersectmbo/cardano-node:${CARDANO_NODE_VERSION:-10.1.2} command: [ 'run', @@ -199,7 +199,7 @@ services: ogmios: <<: *logging - image: cardanosolutions/ogmios:v${OGMIOS_VERSION:-6.5.0} + image: cardanosolutions/ogmios:v${OGMIOS_VERSION:-6.9.0} command: [ '--host', @@ -225,7 +225,7 @@ services: cardano-submit-api: command: --config /config/cardano-submit-api/config.json --listen-address 0.0.0.0 --socket-path /ipc/node.socket $SUBMIT_API_ARGS - image: ghcr.io/intersectmbo/cardano-submit-api:${CARDANO_NODE_VERSION:-9.1.1} + image: ghcr.io/intersectmbo/cardano-submit-api:${CARDANO_NODE_VERSION:-10.1.2} ports: - 8090:8090 restart: on-failure diff --git a/packages/cardano-services/config/.gitrepo b/packages/cardano-services/config/.gitrepo index 1d3091ea5ee..5f9450b3a82 100644 --- a/packages/cardano-services/config/.gitrepo +++ b/packages/cardano-services/config/.gitrepo @@ -6,7 +6,7 @@ [subrepo] remote = https://github.com/input-output-hk/cardano-configurations.git branch = master - commit = 7969a73e5c7ee1f3b2a40274b34191fdd8de170b - parent = 6c74e3abdf0ff29b448d94136b8d59c8975ad615 + commit = 3c5f35bda1b8fd29ab310ad222403a9167f512de + parent = 846a0eeb6248aca9c9b9481675144d380980bfcb method = merge cmdver = 0.4.6 diff --git a/packages/cardano-services/config/network/mainnet/cardano-node/topology.json b/packages/cardano-services/config/network/mainnet/cardano-node/topology.json index 586b8c1764f..267c34a44b1 100644 --- a/packages/cardano-services/config/network/mainnet/cardano-node/topology.json +++ b/packages/cardano-services/config/network/mainnet/cardano-node/topology.json @@ -5,11 +5,11 @@ "port": 3001 }, { - "address": "backbone.mainnet.emurgornd.com", + "address": "backbone.mainnet.cardanofoundation.org", "port": 3001 }, { - "address": "backbone.mainnet.cardanofoundation.org", + "address": "backbone.mainnet.emurgornd.com", "port": 3001 } ], diff --git a/packages/cardano-services/config/network/sanchonet/cardano-node/config.json b/packages/cardano-services/config/network/sanchonet/cardano-node/config.json index 75a13aed6d2..bbe804ae220 100644 --- a/packages/cardano-services/config/network/sanchonet/cardano-node/config.json +++ b/packages/cardano-services/config/network/sanchonet/cardano-node/config.json @@ -4,14 +4,14 @@ "ByronGenesisFile": "../genesis/byron.json", "ByronGenesisHash": "785eb88427e136378a15b0a152a8bfbeec7a611529ccda29c43a1e60ffb48eaa", "ConwayGenesisFile": "../genesis/conway.json", - "ConwayGenesisHash": "e85ee5b7af8ca5c273c20746c9f994aef1a72a79c38b4eea230817e7e66c0741", + "ConwayGenesisHash": "ff31343b814adddfdcaceb76f635647e2b7d1adfc0ddac7c40b70cbdcd82fed9", "EnableP2P": true, "ExperimentalHardForksEnabled": true, "ExperimentalProtocolsEnabled": true, "LastKnownBlockVersion-Alt": 0, "LastKnownBlockVersion-Major": 3, "LastKnownBlockVersion-Minor": 1, - "MinNodeVersion": "8.12.0", + "MinNodeVersion": "10.0.0", "PeerSharing": true, "Protocol": "Cardano", "RequiresNetworkMagic": "RequiresMagic", diff --git a/packages/cardano-services/config/network/sanchonet/genesis/conway.json b/packages/cardano-services/config/network/sanchonet/genesis/conway.json index 81b2f4b7deb..ea67c6b4825 100644 --- a/packages/cardano-services/config/network/sanchonet/genesis/conway.json +++ b/packages/cardano-services/config/network/sanchonet/genesis/conway.json @@ -1,15 +1,15 @@ { "poolVotingThresholds": { - "committeeNormal": 0.65, - "committeeNoConfidence": 0.65, + "committeeNormal": 0.51, + "committeeNoConfidence": 0.51, "hardForkInitiation": 0.51, - "motionNoConfidence": 0.6, - "ppSecurityGroup": 0.6 + "motionNoConfidence": 0.51, + "ppSecurityGroup": 0.51 }, "dRepVotingThresholds": { "motionNoConfidence": 0.67, "committeeNormal": 0.67, - "committeeNoConfidence": 0.65, + "committeeNoConfidence": 0.6, "updateToConstitution": 0.75, "hardForkInitiation": 0.6, "ppNetworkGroup": 0.67, @@ -18,9 +18,9 @@ "ppGovGroup": 0.75, "treasuryWithdrawal": 0.67 }, - "committeeMinSize": 5, - "committeeMaxTermLength": 146, - "govActionLifetime": 14, + "committeeMinSize": 0, + "committeeMaxTermLength": 1000, + "govActionLifetime": 60, "govActionDeposit": 100000000000, "dRepDeposit": 500000000, "dRepActivity": 20, @@ -279,20 +279,19 @@ 1 ], "constitution": { - "anchor": { - "url": "ipfs://QmQq5hWDNzvDR1ForEktAHrdCQmfSL2u5yctNpzDwoSBu4", - "dataHash": "23b43bebac48a4acc39e578715aa06635d6d900fa3ea7441dfffd6e43b914f7b" - }, - "script": "edcd84c10e36ae810dc50847477083069db796219b39ccde790484e0" + "anchor": { + "dataHash": "ca41a91f399259bcefe57f9858e91f6d00e1a38d6d9c63d4052914ea7bd70cb2", + "url": "ipfs://bafkreifnwj6zpu3ixa4siz2lndqybyc5wnnt3jkwyutci4e2tmbnj3xrdm" + }, + "script": "fa24fb305126805cf2164c161d852a0e7330cf988f1fe558cf7d4a64" }, "committee": { "members": { - "scriptHash-7ceede7d6a89e006408e6b7c6acb3dd094b3f6817e43b4a36d01535b": 500, - "scriptHash-6095e643ea6f1cccb6e463ec34349026b3a48621aac5d512655ab1bf": 500, - "scriptHash-27999ed757d6dac217471ae61d69b1b067b8b240d9e3ff36eb66b5d0": 500, - "scriptHash-87f867a31c0f81360d4d7dcddb6b025ba8383db9bf77a2af7797799d": 500, - "scriptHash-a19a7ba1caede8f3ab3e5e2a928b3798d7d011af18fbd577f7aeb0ec": 500 + "keyHash-77c0a65f9302bccab35b44adc1823cb66c88a66c97cf3de8236dd718": 1000 }, - "threshold": 0.67 + "threshold": { + "numerator": 2, + "denominator": 3 + } } } diff --git a/packages/cardano-services/package.json b/packages/cardano-services/package.json index 3e0d8b93203..f99aeb06aa0 100644 --- a/packages/cardano-services/package.json +++ b/packages/cardano-services/package.json @@ -59,7 +59,7 @@ "tscNoEmit": "echo typescript --noEmit command not implemented yet" }, "devDependencies": { - "@cardano-ogmios/client": "6.5.0", + "@cardano-ogmios/client": "6.9.0", "@cardano-sdk/util-dev": "workspace:~", "@types/bunyan": "^1.8.8", "@types/cors": "^2.8.13", diff --git a/packages/core/package.json b/packages/core/package.json index 49d5d10938f..c2bc3311245 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -57,8 +57,8 @@ }, "dependencies": { "@biglup/is-cid": "^1.0.3", - "@cardano-ogmios/client": "6.5.0", - "@cardano-ogmios/schema": "6.5.0", + "@cardano-ogmios/client": "6.9.0", + "@cardano-ogmios/schema": "6.9.0", "@cardano-sdk/crypto": "workspace:~", "@cardano-sdk/util": "workspace:~", "@foxglove/crc": "^0.0.3", diff --git a/packages/core/src/CardanoNode/types/CardanoNodeErrors.ts b/packages/core/src/CardanoNode/types/CardanoNodeErrors.ts index 88fb76d445b..958b213cfb8 100644 --- a/packages/core/src/CardanoNode/types/CardanoNodeErrors.ts +++ b/packages/core/src/CardanoNode/types/CardanoNodeErrors.ts @@ -97,6 +97,8 @@ export enum TxSubmissionErrorCode { UnauthorizedGovernanceAction = 3165, ReferenceScriptsTooLarge = 3166, UnknownVoters = 3167, + EmptyTreasuryWithdrawal = 3168, + UnexpectedMempoolError = 3997, UnrecognizedCertificateType = 3998, DeserialisationFailure = -32_602 } diff --git a/packages/crypto/package.json b/packages/crypto/package.json index b2a193f9d3c..030995ef264 100644 --- a/packages/crypto/package.json +++ b/packages/crypto/package.json @@ -37,7 +37,7 @@ "prepack": "yarn build" }, "devDependencies": { - "@cardano-ogmios/schema": "6.5.0", + "@cardano-ogmios/schema": "6.9.0", "@dcspark/cardano-multiplatform-lib-nodejs": "^3.1.1", "@types/blake2b": "^2.1.0", "@types/libsodium-wrappers-sumo": "^0.7.5", diff --git a/packages/e2e/local-network/Dockerfile b/packages/e2e/local-network/Dockerfile index a31cf59a79c..4a8dcfe05c2 100644 --- a/packages/e2e/local-network/Dockerfile +++ b/packages/e2e/local-network/Dockerfile @@ -5,8 +5,8 @@ FROM ubuntu:${UBUNTU_VERSION} AS builder ENV DEBIAN_FRONTEND=nonintercative WORKDIR /build -ARG CARDANO_NODE_BUILD_URL=https://github.com/IntersectMBO/cardano-node/releases/download/9.1.1/cardano-node-9.1.1-linux.tar.gz -ARG CARDANO_NODE_BUILD_URL_ARM64=https://github.com/input-output-hk/ogmios-tracker/releases/download/0.1.0/cardano-node-9.1.0-aarch64-linux.tar.gz +ARG CARDANO_NODE_BUILD_URL=https://github.com/IntersectMBO/cardano-node/releases/download/10.1.2/cardano-node-10.1.2-linux.tar.gz +ARG CARDANO_NODE_BUILD_URL_ARM64=https://github.com/input-output-hk/ogmios-tracker/releases/download/0.1.0/cardano-node-10.1.2-aarch64-linux.tar.gz RUN set -x && \ apt-get update -y && \ diff --git a/packages/e2e/local-network/scripts/make-babbage.sh b/packages/e2e/local-network/scripts/make-babbage.sh index aea39d84aa7..f49af8c0173 100755 --- a/packages/e2e/local-network/scripts/make-babbage.sh +++ b/packages/e2e/local-network/scripts/make-babbage.sh @@ -170,7 +170,7 @@ if [ -n "$PRE_CONWAY" ]; then fi # Copy the cost mode -cardano-cli genesis create-staked --genesis-dir "${ROOT}" \ +cardano-cli latest genesis create-staked --genesis-dir "${ROOT}" \ --testnet-magic "${NETWORK_MAGIC}" \ --gen-pools ${NUM_SP_NODES} \ --supply ${MAX_SUPPLY} \ @@ -308,9 +308,9 @@ sed_i -E "s/\"startTime\": [0-9]+/\"startTime\": ${timeUnix}/" ${ROOT}/genesis/b sed_i -E "s/\"systemStart\": \".*\"/\"systemStart\": \"${timeISO}\"/" ${ROOT}/genesis/shelley/genesis.json byronGenesisHash=$(cardano-cli byron genesis print-genesis-hash --genesis-json ${ROOT}/genesis/byron/genesis.json) -shelleyGenesisHash=$(cardano-cli genesis hash --genesis ${ROOT}/genesis/shelley/genesis.json) -alonzoGenesisHash=$(cardano-cli genesis hash --genesis ${ROOT}/genesis/shelley/genesis.alonzo.json) -conwayGenesisHash=$(cardano-cli genesis hash --genesis ${ROOT}/genesis/shelley/genesis.conway.json) +shelleyGenesisHash=$(cardano-cli latest genesis hash --genesis ${ROOT}/genesis/shelley/genesis.json) +alonzoGenesisHash=$(cardano-cli latest genesis hash --genesis ${ROOT}/genesis/shelley/genesis.alonzo.json) +conwayGenesisHash=$(cardano-cli latest genesis hash --genesis ${ROOT}/genesis/shelley/genesis.conway.json) echo "Byron genesis hash: $byronGenesisHash" echo "Shelley genesis hash: $shelleyGenesisHash" diff --git a/packages/e2e/local-network/scripts/mint-handles.sh b/packages/e2e/local-network/scripts/mint-handles.sh index 7916e9ff37c..65b148ce14c 100755 --- a/packages/e2e/local-network/scripts/mint-handles.sh +++ b/packages/e2e/local-network/scripts/mint-handles.sh @@ -34,7 +34,7 @@ cat >network-files/utxo-keys/minting-policy.json <network-files/utxo-keys/handles-metadata.json <network-files/utxo-keys/handles68-datum.json < 283232322968616e646c653638 handle68tokenList="1 ${policyid}.283232322968616e646c653638" -cardano-cli conway transaction build \ +cardano-cli latest transaction build \ --change-address "$addr" \ --tx-in "$utxo" \ --tx-out "$destAddr"+10000000+"$handle68tokenList" \ @@ -127,11 +127,13 @@ cardano-cli conway transaction build \ --testnet-magic 888 \ --out-file handle68-tx.raw -cardano-cli transaction sign \ +cardano-cli latest transaction sign \ --tx-body-file handle68-tx.raw \ --signing-key-file network-files/utxo-keys/payment.skey \ --testnet-magic 888 \ --out-file handle68-tx.signed -cardano-cli transaction submit --testnet-magic 888 --tx-file handle68-tx.signed +cardano-cli latest transaction submit --testnet-magic 888 --tx-file handle68-tx.signed wait_tx_complete $utxo + +sync diff --git a/packages/e2e/local-network/scripts/mint-tokens.sh b/packages/e2e/local-network/scripts/mint-tokens.sh index 4d57f72daad..f0c57a04d86 100755 --- a/packages/e2e/local-network/scripts/mint-tokens.sh +++ b/packages/e2e/local-network/scripts/mint-tokens.sh @@ -33,7 +33,7 @@ cat >network-files/utxo-keys/minting-policy.json < ${SP_NODE_ID}/fullUtxo.out @@ -53,15 +53,15 @@ updatePool() { # Pool metadata hash (only compute it if a metadata url has been given) if [ -n "$6" ]; then METADATA_URL="$6" - METADATA_HASH=$(cardano-cli conway stake-pool metadata-hash --pool-metadata-file <(curl -s -L -k "${METADATA_URL}")) + METADATA_HASH=$(cardano-cli latest stake-pool metadata-hash --pool-metadata-file <(curl -s -L -k "${METADATA_URL}")) fi # get the protocol parameters - cardano-cli conway query protocol-parameters --testnet-magic 888 --out-file ${SP_NODE_ID}/params.json + cardano-cli latest query protocol-parameters --testnet-magic 888 --out-file ${SP_NODE_ID}/params.json genesisVKey=network-files/utxo-keys/utxo${SP_NODE_ID}.vkey genesisSKey=network-files/utxo-keys/utxo${SP_NODE_ID}.skey - genesisAddr=$(cardano-cli conway address build --payment-verification-key-file "$genesisVKey" --testnet-magic 888) + genesisAddr=$(cardano-cli latest address build --payment-verification-key-file "$genesisVKey" --testnet-magic 888) stakeVKey=network-files/pools/staking-reward"${SP_NODE_ID}".vkey stakeKey=network-files/pools/staking-reward"${SP_NODE_ID}".skey @@ -75,27 +75,27 @@ updatePool() { keyDeposit=2000000 - POOL_ID=$(cardano-cli conway stake-pool id --cold-verification-key-file "$coldVKey" --output-format "hex") + POOL_ID=$(cardano-cli latest stake-pool id --cold-verification-key-file "$coldVKey" --output-format "hex") # funding pool owner stake address - stakeAddr=$(cardano-cli conway address build --payment-verification-key-file "$genesisVKey" --stake-verification-key-file "$stakeVKey" --testnet-magic 888) + stakeAddr=$(cardano-cli latest address build --payment-verification-key-file "$genesisVKey" --stake-verification-key-file "$stakeVKey" --testnet-magic 888) currentBalance=$(getAddressBalance "$stakeAddr") - utxo=$(cardano-cli conway query utxo --address "$genesisAddr" --testnet-magic 888 | awk 'NR == 3 {printf("%s#%s", $1, $2)}') + utxo=$(cardano-cli query utxo --address "$genesisAddr" --testnet-magic 888 | awk 'NR == 3 {printf("%s#%s", $1, $2)}') - cardano-cli conway transaction build \ + cardano-cli latest transaction build \ --change-address "$genesisAddr" \ --tx-in "$utxo" \ --tx-out "$stakeAddr"+"$POOL_OWNER_STAKE" \ --testnet-magic 888 \ --out-file ${SP_NODE_ID}/wallets-tx.raw 2>&1 - cardano-cli conway transaction sign \ + cardano-cli latest transaction sign \ --tx-body-file ${SP_NODE_ID}/wallets-tx.raw \ --signing-key-file "$genesisSKey" \ --testnet-magic 888 \ --out-file ${SP_NODE_ID}/wallets-tx.signed 2>&1 - cardano-cli conway transaction submit --testnet-magic 888 --tx-file ${SP_NODE_ID}/wallets-tx.signed 2>&1 + cardano-cli latest transaction submit --testnet-magic 888 --tx-file ${SP_NODE_ID}/wallets-tx.signed 2>&1 updatedBalance=$(getAddressBalance "$stakeAddr") @@ -106,14 +106,14 @@ updatePool() { # register pool owner stake address currentBalance=$(getAddressBalance "$genesisAddr") - cardano-cli conway stake-address registration-certificate \ + cardano-cli latest stake-address registration-certificate \ --key-reg-deposit-amt ${keyDeposit} \ --stake-verification-key-file "$stakeVKey" \ --out-file ${SP_NODE_ID}/pool-owner-registration.cert - utxo=$(cardano-cli conway query utxo --address "$genesisAddr" --testnet-magic 888 | awk 'NR == 3 {printf("%s#%s", $1, $2)}') + utxo=$(cardano-cli query utxo --address "$genesisAddr" --testnet-magic 888 | awk 'NR == 3 {printf("%s#%s", $1, $2)}') - cardano-cli conway transaction build-raw \ + cardano-cli latest transaction build-raw \ --tx-in "$utxo" \ --tx-out "$genesisAddr"+0 \ --invalid-hereafter 5000000 \ @@ -121,16 +121,16 @@ updatePool() { --out-file ${SP_NODE_ID}/tx.raw \ --certificate ${SP_NODE_ID}/pool-owner-registration.cert - refScriptSize=$(cardano-cli conway query ref-script-size \ + refScriptSize=$(cardano-cli latest query ref-script-size \ --tx-in "$utxo" \ --testnet-magic 888 \ --output-json | jq '.refInputScriptSize') # Upon applying the fee, the tx size could increase, rendering the fee insuficient - # Calculate it twice, once with fee 0, then with the calculated fee, to minimise the + # Calculate it twice, once with fee 0, then with the calculated fee, to minimise the # chance that the tx size increases the second time for i in {1..2}; do - fee=$(cardano-cli conway transaction calculate-min-fee \ + fee=$(cardano-cli latest transaction calculate-min-fee \ --reference-script-size $refScriptSize \ --tx-body-file ${SP_NODE_ID}/tx.raw \ --tx-in-count 1 \ @@ -143,7 +143,7 @@ updatePool() { initialBalance=$(getAddressBalance "$genesisAddr") txOut=$((initialBalance - fee - keyDeposit)) - cardano-cli conway transaction build-raw \ + cardano-cli latest transaction build-raw \ --tx-in "$utxo" \ --tx-out "$genesisAddr"+"$txOut" \ --invalid-hereafter 5000000 \ @@ -152,14 +152,14 @@ updatePool() { --out-file ${SP_NODE_ID}/tx.raw done - cardano-cli conway transaction sign \ + cardano-cli latest transaction sign \ --tx-body-file ${SP_NODE_ID}/tx.raw \ --signing-key-file "$genesisSKey" \ --signing-key-file "$stakeKey" \ --testnet-magic 888 \ --out-file ${SP_NODE_ID}/tx.signed - cardano-cli conway transaction submit \ + cardano-cli latest transaction submit \ --tx-file ${SP_NODE_ID}/tx.signed \ --testnet-magic 888 @@ -172,14 +172,14 @@ updatePool() { # delegating pool owner stake currentBalance=$(getAddressBalance "$genesisAddr") - cardano-cli conway stake-address stake-delegation-certificate \ + cardano-cli latest stake-address stake-delegation-certificate \ --stake-verification-key-file "$stakeVKey" \ --cold-verification-key-file "$coldVKey" \ --out-file ${SP_NODE_ID}/pool-owner-delegation.cert - utxo=$(cardano-cli conway query utxo --address "$genesisAddr" --testnet-magic 888 | awk 'NR == 3 {printf("%s#%s", $1, $2)}') + utxo=$(cardano-cli query utxo --address "$genesisAddr" --testnet-magic 888 | awk 'NR == 3 {printf("%s#%s", $1, $2)}') - cardano-cli conway transaction build-raw \ + cardano-cli latest transaction build-raw \ --tx-in "$utxo" \ --tx-out "$genesisAddr"+0 \ --invalid-hereafter 5000000 \ @@ -187,16 +187,16 @@ updatePool() { --out-file ${SP_NODE_ID}/tx.raw \ --certificate ${SP_NODE_ID}/pool-owner-delegation.cert - refScriptSize=$(cardano-cli conway query ref-script-size \ + refScriptSize=$(cardano-cli latest query ref-script-size \ --tx-in "$utxo" \ --testnet-magic 888 \ --output-json | jq '.refInputScriptSize') - + # Upon applying the fee, the tx size could increase, rendering the fee insuficient - # Calculate it twice, once with fee 0, then with the calculated fee, to minimise the + # Calculate it twice, once with fee 0, then with the calculated fee, to minimise the # chance that the tx size increases the second time for i in {1..2}; do - fee=$(cardano-cli conway transaction calculate-min-fee \ + fee=$(cardano-cli latest transaction calculate-min-fee \ --reference-script-size $refScriptSize \ --tx-body-file ${SP_NODE_ID}/tx.raw \ --tx-in-count 1 \ @@ -209,7 +209,7 @@ updatePool() { initialBalance=$(getAddressBalance "$genesisAddr") txOut=$((initialBalance - fee)) - cardano-cli conway transaction build-raw \ + cardano-cli latest transaction build-raw \ --tx-in "$utxo" \ --tx-out "$genesisAddr"+"$txOut" \ --invalid-hereafter 5000000 \ @@ -218,14 +218,14 @@ updatePool() { --out-file ${SP_NODE_ID}/tx.raw done - cardano-cli conway transaction sign \ + cardano-cli latest transaction sign \ --tx-body-file ${SP_NODE_ID}/tx.raw \ --signing-key-file "$genesisSKey" \ --signing-key-file "$stakeKey" \ --testnet-magic 888 \ --out-file ${SP_NODE_ID}/tx.signed - cardano-cli conway transaction submit \ + cardano-cli latest transaction submit \ --tx-file ${SP_NODE_ID}/tx.signed \ --testnet-magic 888 @@ -239,18 +239,18 @@ updatePool() { # register delegator stake address echo "Registering delegator stake certificate ${SP_NODE_ID}..." - paymentAddr=$(cardano-cli conway address build --payment-verification-key-file "$delegatorPaymentKey" --stake-verification-key-file "$delegatorStakeKey" --testnet-magic 888) + paymentAddr=$(cardano-cli latest address build --payment-verification-key-file "$delegatorPaymentKey" --stake-verification-key-file "$delegatorStakeKey" --testnet-magic 888) currentBalance=$(getAddressBalance "$paymentAddr") # create pool delegation certificate - cardano-cli conway stake-address stake-delegation-certificate \ + cardano-cli latest stake-address stake-delegation-certificate \ --stake-verification-key-file "$delegatorStakeKey" \ --stake-pool-id "$POOL_ID" \ --out-file ${SP_NODE_ID}/deleg.cert - utxo=$(cardano-cli conway query utxo --address "$paymentAddr" --testnet-magic 888 | awk 'NR == 3 {printf("%s#%s", $1, $2)}') + utxo=$(cardano-cli query utxo --address "$paymentAddr" --testnet-magic 888 | awk 'NR == 3 {printf("%s#%s", $1, $2)}') - cardano-cli conway transaction build-raw \ + cardano-cli latest transaction build-raw \ --tx-in "$utxo" \ --tx-out "$paymentAddr"+0 \ --invalid-hereafter 5000000 \ @@ -258,16 +258,16 @@ updatePool() { --out-file ${SP_NODE_ID}/tx.raw \ --certificate ${SP_NODE_ID}/deleg.cert - refScriptSize=$(cardano-cli conway query ref-script-size \ + refScriptSize=$(cardano-cli latest query ref-script-size \ --tx-in "$utxo" \ --testnet-magic 888 \ --output-json | jq '.refInputScriptSize') # Upon applying the fee, the tx size could increase, rendering the fee insuficient - # Calculate it twice, once with fee 0, then with the calculated fee, to minimise the + # Calculate it twice, once with fee 0, then with the calculated fee, to minimise the # chance that the tx size increases the second time for i in {1..2}; do - fee=$(cardano-cli conway transaction calculate-min-fee \ + fee=$(cardano-cli latest transaction calculate-min-fee \ --reference-script-size $refScriptSize \ --tx-body-file ${SP_NODE_ID}/tx.raw \ --tx-in-count 1 \ @@ -280,7 +280,7 @@ updatePool() { initialBalance=$(getAddressBalance "$paymentAddr") txOut=$((initialBalance - fee)) - cardano-cli conway transaction build-raw \ + cardano-cli latest transaction build-raw \ --tx-in "$utxo" \ --tx-out "$paymentAddr"+"$txOut" \ --invalid-hereafter 5000000 \ @@ -289,14 +289,14 @@ updatePool() { --out-file ${SP_NODE_ID}/tx.raw done - cardano-cli conway transaction sign \ + cardano-cli latest transaction sign \ --tx-body-file ${SP_NODE_ID}/tx.raw \ --signing-key-file "$delegatorPaymentSKey" \ --signing-key-file "$delegatorStakeSKey" \ --testnet-magic 888 \ --out-file ${SP_NODE_ID}/tx.signed - cardano-cli conway transaction submit \ + cardano-cli latest transaction submit \ --tx-file ${SP_NODE_ID}/tx.signed \ --testnet-magic 888 @@ -313,7 +313,7 @@ updatePool() { # Only add metadata if given. if [ -n "$6" ]; then - cardano-cli conway stake-pool registration-certificate \ + cardano-cli latest stake-pool registration-certificate \ --cold-verification-key-file "$coldVKey" \ --vrf-verification-key-file "$vrfKey" \ --pool-pledge "$POOL_PLEDGE" \ @@ -328,7 +328,7 @@ updatePool() { --metadata-hash "${METADATA_HASH}" \ --out-file ${SP_NODE_ID}/pool.cert else - cardano-cli conway stake-pool registration-certificate \ + cardano-cli latest stake-pool registration-certificate \ --cold-verification-key-file "$coldVKey" \ --vrf-verification-key-file "$vrfKey" \ --pool-pledge "$POOL_PLEDGE" \ @@ -342,9 +342,9 @@ updatePool() { --out-file ${SP_NODE_ID}/pool.cert fi - utxo=$(cardano-cli conway query utxo --address "$paymentAddr" --testnet-magic 888 | awk 'NR == 3 {printf("%s#%s", $1, $2)}') + utxo=$(cardano-cli query utxo --address "$paymentAddr" --testnet-magic 888 | awk 'NR == 3 {printf("%s#%s", $1, $2)}') - cardano-cli conway transaction build-raw \ + cardano-cli latest transaction build-raw \ --tx-in "$utxo" \ --tx-out "$paymentAddr"+"$txOut" \ --invalid-hereafter 500000 \ @@ -352,16 +352,16 @@ updatePool() { --certificate-file ${SP_NODE_ID}/pool.cert \ --out-file ${SP_NODE_ID}/tx.raw - refScriptSize=$(cardano-cli conway query ref-script-size \ + refScriptSize=$(cardano-cli latest query ref-script-size \ --tx-in "$utxo" \ --testnet-magic 888 \ --output-json | jq '.refInputScriptSize') # Upon applying the fee, the tx size could increase, rendering the fee insuficient - # Calculate it twice, once with fee 0, then with the calculated fee, to minimise the + # Calculate it twice, once with fee 0, then with the calculated fee, to minimise the # chance that the tx size increases the second time for i in {1..2}; do - fee=$(cardano-cli conway transaction calculate-min-fee \ + fee=$(cardano-cli latest transaction calculate-min-fee \ --reference-script-size $refScriptSize \ --tx-body-file ${SP_NODE_ID}/tx.raw \ --tx-in-count 1 \ @@ -374,7 +374,7 @@ updatePool() { initialBalance=$(getAddressBalance "$paymentAddr") txOut=$((initialBalance - fee)) - cardano-cli conway transaction build-raw \ + cardano-cli latest transaction build-raw \ --tx-in "$utxo" \ --tx-out "$paymentAddr"+"$txOut" \ --invalid-hereafter 500000 \ @@ -383,7 +383,7 @@ updatePool() { --out-file ${SP_NODE_ID}/tx.raw done - cardano-cli conway transaction sign \ + cardano-cli latest transaction sign \ --tx-body-file ${SP_NODE_ID}/tx.raw \ --signing-key-file "$delegatorPaymentSKey" \ --signing-key-file "$coldKey" \ @@ -391,7 +391,7 @@ updatePool() { --testnet-magic 888 \ --out-file ${SP_NODE_ID}/tx.signed - cardano-cli conway transaction submit \ + cardano-cli latest transaction submit \ --tx-file ${SP_NODE_ID}/tx.signed \ --testnet-magic 888 @@ -416,11 +416,11 @@ deregisterPool() { done # get the protocol parameters - cardano-cli conway query protocol-parameters --testnet-magic 888 --out-file ${SP_NODE_ID}/params.json + cardano-cli latest query protocol-parameters --testnet-magic 888 --out-file ${SP_NODE_ID}/params.json genesisVKey=network-files/utxo-keys/utxo${SP_NODE_ID}.vkey genesisSKey=network-files/utxo-keys/utxo${SP_NODE_ID}.skey - genesisAddr=$(cardano-cli conway address build --payment-verification-key-file "$genesisVKey" --testnet-magic 888) + genesisAddr=$(cardano-cli latest address build --payment-verification-key-file "$genesisVKey" --testnet-magic 888) stakeKey=network-files/pools/staking-reward"${SP_NODE_ID}".skey coldVKey=network-files/pools/cold"${SP_NODE_ID}".vkey coldKey=network-files/pools/cold"${SP_NODE_ID}".skey @@ -432,20 +432,20 @@ deregisterPool() { # We are going to redelegate this stake to dbSync can index it properly. echo "Registering delegator stake certificate ${SP_NODE_ID}..." - paymentAddr=$(cardano-cli conway address build --payment-verification-key-file "$delegatorPaymentKey" --stake-verification-key-file "$delegatorStakeKey" --testnet-magic 888) + paymentAddr=$(cardano-cli latest address build --payment-verification-key-file "$delegatorPaymentKey" --stake-verification-key-file "$delegatorStakeKey" --testnet-magic 888) currentBalance=$(getAddressBalance "$paymentAddr") - POOL_ID=$(cardano-cli conway stake-pool id --cold-verification-key-file "$coldVKey" --output-format "hex") + POOL_ID=$(cardano-cli latest stake-pool id --cold-verification-key-file "$coldVKey" --output-format "hex") # create pool delegation certificate - cardano-cli conway stake-address stake-delegation-certificate \ + cardano-cli latest stake-address stake-delegation-certificate \ --stake-verification-key-file "$delegatorStakeKey" \ --stake-pool-id "$POOL_ID" \ --out-file ${SP_NODE_ID}/deleg.cert - utxo=$(cardano-cli conway query utxo --address "$paymentAddr" --testnet-magic 888 | awk 'NR == 3 {printf("%s#%s", $1, $2)}') + utxo=$(cardano-cli query utxo --address "$paymentAddr" --testnet-magic 888 | awk 'NR == 3 {printf("%s#%s", $1, $2)}') - cardano-cli conway transaction build-raw \ + cardano-cli latest transaction build-raw \ --tx-in "$utxo" \ --tx-out "$paymentAddr"+0 \ --invalid-hereafter 5000000 \ @@ -453,16 +453,16 @@ deregisterPool() { --out-file ${SP_NODE_ID}/tx.raw \ --certificate ${SP_NODE_ID}/deleg.cert - refScriptSize=$(cardano-cli conway query ref-script-size \ + refScriptSize=$(cardano-cli latest query ref-script-size \ --tx-in "$utxo" \ --testnet-magic 888 \ --output-json | jq '.refInputScriptSize') # Upon applying the fee, the tx size could increase, rendering the fee insuficient - # Calculate it twice, once with fee 0, then with the calculated fee, to minimise the + # Calculate it twice, once with fee 0, then with the calculated fee, to minimise the # chance that the tx size increases the second time for i in {1..2}; do - fee=$(cardano-cli conway transaction calculate-min-fee \ + fee=$(cardano-cli latest transaction calculate-min-fee \ --reference-script-size $refScriptSize \ --tx-body-file ${SP_NODE_ID}/tx.raw \ --tx-in-count 1 \ @@ -475,7 +475,7 @@ deregisterPool() { initialBalance=$(getAddressBalance "$paymentAddr") txOut=$((initialBalance - fee)) - cardano-cli conway transaction build-raw \ + cardano-cli latest transaction build-raw \ --tx-in "$utxo" \ --tx-out "$paymentAddr"+"$txOut" \ --invalid-hereafter 5000000 \ @@ -484,14 +484,14 @@ deregisterPool() { --out-file ${SP_NODE_ID}/tx.raw done - cardano-cli conway transaction sign \ + cardano-cli latest transaction sign \ --tx-body-file ${SP_NODE_ID}/tx.raw \ --signing-key-file "$delegatorPaymentSKey" \ --signing-key-file "$delegatorStakeSKey" \ --testnet-magic 888 \ --out-file ${SP_NODE_ID}/tx.signed - cardano-cli conway transaction submit \ + cardano-cli latest transaction submit \ --tx-file ${SP_NODE_ID}/tx.signed \ --testnet-magic 888 @@ -506,14 +506,14 @@ deregisterPool() { echo "Deregister stake pool ${SP_NODE_ID}..." currentBalance=$(getAddressBalance "$genesisAddr") - cardano-cli conway stake-pool deregistration-certificate \ + cardano-cli latest stake-pool deregistration-certificate \ --cold-verification-key-file "$coldVKey" \ --epoch "$RETIRING_EPOCH" \ --out-file ${SP_NODE_ID}/pool.dereg - utxo=$(cardano-cli conway query utxo --address "$genesisAddr" --testnet-magic 888 | awk 'NR == 3 {printf("%s#%s", $1, $2)}') + utxo=$(cardano-cli query utxo --address "$genesisAddr" --testnet-magic 888 | awk 'NR == 3 {printf("%s#%s", $1, $2)}') - cardano-cli conway transaction build-raw \ + cardano-cli latest transaction build-raw \ --tx-in "$utxo" \ --tx-out "$genesisAddr"+0 \ --invalid-hereafter 500000 \ @@ -521,16 +521,16 @@ deregisterPool() { --certificate-file ${SP_NODE_ID}/pool.dereg \ --out-file ${SP_NODE_ID}/tx.raw - refScriptSize=$(cardano-cli conway query ref-script-size \ + refScriptSize=$(cardano-cli latest query ref-script-size \ --tx-in "$utxo" \ --testnet-magic 888 \ --output-json | jq '.refInputScriptSize') - + # Upon applying the fee, the tx size could increase, rendering the fee insuficient - # Calculate it twice, once with fee 0, then with the calculated fee, to minimise the + # Calculate it twice, once with fee 0, then with the calculated fee, to minimise the # chance that the tx size increases the second time for i in {1..2}; do - fee=$(cardano-cli conway transaction calculate-min-fee \ + fee=$(cardano-cli latest transaction calculate-min-fee \ --reference-script-size $refScriptSize \ --tx-body-file ${SP_NODE_ID}/tx.raw \ --tx-in-count 1 \ @@ -543,7 +543,7 @@ deregisterPool() { initialBalance=$(getAddressBalance "$genesisAddr") txOut=$((initialBalance - fee)) - cardano-cli conway transaction build-raw \ + cardano-cli latest transaction build-raw \ --tx-in "$utxo" \ --tx-out "$genesisAddr"+"$txOut" \ --invalid-hereafter 500000 \ @@ -552,7 +552,7 @@ deregisterPool() { --out-file ${SP_NODE_ID}/tx.raw done - cardano-cli conway transaction sign \ + cardano-cli latest transaction sign \ --tx-body-file ${SP_NODE_ID}/tx.raw \ --signing-key-file "$genesisSKey" \ --signing-key-file "$coldKey" \ @@ -560,7 +560,7 @@ deregisterPool() { --testnet-magic 888 \ --out-file ${SP_NODE_ID}/tx.signed - cardano-cli conway transaction submit \ + cardano-cli latest transaction submit \ --tx-file ${SP_NODE_ID}/tx.signed \ --testnet-magic 888 diff --git a/packages/e2e/local-network/scripts/reference-input-transaction.sh b/packages/e2e/local-network/scripts/reference-input-transaction.sh index df7669e2c30..7fd7509aa7e 100755 --- a/packages/e2e/local-network/scripts/reference-input-transaction.sh +++ b/packages/e2e/local-network/scripts/reference-input-transaction.sh @@ -75,7 +75,7 @@ cardano-cli query protocol-parameters \ --testnet-magic 888 \ --out-file pparams.json -cardano-cli conway transaction build \ +cardano-cli latest transaction build \ --testnet-magic 888 \ --change-address "$genesisAddr" \ --tx-in "$utxo" \ @@ -83,13 +83,13 @@ cardano-cli conway transaction build \ --tx-out-inline-datum-value 42 \ --out-file tx-script.build -cardano-cli transaction sign \ +cardano-cli latest transaction sign \ --tx-body-file tx-script.build \ --signing-key-file network-files/utxo-keys/utxo2.skey \ --testnet-magic 888 \ --out-file tx-script.signed -cardano-cli transaction submit --testnet-magic 888 --tx-file tx-script.signed +cardano-cli latest transaction submit --testnet-magic 888 --tx-file tx-script.signed updatedBalance=$(getAddressBalance "$REFERENCE_INPUT_ADDR") @@ -107,7 +107,7 @@ currentBalance=$(getAddressBalance "$REFERENCE_SCRIPT_ADDR") echo "Locking reference script UTXO (Multisignature)..." -cardano-cli conway transaction build \ +cardano-cli latest transaction build \ --testnet-magic 888 \ --change-address "$genesisAddr" \ --tx-in "$utxo" \ @@ -115,13 +115,13 @@ cardano-cli conway transaction build \ --tx-out-reference-script-file scripts/contracts/multisignature.json \ --out-file tx-script.build -cardano-cli transaction sign \ +cardano-cli latest transaction sign \ --tx-body-file tx-script.build \ --signing-key-file network-files/utxo-keys/utxo2.skey \ --testnet-magic 888 \ --out-file tx-script.signed -cardano-cli transaction submit --testnet-magic 888 --tx-file tx-script.signed +cardano-cli latest transaction submit --testnet-magic 888 --tx-file tx-script.signed updatedBalance=$(getAddressBalance "$REFERENCE_SCRIPT_ADDR") @@ -137,7 +137,7 @@ currentBalance=$(getAddressBalance "$REFERENCE_SCRIPT_ADDR") echo "Locking reference script UTXO (Timelock)..." -cardano-cli conway transaction build \ +cardano-cli latest transaction build \ --testnet-magic 888 \ --change-address "$genesisAddr" \ --tx-in "$utxo" \ @@ -145,13 +145,13 @@ cardano-cli conway transaction build \ --tx-out-reference-script-file scripts/contracts/timelock.json \ --out-file tx-script.build -cardano-cli transaction sign \ +cardano-cli latest transaction sign \ --tx-body-file tx-script.build \ --signing-key-file network-files/utxo-keys/utxo2.skey \ --testnet-magic 888 \ --out-file tx-script.signed -cardano-cli transaction submit --testnet-magic 888 --tx-file tx-script.signed +cardano-cli latest transaction submit --testnet-magic 888 --tx-file tx-script.signed updatedBalance=$(getAddressBalance "$REFERENCE_SCRIPT_ADDR") @@ -167,7 +167,7 @@ currentBalance=$(getAddressBalance "$REFERENCE_SCRIPT_ADDR") echo "Locking reference script UTXO (Plutus V1)..." -cardano-cli conway transaction build \ +cardano-cli latest transaction build \ --testnet-magic 888 \ --change-address "$genesisAddr" \ --tx-in "$utxo" \ @@ -175,13 +175,13 @@ cardano-cli conway transaction build \ --tx-out-reference-script-file scripts/contracts/alwayssucceeds.plutus \ --out-file tx-script.build -cardano-cli transaction sign \ +cardano-cli latest transaction sign \ --tx-body-file tx-script.build \ --signing-key-file network-files/utxo-keys/utxo2.skey \ --testnet-magic 888 \ --out-file tx-script.signed -cardano-cli transaction submit --testnet-magic 888 --tx-file tx-script.signed +cardano-cli latest transaction submit --testnet-magic 888 --tx-file tx-script.signed updatedBalance=$(getAddressBalance "$REFERENCE_SCRIPT_ADDR") @@ -197,7 +197,7 @@ currentBalance=$(getAddressBalance "$REFERENCE_SCRIPT_ADDR") echo "Locking reference script UTXO (Plutus V2)..." -cardano-cli conway transaction build \ +cardano-cli latest transaction build \ --testnet-magic 888 \ --change-address "$genesisAddr" \ --tx-in "$utxo" \ @@ -205,13 +205,13 @@ cardano-cli conway transaction build \ --tx-out-reference-script-file scripts/contracts/reference-input.plutus \ --out-file tx-script.build -cardano-cli transaction sign \ +cardano-cli latest transaction sign \ --tx-body-file tx-script.build \ --signing-key-file network-files/utxo-keys/utxo2.skey \ --testnet-magic 888 \ --out-file tx-script.signed -cardano-cli transaction submit --testnet-magic 888 --tx-file tx-script.signed +cardano-cli latest transaction submit --testnet-magic 888 --tx-file tx-script.signed updatedBalance=$(getAddressBalance "$REFERENCE_SCRIPT_ADDR") @@ -226,7 +226,7 @@ echo "Locking funds in script..." utxo=$(awk '{printf("%s", $1)}' <<<"$(getBiggestUtxo "$genesisAddr")") currentBalance=$(getAddressBalance "$REFERENCE_INPUT_SCRIPT_ADDR") -cardano-cli conway transaction build \ +cardano-cli latest transaction build \ --testnet-magic 888 \ --tx-in "$utxo" \ --tx-out "$REFERENCE_INPUT_SCRIPT_ADDR"+"$AMOUNT" \ @@ -234,13 +234,13 @@ cardano-cli conway transaction build \ --change-address "$genesisAddr" \ --out-file test-babbage.tx -cardano-cli transaction sign \ +cardano-cli latest transaction sign \ --tx-body-file test-babbage.tx \ --signing-key-file network-files/utxo-keys/utxo2.skey \ --testnet-magic 888 \ --out-file test-babbage.signed -cardano-cli transaction submit --testnet-magic 888 --tx-file test-babbage.signed +cardano-cli latest transaction submit --testnet-magic 888 --tx-file test-babbage.signed updatedBalance=$(getAddressBalance "$REFERENCE_INPUT_SCRIPT_ADDR") @@ -259,7 +259,7 @@ scriptUtxo=$(awk '{printf("%s", $1)}' <<<"$(getBiggestUtxo "$REFERENCE_INPUT_SCR currentBalance=$(getAddressBalance "$REFERENCE_INPUT_SCRIPT_ADDR") returnCollateralVal=$(("$utxoVal" - 1450000)) -cardano-cli conway transaction build \ +cardano-cli latest transaction build \ --testnet-magic 888 \ --tx-in-collateral "$utxo" \ --tx-in "$utxo" \ @@ -273,13 +273,13 @@ cardano-cli conway transaction build \ --tx-total-collateral 1450000 \ --out-file test-babbage2.tx -cardano-cli transaction sign \ +cardano-cli latest transaction sign \ --tx-body-file test-babbage2.tx \ --signing-key-file network-files/utxo-keys/utxo2.skey \ --testnet-magic 888 \ --out-file test-babbage2.signed -cardano-cli transaction submit --testnet-magic 888 --tx-file test-babbage2.signed +cardano-cli latest transaction submit --testnet-magic 888 --tx-file test-babbage2.signed updatedBalance=$(getAddressBalance "$REFERENCE_INPUT_SCRIPT_ADDR") diff --git a/packages/e2e/local-network/scripts/setup-new-delegator-keys.sh b/packages/e2e/local-network/scripts/setup-new-delegator-keys.sh index 5d5d07e0546..0f634cfe451 100755 --- a/packages/e2e/local-network/scripts/setup-new-delegator-keys.sh +++ b/packages/e2e/local-network/scripts/setup-new-delegator-keys.sh @@ -68,7 +68,7 @@ mkdir -p "$DELEGATORS_DIR" # GENERATE NEW PAYMENT KEYS for NODE_ID in ${SP_NODES_ID}; do - cardano-cli conway address key-gen \ + cardano-cli latest address key-gen \ --verification-key-file "${DELEGATORS_DIR}/payment${NODE_ID}.vkey" \ --signing-key-file "${DELEGATORS_DIR}/payment${NODE_ID}.skey" done @@ -76,7 +76,7 @@ done # GENERATE NEW STAKE for NODE_ID in ${SP_NODES_ID}; do - cardano-cli conway stake-address key-gen \ + cardano-cli latest stake-address key-gen \ --verification-key-file "${DELEGATORS_DIR}/staking${NODE_ID}.vkey" \ --signing-key-file "${DELEGATORS_DIR}/staking${NODE_ID}.skey" done @@ -84,7 +84,7 @@ done # BUILD ADDRESSES FOR OUR NEW KEYS for NODE_ID in ${SP_NODES_ID}; do - cardano-cli conway address build \ + cardano-cli latest address build \ --testnet-magic $NETWORK_MAGIC \ --payment-verification-key-file "${DELEGATORS_DIR}/payment${NODE_ID}.vkey" \ --stake-verification-key-file "${DELEGATORS_DIR}/staking${NODE_ID}.vkey" \ @@ -94,7 +94,7 @@ done # BUILD ADDRESSES FOR THE EXISTING KEYS, WE WILL NEED THEM FOR OUR FUTURE TRANSACTIONS for NODE_ID in ${SP_NODES_ID}; do - cardano-cli conway address build \ + cardano-cli latest address build \ --testnet-magic $NETWORK_MAGIC \ --payment-verification-key-file "${UTXO_DIR}/utxo${NODE_ID}.vkey" \ --out-file "${UTXO_DIR}/utxo${NODE_ID}.addr" @@ -107,19 +107,19 @@ currentBalance=$(getAddressBalance "$stakeAddr") echo "Funding stake addresses with ${AMOUNT_PER_DELEGATOR}" for NODE_ID in ${SP_NODES_ID}; do - cardano-cli conway transaction build \ + cardano-cli latest transaction build \ --testnet-magic $NETWORK_MAGIC \ --tx-in "$(cardano-cli query utxo --address "$(cat "${UTXO_DIR}/utxo${NODE_ID}.addr")" --testnet-magic $NETWORK_MAGIC --out-file /dev/stdout | jq -r 'keys[0]')" \ --tx-out "$(cat ${DELEGATORS_DIR}/payment${NODE_ID}.addr)+${AMOUNT_PER_DELEGATOR}" \ --change-address "$(cat ${UTXO_DIR}/utxo${NODE_ID}.addr)" \ --out-file "${TRANSACTIONS_DIR}/tx${NODE_ID}.raw" - cardano-cli conway transaction sign --testnet-magic $NETWORK_MAGIC \ + cardano-cli latest transaction sign --testnet-magic $NETWORK_MAGIC \ --tx-body-file "${TRANSACTIONS_DIR}/tx${NODE_ID}.raw" \ --signing-key-file "${UTXO_DIR}/utxo${NODE_ID}.skey" \ --out-file "${TRANSACTIONS_DIR}/tx${NODE_ID}.signed" - cardano-cli conway transaction submit \ + cardano-cli latest transaction submit \ --testnet-magic $NETWORK_MAGIC \ --tx-file "${TRANSACTIONS_DIR}/tx${NODE_ID}.signed" done @@ -135,7 +135,7 @@ sleep 10 # SHOW THE UTXO DISTRIBUTION -cardano-cli conway query utxo --whole-utxo --testnet-magic $NETWORK_MAGIC +cardano-cli query utxo --whole-utxo --testnet-magic $NETWORK_MAGIC # REGISTER STAKE ADDRESSES @@ -146,26 +146,34 @@ stakeAddr="$(cat "${DELEGATORS_DIR}/payment1.addr")" currentBalance=$(getAddressBalance "$stakeAddr") for NODE_ID in ${SP_NODES_ID}; do - cardano-cli conway stake-address registration-certificate \ + cardano-cli latest stake-address registration-certificate \ --stake-verification-key-file "${DELEGATORS_DIR}/staking${NODE_ID}.vkey" \ --key-reg-deposit-amt ${keyDeposit} \ --out-file "${TRANSACTIONS_DIR}/staking${NODE_ID}reg.cert" - cardano-cli conway transaction build \ + # Wait for utxo to become available + txIn="$(cardano-cli latest query utxo --address "$(cat "${DELEGATORS_DIR}/payment${NODE_ID}.addr")" --testnet-magic $NETWORK_MAGIC --out-file /dev/stdout | jq -r 'keys[0]')"; + while [ "$txIn" == "null" ]; do + echo "TxIN is null, retrying..." + txIn="$(cardano-cli latest query utxo --address "$(cat "${DELEGATORS_DIR}/payment${NODE_ID}.addr")" --testnet-magic $NETWORK_MAGIC --out-file /dev/stdout | jq -r 'keys[0]')"; + sleep 1 + done + + cardano-cli latest transaction build \ --testnet-magic $NETWORK_MAGIC \ - --tx-in "$(cardano-cli query utxo --address "$(cat "${DELEGATORS_DIR}/payment${NODE_ID}.addr")" --testnet-magic $NETWORK_MAGIC --out-file /dev/stdout | jq -r 'keys[0]')" \ + --tx-in "$txIn" \ --change-address "$(cat ${DELEGATORS_DIR}/payment${NODE_ID}.addr)" \ --certificate-file "${TRANSACTIONS_DIR}/staking${NODE_ID}reg.cert" \ --witness-override 2 \ --out-file "${TRANSACTIONS_DIR}/reg-stake-tx${NODE_ID}.raw" - cardano-cli conway transaction sign --testnet-magic $NETWORK_MAGIC \ + cardano-cli latest transaction sign --testnet-magic $NETWORK_MAGIC \ --tx-body-file "${TRANSACTIONS_DIR}/reg-stake-tx${NODE_ID}.raw" \ --signing-key-file "${DELEGATORS_DIR}/payment${NODE_ID}.skey" \ --signing-key-file "${DELEGATORS_DIR}/staking${NODE_ID}.skey" \ --out-file "${TRANSACTIONS_DIR}/reg-stake-tx${NODE_ID}.signed" - cardano-cli conway transaction submit \ + cardano-cli latest transaction submit \ --testnet-magic $NETWORK_MAGIC \ --tx-file "${TRANSACTIONS_DIR}/reg-stake-tx${NODE_ID}.signed" done diff --git a/packages/e2e/local-network/scripts/setup-wallets.sh b/packages/e2e/local-network/scripts/setup-wallets.sh index fa8dfa2163b..881242bbbea 100755 --- a/packages/e2e/local-network/scripts/setup-wallets.sh +++ b/packages/e2e/local-network/scripts/setup-wallets.sh @@ -37,7 +37,7 @@ walletAddr5="addr_test1qr0c3frkem9cqn5f73dnvqpena27k2fgqew6wct9eaka03agfwkvzr0zy # Spend the first UTxO utxo=$(cardano-cli query utxo --address "$genesisAddr" --testnet-magic 888 | awk 'NR == 3 {printf("%s#%s", $1, $2)}') -cardano-cli conway transaction build \ +cardano-cli latest transaction build \ --change-address "$genesisAddr" \ --tx-in "$utxo" \ --tx-out "$walletAddr1"+"$AMOUNT_PER_WALLET" \ @@ -48,11 +48,11 @@ cardano-cli conway transaction build \ --testnet-magic 888 \ --out-file wallets-tx.raw -cardano-cli transaction sign \ +cardano-cli latest transaction sign \ --tx-body-file wallets-tx.raw \ --signing-key-file network-files/utxo-keys/utxo3.skey \ --testnet-magic 888 \ --out-file wallets-tx.signed -cardano-cli transaction submit --testnet-magic 888 --tx-file wallets-tx.signed +cardano-cli latest transaction submit --testnet-magic 888 --tx-file wallets-tx.signed wait_tx_complete $utxo diff --git a/packages/e2e/local-network/scripts/start.sh b/packages/e2e/local-network/scripts/start.sh index a6c8f984168..9cdf92504b3 100755 --- a/packages/e2e/local-network/scripts/start.sh +++ b/packages/e2e/local-network/scripts/start.sh @@ -43,7 +43,6 @@ while [ `cardano-cli query tip --testnet-magic 888 | jq .block` == null ] ; do sleep 1 done -healthy & ./scripts/setup-new-delegator-keys.sh ./scripts/update-stake-pools.sh.sh "$SP_NODES_ID" @@ -56,4 +55,6 @@ healthy & touch ./network-files/run/done +healthy & + wait diff --git a/packages/e2e/package.json b/packages/e2e/package.json index ecceb826603..20a89994de1 100644 --- a/packages/e2e/package.json +++ b/packages/e2e/package.json @@ -75,7 +75,7 @@ }, "dependencies": { "@cardano-foundation/ledgerjs-hw-app-cardano": "^7.1.4", - "@cardano-ogmios/client": "6.5.0", + "@cardano-ogmios/client": "6.9.0", "@cardano-sdk/cardano-services": "workspace:~", "@cardano-sdk/cardano-services-client": "workspace:~", "@cardano-sdk/core": "workspace:~", diff --git a/packages/ogmios/package.json b/packages/ogmios/package.json index 9d971fa78c2..511e83bbd54 100644 --- a/packages/ogmios/package.json +++ b/packages/ogmios/package.json @@ -37,7 +37,7 @@ "prepack": "yarn build" }, "devDependencies": { - "@cardano-ogmios/schema": "6.5.0", + "@cardano-ogmios/schema": "6.9.0", "@cardano-sdk/cardano-services-client": "workspace:~", "@cardano-sdk/util-dev": "workspace:~", "@cardano-sdk/util-rxjs": "workspace:~", @@ -54,8 +54,8 @@ "ws": "^8.5.0" }, "dependencies": { - "@cardano-ogmios/client": "6.5.0", - "@cardano-ogmios/schema": "6.5.0", + "@cardano-ogmios/client": "6.9.0", + "@cardano-ogmios/schema": "6.9.0", "@cardano-sdk/core": "workspace:~", "@cardano-sdk/crypto": "workspace:~", "@cardano-sdk/projection": "workspace:~", diff --git a/packages/ogmios/src/ogmiosToCore/tx.ts b/packages/ogmios/src/ogmiosToCore/tx.ts index d49050ca9e1..aef38e55ee6 100644 --- a/packages/ogmios/src/ogmiosToCore/tx.ts +++ b/packages/ogmios/src/ogmiosToCore/tx.ts @@ -60,6 +60,9 @@ const mapPoolParameters = (poolParameters: Schema.StakePool): Cardano.PoolParame }; }; +const mapCredentialType = (credentialOrigin: Schema.CredentialOrigin) => + credentialOrigin === 'verificationKey' ? Cardano.CredentialType.KeyHash : Cardano.CredentialType.ScriptHash; + // TODO: Below certificates must be completed + unit tests // eslint-disable-next-line complexity const mapCertificate = (certificate: Schema.Certificate): Cardano.Certificate => { @@ -72,14 +75,14 @@ const mapCertificate = (certificate: Schema.Certificate): Cardano.Certificate => poolId: Cardano.PoolId(certificate.stakePool.id), stakeCredential: { hash: Crypto.Hash28ByteBase16(certificate.credential), - type: Cardano.CredentialType.KeyHash + type: mapCredentialType(certificate.from) } } as Cardano.StakeDelegationCertificate) : ({ __typename: Cardano.CertificateType.VoteDelegation, stakeCredential: { hash: Crypto.Hash28ByteBase16(certificate.credential), - type: Cardano.CredentialType.KeyHash + type: mapCredentialType(certificate.from) } // TODO: Conway `certificate.delegateRepresentative` } as Cardano.VoteDelegationCertificate); @@ -88,7 +91,7 @@ const mapCertificate = (certificate: Schema.Certificate): Cardano.Certificate => __typename: Cardano.CertificateType.StakeRegistration, stakeCredential: { hash: Crypto.Hash28ByteBase16(certificate.credential), - type: Cardano.CredentialType.KeyHash + type: mapCredentialType(certificate.from) } // TODO: Conway `certificate.deposit` }; @@ -97,7 +100,7 @@ const mapCertificate = (certificate: Schema.Certificate): Cardano.Certificate => __typename: Cardano.CertificateType.StakeDeregistration, stakeCredential: { hash: Crypto.Hash28ByteBase16(certificate.credential), - type: Cardano.CredentialType.KeyHash + type: mapCredentialType(certificate.from) } // TODO: Conway `certificate.deposit` }; diff --git a/packages/ogmios/test/ogmiosToCore/testData.ts b/packages/ogmios/test/ogmiosToCore/testData.ts index ac4e93dd63f..c64c11a5a72 100644 --- a/packages/ogmios/test/ogmiosToCore/testData.ts +++ b/packages/ogmios/test/ogmiosToCore/testData.ts @@ -191,6 +191,7 @@ export const mockShelleyBlock: Ogmios.Schema.Block = { certificates: [ { credential: '968d1021ebd7178e1fb0e79676982825cabc779b653e1234d58ce3c6', + from: 'verificationKey', type: 'stakeCredentialRegistration' }, { @@ -218,6 +219,7 @@ export const mockShelleyBlock: Ogmios.Schema.Block = { }, { credential: '968d1021ebd7178e1fb0e79676982825cabc779b653e1234d58ce3c6', + from: 'verificationKey', stakePool: { id: 'pool1547tew8vmuj0g6vj3k5jfddudextcw6hsk2hwgg6pkhk7lwphe6' }, @@ -225,6 +227,7 @@ export const mockShelleyBlock: Ogmios.Schema.Block = { }, { credential: 'f130204b518f70c19995449e3737eded3d9ffc31cb50ec0e45010ba3', + from: 'verificationKey', type: 'stakeCredentialRegistration' }, { @@ -252,6 +255,7 @@ export const mockShelleyBlock: Ogmios.Schema.Block = { }, { credential: 'f130204b518f70c19995449e3737eded3d9ffc31cb50ec0e45010ba3', + from: 'verificationKey', stakePool: { id: 'pool174mw7e20768e8vj4fn8y6p536n8rkzswsapwtwn354dckpjqzr8' }, @@ -259,6 +263,7 @@ export const mockShelleyBlock: Ogmios.Schema.Block = { }, { credential: '392ae9e068e55e8b5c27acc58b0bab8ea568c0aae2f6fc49be23a7ad', + from: 'verificationKey', type: 'stakeCredentialRegistration' }, { @@ -286,6 +291,7 @@ export const mockShelleyBlock: Ogmios.Schema.Block = { }, { credential: '392ae9e068e55e8b5c27acc58b0bab8ea568c0aae2f6fc49be23a7ad', + from: 'verificationKey', stakePool: { id: 'pool1z22x50lqsrwent6en0llzzs9e577rx7n3mv9kfw7udwa2rf42fa' }, @@ -565,6 +571,7 @@ export const mockAlonzoBlock: Ogmios.Schema.Block = { votes: [ { issuer: { + from: 'verificationKey', id: '637f2e950b0fd8f8e3e811c5fbeb19e411e7a2bf37272b84b29c1a0b', role: 'genesisDelegate' }, @@ -572,6 +579,7 @@ export const mockAlonzoBlock: Ogmios.Schema.Block = { }, { issuer: { + from: 'verificationKey', id: '8a4b77c4f534f8b8cc6f269e5ebb7ba77fa63a476e50e05e66d7051c', role: 'genesisDelegate' }, @@ -579,6 +587,7 @@ export const mockAlonzoBlock: Ogmios.Schema.Block = { }, { issuer: { + from: 'verificationKey', id: 'b00470cd193d67aac47c373602fccd4195aad3002c169b5570de1126', role: 'genesisDelegate' }, @@ -586,6 +595,7 @@ export const mockAlonzoBlock: Ogmios.Schema.Block = { }, { issuer: { + from: 'verificationKey', id: 'b260ffdb6eba541fcf18601923457307647dce807851b9d19da133ab', role: 'genesisDelegate' }, @@ -593,6 +603,7 @@ export const mockAlonzoBlock: Ogmios.Schema.Block = { }, { issuer: { + from: 'verificationKey', id: 'ced1599fd821a39593e00592e5292bdc1437ae0f7af388ef5257344a', role: 'genesisDelegate' }, @@ -600,6 +611,7 @@ export const mockAlonzoBlock: Ogmios.Schema.Block = { }, { issuer: { + from: 'verificationKey', id: 'dd2a7d71a05bed11db61555ba4c658cb1ce06c8024193d064f2a66ae', role: 'genesisDelegate' }, @@ -607,6 +619,7 @@ export const mockAlonzoBlock: Ogmios.Schema.Block = { }, { issuer: { + from: 'verificationKey', id: 'f3b9e74f7d0f24d2314ea5dfbca94b65b2059d1ff94d97436b82d5b4', role: 'genesisDelegate' }, @@ -857,6 +870,7 @@ export const mockAllegraBlock: Ogmios.Schema.Block = { votes: [ { issuer: { + from: 'verificationKey', id: '637f2e950b0fd8f8e3e811c5fbeb19e411e7a2bf37272b84b29c1a0b', role: 'genesisDelegate' }, @@ -864,6 +878,7 @@ export const mockAllegraBlock: Ogmios.Schema.Block = { }, { issuer: { + from: 'verificationKey', id: '8a4b77c4f534f8b8cc6f269e5ebb7ba77fa63a476e50e05e66d7051c', role: 'genesisDelegate' }, @@ -871,6 +886,7 @@ export const mockAllegraBlock: Ogmios.Schema.Block = { }, { issuer: { + from: 'verificationKey', id: 'b00470cd193d67aac47c373602fccd4195aad3002c169b5570de1126', role: 'genesisDelegate' }, @@ -878,6 +894,7 @@ export const mockAllegraBlock: Ogmios.Schema.Block = { }, { issuer: { + from: 'verificationKey', id: 'b260ffdb6eba541fcf18601923457307647dce807851b9d19da133ab', role: 'genesisDelegate' }, @@ -885,6 +902,7 @@ export const mockAllegraBlock: Ogmios.Schema.Block = { }, { issuer: { + from: 'verificationKey', id: 'ced1599fd821a39593e00592e5292bdc1437ae0f7af388ef5257344a', role: 'genesisDelegate' }, @@ -892,6 +910,7 @@ export const mockAllegraBlock: Ogmios.Schema.Block = { }, { issuer: { + from: 'verificationKey', id: 'dd2a7d71a05bed11db61555ba4c658cb1ce06c8024193d064f2a66ae', role: 'genesisDelegate' }, @@ -899,6 +918,7 @@ export const mockAllegraBlock: Ogmios.Schema.Block = { }, { issuer: { + from: 'verificationKey', id: 'f3b9e74f7d0f24d2314ea5dfbca94b65b2059d1ff94d97436b82d5b4', role: 'genesisDelegate' }, @@ -1086,6 +1106,7 @@ export const mockMaryBlock: Ogmios.Schema.Block = { votes: [ { issuer: { + from: 'verificationKey', id: '637f2e950b0fd8f8e3e811c5fbeb19e411e7a2bf37272b84b29c1a0b', role: 'genesisDelegate' }, @@ -1093,6 +1114,7 @@ export const mockMaryBlock: Ogmios.Schema.Block = { }, { issuer: { + from: 'verificationKey', id: '8a4b77c4f534f8b8cc6f269e5ebb7ba77fa63a476e50e05e66d7051c', role: 'genesisDelegate' }, @@ -1100,6 +1122,7 @@ export const mockMaryBlock: Ogmios.Schema.Block = { }, { issuer: { + from: 'verificationKey', id: 'b00470cd193d67aac47c373602fccd4195aad3002c169b5570de1126', role: 'genesisDelegate' }, @@ -1107,6 +1130,7 @@ export const mockMaryBlock: Ogmios.Schema.Block = { }, { issuer: { + from: 'verificationKey', id: 'b260ffdb6eba541fcf18601923457307647dce807851b9d19da133ab', role: 'genesisDelegate' }, @@ -1114,6 +1138,7 @@ export const mockMaryBlock: Ogmios.Schema.Block = { }, { issuer: { + from: 'verificationKey', id: 'ced1599fd821a39593e00592e5292bdc1437ae0f7af388ef5257344a', role: 'genesisDelegate' }, @@ -1121,6 +1146,7 @@ export const mockMaryBlock: Ogmios.Schema.Block = { }, { issuer: { + from: 'verificationKey', id: 'dd2a7d71a05bed11db61555ba4c658cb1ce06c8024193d064f2a66ae', role: 'genesisDelegate' }, @@ -1128,6 +1154,7 @@ export const mockMaryBlock: Ogmios.Schema.Block = { }, { issuer: { + from: 'verificationKey', id: 'f3b9e74f7d0f24d2314ea5dfbca94b65b2059d1ff94d97436b82d5b4', role: 'genesisDelegate' }, @@ -1178,6 +1205,7 @@ export const mockBabbageBlock: Ogmios.Schema.Block = { certificates: [ { credential: 'c568341dc347876c1c79e07de3e76265560bca4bb9e6af9f36e40923', + from: 'verificationKey', type: 'stakeCredentialDeregistration' } ], @@ -1691,6 +1719,7 @@ export const mockBabbageBlockWithNftMetadata: Ogmios.Schema.Block = { certificates: [ { credential: '92a4e1a62625324b8099bfc57ac707a9ebdcfa7ee953f96b7e0d6757', + from: 'verificationKey', type: 'stakeCredentialRegistration' } ], diff --git a/packages/wallet/package.json b/packages/wallet/package.json index d97b7cba10b..c503a59cb64 100644 --- a/packages/wallet/package.json +++ b/packages/wallet/package.json @@ -40,7 +40,7 @@ }, "devDependencies": { "@cardano-foundation/ledgerjs-hw-app-cardano": "^7.1.4", - "@cardano-ogmios/client": "6.5.0", + "@cardano-ogmios/client": "6.9.0", "@cardano-sdk/cardano-services-client": "workspace:~", "@cardano-sdk/ogmios": "workspace:~", "@cardano-sdk/util-dev": "workspace:~", diff --git a/yarn-project.nix b/yarn-project.nix index faba10560c5..2d84820bd7a 100644 --- a/yarn-project.nix +++ b/yarn-project.nix @@ -408,8 +408,8 @@ cacheEntries = { "@blockfrost/blockfrost-js@npm:5.5.0" = { filename = "@blockfrost-blockfrost-js-npm-5.5.0-b5af01a7d6-2770f3ca14.zip"; sha512 = "2770f3ca1492ab5c3cc9a233cfdc004e2d136eb3ac0c3f19c847156c96df561737c167861a3e2db409fef3c6a07e72b8109c10e05afc50cb9208416bb99cb2f0"; }; "@blockfrost/openapi@npm:0.1.60" = { filename = "@blockfrost-openapi-npm-0.1.60-64f77da01a-2ab66de532.zip"; sha512 = "2ab66de532917fef3f1e88ab0cbb4259f79ba9b73fd865cd815f1e836d596de4394ece2914bd8b5ac8f0d38a7f7e11226a6a21ec298a4becf4d273e40abb08f4"; }; "@cardano-foundation/ledgerjs-hw-app-cardano@npm:7.1.4" = { filename = "@cardano-foundation-ledgerjs-hw-app-cardano-npm-7.1.4-f617fd42e1-e4314ad801.zip"; sha512 = "e4314ad8014a39c0ff5ed4ce523954c0d773d64e5f59333eeac51cc1f1bba3cf1ad5cf96d0d395319cd30be04c3fc3864a79249570de9e534b6ce3c3c968bff2"; }; -"@cardano-ogmios/client@npm:6.5.0" = { filename = "@cardano-ogmios-client-npm-6.5.0-498603e1f1-7eb68d28a0.zip"; sha512 = "7eb68d28a0e436b026cd2a422152b3242ec66c033ae747d89a0f4d90f89dc6053b825ce7b2e2ab211c8443c1273078882be70e493a0278b6b9bd7c8f992cc68b"; }; -"@cardano-ogmios/schema@npm:6.5.0" = { filename = "@cardano-ogmios-schema-npm-6.5.0-f652d8e468-be5ba6e73f.zip"; sha512 = "be5ba6e73f84fc2ef063bd372068e55bd685afc6b71524423b32cec8e06892f170a9185354588c531ae98168182e1eacfd3620ef10a796d3ae68a3b0331a1de8"; }; +"@cardano-ogmios/client@npm:6.9.0" = { filename = "@cardano-ogmios-client-npm-6.9.0-b814847e62-f46d36bc2d.zip"; sha512 = "f46d36bc2dea077454ce29e503b2881736ad7887570a79d8c5c87c2ef6ecc0e972bb489812c3e95f214e93d4f4dff23a6dcaeb336b867f25bc1274441acbf491"; }; +"@cardano-ogmios/schema@npm:6.9.0" = { filename = "@cardano-ogmios-schema-npm-6.9.0-a0db1ac693-5e607c8471.zip"; sha512 = "5e607c84710e05268fa10757547fcc79df7dc5dbaf6b2b78c50e1701184a19ba8b2bd5b4d4040048cbe10404f82732c7269efe55e6202a50048fae1aa5d10a54"; }; "@cardanosolutions/json-bigint@npm:1.0.1" = { filename = "@cardanosolutions-json-bigint-npm-1.0.1-b157608882-cd52446a76.zip"; sha512 = "cd52446a76516c528c69d431c1b593a029e87106968bd2b8e6074761025b77fc18a1b8ae6a10a6e5897446058ca79e0864de6c7d609240275e30cc9f0d2f2fd1"; }; "@chainsafe/is-ip@npm:2.0.2" = { filename = "@chainsafe-is-ip-npm-2.0.2-6962206849-2600350ba1.zip"; sha512 = "2600350ba1c8fbad5d1ebee71317beeb29fbaebf43780d89e30f8c6c2d27b95ebdab0284dfbab7336b5eb6d8ffcc7081e3e4c5b221889dc366463f83bbe38adb"; }; "@chainsafe/netmask@npm:2.0.0" = { filename = "@chainsafe-netmask-npm-2.0.0-44b57d979f-90d27154c1.zip"; sha512 = "90d27154c11ff878130150766ebfc490c829cd5249a61f7018fa4cefe3a18d92394285bb435c38bd0dbe45261006a82572e95ac201e9b28157de80127a6a3d06"; }; diff --git a/yarn.lock b/yarn.lock index e3ba38b8aea..e6cd96a36be 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3356,11 +3356,11 @@ __metadata: languageName: node linkType: hard -"@cardano-ogmios/client@npm:6.5.0": - version: 6.5.0 - resolution: "@cardano-ogmios/client@npm:6.5.0" +"@cardano-ogmios/client@npm:6.9.0": + version: 6.9.0 + resolution: "@cardano-ogmios/client@npm:6.9.0" dependencies: - "@cardano-ogmios/schema": 6.5.0 + "@cardano-ogmios/schema": 6.9.0 "@cardanosolutions/json-bigint": ^1.0.1 "@types/json-bigint": ^1.0.1 bech32: ^2.0.0 @@ -3370,14 +3370,14 @@ __metadata: nanoid: ^3.1.31 ts-custom-error: ^3.2.0 ws: ^7.5.10 - checksum: 7eb68d28a0e436b026cd2a422152b3242ec66c033ae747d89a0f4d90f89dc6053b825ce7b2e2ab211c8443c1273078882be70e493a0278b6b9bd7c8f992cc68b + checksum: f46d36bc2dea077454ce29e503b2881736ad7887570a79d8c5c87c2ef6ecc0e972bb489812c3e95f214e93d4f4dff23a6dcaeb336b867f25bc1274441acbf491 languageName: node linkType: hard -"@cardano-ogmios/schema@npm:6.5.0": - version: 6.5.0 - resolution: "@cardano-ogmios/schema@npm:6.5.0" - checksum: be5ba6e73f84fc2ef063bd372068e55bd685afc6b71524423b32cec8e06892f170a9185354588c531ae98168182e1eacfd3620ef10a796d3ae68a3b0331a1de8 +"@cardano-ogmios/schema@npm:6.9.0": + version: 6.9.0 + resolution: "@cardano-ogmios/schema@npm:6.9.0" + checksum: 5e607c84710e05268fa10757547fcc79df7dc5dbaf6b2b78c50e1701184a19ba8b2bd5b4d4040048cbe10404f82732c7269efe55e6202a50048fae1aa5d10a54 languageName: node linkType: hard @@ -3413,7 +3413,7 @@ __metadata: resolution: "@cardano-sdk/cardano-services@workspace:packages/cardano-services" dependencies: "@blockfrost/blockfrost-js": ^5.5.0 - "@cardano-ogmios/client": 6.5.0 + "@cardano-ogmios/client": 6.9.0 "@cardano-sdk/cardano-services-client": "workspace:~" "@cardano-sdk/core": "workspace:~" "@cardano-sdk/crypto": "workspace:~" @@ -3494,8 +3494,8 @@ __metadata: resolution: "@cardano-sdk/core@workspace:packages/core" dependencies: "@biglup/is-cid": ^1.0.3 - "@cardano-ogmios/client": 6.5.0 - "@cardano-ogmios/schema": 6.5.0 + "@cardano-ogmios/client": 6.9.0 + "@cardano-ogmios/schema": 6.9.0 "@cardano-sdk/crypto": "workspace:~" "@cardano-sdk/util": "workspace:~" "@foxglove/crc": ^0.0.3 @@ -3527,7 +3527,7 @@ __metadata: version: 0.0.0-use.local resolution: "@cardano-sdk/crypto@workspace:packages/crypto" dependencies: - "@cardano-ogmios/schema": 6.5.0 + "@cardano-ogmios/schema": 6.9.0 "@cardano-sdk/util": "workspace:~" "@dcspark/cardano-multiplatform-lib-nodejs": ^3.1.1 "@types/blake2b": ^2.1.0 @@ -3594,7 +3594,7 @@ __metadata: "@babel/preset-env": ^7.18.2 "@babel/preset-typescript": ^7.17.12 "@cardano-foundation/ledgerjs-hw-app-cardano": ^7.1.4 - "@cardano-ogmios/client": 6.5.0 + "@cardano-ogmios/client": 6.9.0 "@cardano-sdk/cardano-services": "workspace:~" "@cardano-sdk/cardano-services-client": "workspace:~" "@cardano-sdk/core": "workspace:~" @@ -3859,8 +3859,8 @@ __metadata: version: 0.0.0-use.local resolution: "@cardano-sdk/ogmios@workspace:packages/ogmios" dependencies: - "@cardano-ogmios/client": 6.5.0 - "@cardano-ogmios/schema": 6.5.0 + "@cardano-ogmios/client": 6.9.0 + "@cardano-ogmios/schema": 6.9.0 "@cardano-sdk/cardano-services-client": "workspace:~" "@cardano-sdk/core": "workspace:~" "@cardano-sdk/crypto": "workspace:~" @@ -4047,7 +4047,7 @@ __metadata: resolution: "@cardano-sdk/wallet@workspace:packages/wallet" dependencies: "@cardano-foundation/ledgerjs-hw-app-cardano": ^7.1.4 - "@cardano-ogmios/client": 6.5.0 + "@cardano-ogmios/client": 6.9.0 "@cardano-sdk/cardano-services-client": "workspace:~" "@cardano-sdk/core": "workspace:~" "@cardano-sdk/crypto": "workspace:~" From 447f26a95576df5e3f5062001937f6ffe4b4537e Mon Sep 17 00:00:00 2001 From: Mircea Hasegan Date: Tue, 5 Nov 2024 11:46:24 +0100 Subject: [PATCH 2/9] chore: remove obsolete docker compose version attribute --- compose/pg-agent.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/compose/pg-agent.yml b/compose/pg-agent.yml index 200c3063b7e..89fa0d4e315 100644 --- a/compose/pg-agent.yml +++ b/compose/pg-agent.yml @@ -1,5 +1,3 @@ -version: '3.9' - x-logging: &logging logging: driver: 'json-file' From 7a939d8fb5a0d015a57302399070e07bfd31d688 Mon Sep 17 00:00:00 2001 From: Mircea Hasegan Date: Tue, 5 Nov 2024 12:31:09 +0100 Subject: [PATCH 3/9] chore(cardano-services): blockfrost-ryo should not be restricted to a profile --- packages/cardano-services/docker-compose.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/packages/cardano-services/docker-compose.yml b/packages/cardano-services/docker-compose.yml index 774b5ba83ad..5522bd5ad18 100644 --- a/packages/cardano-services/docker-compose.yml +++ b/packages/cardano-services/docker-compose.yml @@ -9,17 +9,14 @@ x-sdk-environment: &sdk-environment HANDLE_POLICY_IDS: ${HANDLE_POLICY_IDS:-f0ff48bbb7bbe9d59a40f1ce90e9e9d0ff5002ec48f232b49ca0fb9a} services: - blockfrost-ryo: environment: <<: *sdk-environment NODE_ENV: local-blockfrost-ryo BLOCKFROST_CONFIG_NETWORK: ${NETWORK:-mainnet} BLOCKFROST_CONFIG_TOKEN_REGISTRY_URL: ${TOKEN_METADATA_SERVER_URL:-https://tokens.cardano.org} - volumes: - ./blockfrost/ryo:/app/config - profiles: [ blockfrost-ryo ] cardano-node: volumes: From 942549fba77aee4f1827866aa9a908587c70338a Mon Sep 17 00:00:00 2001 From: Mircea Hasegan Date: Tue, 5 Nov 2024 17:17:54 +0100 Subject: [PATCH 4/9] chore(e2e): remove PRE_CONWAY local-network flag --- packages/e2e/.env.example | 5 ----- packages/e2e/docker-compose.yml | 1 - .../e2e/local-network/scripts/make-babbage.sh | 16 ---------------- 3 files changed, 22 deletions(-) diff --git a/packages/e2e/.env.example b/packages/e2e/.env.example index 24fc638e6ae..3912a1ff259 100644 --- a/packages/e2e/.env.example +++ b/packages/e2e/.env.example @@ -55,11 +55,6 @@ SCHEDULES="/config/schedules.json" # Required by test:long-running STAKE_POOL_PROJECTOR_URL='http://localhost:4002/' -# PRE_CONWAY=stable starts the local-network in babbage era. If this variable is not set, the local-network will start in conway era. -# TODO: Once conway era is stable, remove this variable and start the local-network in conway era by default. -# -# PRE_CONWAY=stable - # NETWORK_SPEED (fast|slow) determines the timeout tests will use when for blockchain events, like transaction confirmation. # It should be configured to 'slow' when running against real networks like preprod. # The local-network slotLength is 0.2s when running in fast mode (default), and 1s when running in slow mode. diff --git a/packages/e2e/docker-compose.yml b/packages/e2e/docker-compose.yml index 8ffa7ba53cd..270641add58 100644 --- a/packages/e2e/docker-compose.yml +++ b/packages/e2e/docker-compose.yml @@ -27,7 +27,6 @@ services: CARDANO_NODE_LOG_LEVEL: ${CARDANO_NODE_LOG_LEVEL:-Info} CARDANO_NODE_CHAINDB_LOG_LEVEL: ${CARDANO_NODE_CHAINDB_LOG_LEVEL:-Notice} NETWORK_SPEED: ${NETWORK_SPEED:-fast} - PRE_CONWAY: ${PRE_CONWAY} ports: - 3001:3001 volumes: diff --git a/packages/e2e/local-network/scripts/make-babbage.sh b/packages/e2e/local-network/scripts/make-babbage.sh index f49af8c0173..5cc4f437a1b 100755 --- a/packages/e2e/local-network/scripts/make-babbage.sh +++ b/packages/e2e/local-network/scripts/make-babbage.sh @@ -153,22 +153,6 @@ echo "TestConwayHardForkAtEpoch: 0" >> "${ROOT}/configuration.yaml" echo "ExperimentalHardForksEnabled: True" >> "${ROOT}/configuration.yaml" echo "ExperimentalProtocolsEnabled: True" >> "${ROOT}/configuration.yaml" -# TODO: Remove once mainnet is hardforked to conway-era and we don't need to run the e2e tests on pre-conway too. -# If we want the network to start in Babbage era we need to configure it to hardfork to Conway very far in the future. -# We also need to update the conway transaction cli commands to babbage cli commands. -if [ -n "$PRE_CONWAY" ]; then - echo "Updating scripts for pre-conway eras" - # Start in Babbage era - sed -i '/TestConwayHardForkAtEpoch/d' ./templates/babbage/node-config.json - sed -i '/TestConwayHardForkAtEpoch/d' ${ROOT}/configuration.yaml - - # Convert all cardano-cli conway cmds to babbage - find ./scripts/ -type f -name "*.sh" -exec sed -i 's/cardano-cli conway /cardano-cli babbage /g' {} + - - # Remove cardano-cli conway specific args - sed -i '/--key-reg-deposit-amt/d' ./scripts/setup-new-delegator-keys.sh -fi - # Copy the cost mode cardano-cli latest genesis create-staked --genesis-dir "${ROOT}" \ --testnet-magic "${NETWORK_MAGIC}" \ From ebe414929d0178ec83e0804bb592996edf346b24 Mon Sep 17 00:00:00 2001 From: Mircea Hasegan Date: Tue, 5 Nov 2024 18:52:53 +0100 Subject: [PATCH 5/9] chore(cardano-services): revert ab6b47b debugging changes applied to rebuild-test-db.sh script --- .../test/jest-setup/rebuild-test-db.sh | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/packages/cardano-services/test/jest-setup/rebuild-test-db.sh b/packages/cardano-services/test/jest-setup/rebuild-test-db.sh index 48090e76a9c..4f0000c62df 100755 --- a/packages/cardano-services/test/jest-setup/rebuild-test-db.sh +++ b/packages/cardano-services/test/jest-setup/rebuild-test-db.sh @@ -12,22 +12,22 @@ PASSWORD=$(cat $SECRETS_DIR/postgres_password) export DB_SYNC_CONNECTION_STRING="postgresql://${USER}:${PASSWORD}@localhost:5435/${DB_DB_SYNC}" -# yarn cleanup -# yarn -# yarn build -# yarn test:build:verify +yarn cleanup +yarn +yarn build +yarn test:build:verify -# yarn workspace @cardano-sdk/e2e local-network:down -# yarn workspace @cardano-sdk/e2e local-network:up -d --build +yarn workspace @cardano-sdk/e2e local-network:down +yarn workspace @cardano-sdk/e2e local-network:up -d --build -# yarn workspace @cardano-sdk/e2e test:wallet -# yarn workspace @cardano-sdk/e2e test:long-running simple-delegation-rewards.test.ts -# yarn workspace @cardano-sdk/e2e test:local-network register-pool.test.ts +yarn workspace @cardano-sdk/e2e test:wallet +yarn workspace @cardano-sdk/e2e test:long-running simple-delegation-rewards.test.ts +yarn workspace @cardano-sdk/e2e test:local-network register-pool.test.ts -# TL_LEVEL="${TL_LEVEL:=info}" node "$SCRIPT_DIR/mint-handles.js" +TL_LEVEL="${TL_LEVEL:=info}" node "$SCRIPT_DIR/mint-handles.js" -echo 'DO NOT Stop providing data to projectors' -# docker compose -p local-network-e2e stop cardano-node ogmios +echo 'Stop providing data to projectors' +docker compose -p local-network-e2e stop cardano-node ogmios sleep 2 echo 'Creating snapshots...' @@ -39,4 +39,4 @@ for DB_FILE in $( done echo 'Snapshots created.' -# yarn workspace @cardano-sdk/e2e local-network:down +yarn workspace @cardano-sdk/e2e local-network:down From 7f21d35d809d94a028035ae98147c2ffc9bdb243 Mon Sep 17 00:00:00 2001 From: Mircea Hasegan Date: Wed, 6 Nov 2024 14:41:47 +0100 Subject: [PATCH 6/9] chore(e2e): cleanup handle_policy_ids and configs from sdk-ipc folder --- packages/e2e/local-network/scripts/clean.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/e2e/local-network/scripts/clean.sh b/packages/e2e/local-network/scripts/clean.sh index cdac5a4f1bf..7fd93762578 100755 --- a/packages/e2e/local-network/scripts/clean.sh +++ b/packages/e2e/local-network/scripts/clean.sh @@ -12,3 +12,5 @@ rm -rf ./network-files/node-sp*/* rm -rf ./sockets/* rm -rf ./config/* rm -rf ./logs/* +rm -rf /sdk-ipc/config +rm -rf /sdk-ipc/handle_policy_ids From d49366f3f7549b34ff55b2251fed51777f6abac3 Mon Sep 17 00:00:00 2001 From: Mircea Hasegan Date: Mon, 11 Nov 2024 12:21:25 +0100 Subject: [PATCH 7/9] chore(e2e): blockfrost-ryo db-sync config blockfrost-ryo needs db-sync configured with tx_out.value="consumed". https://github.com/IntersectMBO/cardano-db-sync/blob/master/doc/configuration.md#value --- .../e2e/local-network/templates/babbage/db-sync-config.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/e2e/local-network/templates/babbage/db-sync-config.json b/packages/e2e/local-network/templates/babbage/db-sync-config.json index a117060f50b..88b85c30bcf 100644 --- a/packages/e2e/local-network/templates/babbage/db-sync-config.json +++ b/packages/e2e/local-network/templates/babbage/db-sync-config.json @@ -113,6 +113,10 @@ } ], "insert_options": { - "tx_cbor": "enable" + "tx_cbor": "enable", + "tx_out": { + "value": "consumed", + "force_tx_in": true + } } } From b93e34637aec800e58de337721d183ac54fc9827 Mon Sep 17 00:00:00 2001 From: Mircea Hasegan Date: Tue, 12 Nov 2024 10:48:58 +0100 Subject: [PATCH 8/9] chore(e2e): make start local-testnet more robust Wait until first transaction is confirmed and not rolled back. Do this to mitigate possibly still boostrapping SPs. Subsequent transactions do not need it. --- .../scripts/setup-new-delegator-keys.sh | 113 +++++++++++++----- 1 file changed, 85 insertions(+), 28 deletions(-) diff --git a/packages/e2e/local-network/scripts/setup-new-delegator-keys.sh b/packages/e2e/local-network/scripts/setup-new-delegator-keys.sh index 0f634cfe451..e0f975f1f97 100755 --- a/packages/e2e/local-network/scripts/setup-new-delegator-keys.sh +++ b/packages/e2e/local-network/scripts/setup-new-delegator-keys.sh @@ -53,6 +53,53 @@ getAddressBalance() { echo ${total_balance} } +getBlockHeight() { + cardano-cli query tip --testnet-magic $NETWORK_MAGIC | jq -r '.block' +} + +submitTransactionWithRetry() { + local txFile=$1 + local retryCount=${2:-0} + local numberOfConfirmations=5 + + if [ "$retryCount" -ge 5 ]; then + echo "Transaction failed after $retryCount retries" + return 1 + fi + + cardano-cli latest transaction submit --testnet-magic $NETWORK_MAGIC --tx-file "$txFile" + + local txId=$(cardano-cli latest transaction txid --tx-file "$txFile") + + local mempoolTx="true" + while [ "$mempoolTx" == "true" ]; do + echo "Transaction is still in the mempool, waiting ${txId}" + sleep 1 + mempoolTx=$(cardano-cli latest query tx-mempool --testnet-magic $NETWORK_MAGIC tx-exists ${txId} --out-file /dev/stdout | jq -r '.exists') + done + + local initialTip=$(getBlockHeight) + local currentTip=$initialTip + local utxo="null" + while [ $(($currentTip - $initialTip)) -lt $numberOfConfirmations ]; do + sleep 1 + utxo=$(cardano-cli query utxo --tx-in "${txId}#0" --testnet-magic $NETWORK_MAGIC --out-file /dev/stdout | jq -r 'keys[0]') + if [ "$utxo" == "null" ]; then + # Transaction was rolled back + break; + fi + currentTip=$(getBlockHeight) + done + + if [ "$utxo" == "null" ]; then + echo "Transaction rolled back, retrying ${retryCount} ..." + submitTransactionWithRetry "$txFile" $((retryCount + 1)) + return $? + fi + + echo "Transaction successful ${txId}" +} + NETWORK_MAGIC=888 UTXO_DIR=network-files/utxo-keys TRANSACTIONS_DIR=network-files/transactions @@ -102,33 +149,43 @@ done # FUND OUR NEWLY CREATED ADDRESSES -stakeAddr="$(cat "${UTXO_DIR}/utxo1.addr")" -currentBalance=$(getAddressBalance "$stakeAddr") -echo "Funding stake addresses with ${AMOUNT_PER_DELEGATOR}" - for NODE_ID in ${SP_NODES_ID}; do + sourceAddr="$(cat "${UTXO_DIR}/utxo${NODE_ID}.addr")" + destAddr="$(cat ${DELEGATORS_DIR}/payment${NODE_ID}.addr)" + echo "Funding ${destAddr} with ${AMOUNT_PER_DELEGATOR}" + cardano-cli latest transaction build \ --testnet-magic $NETWORK_MAGIC \ - --tx-in "$(cardano-cli query utxo --address "$(cat "${UTXO_DIR}/utxo${NODE_ID}.addr")" --testnet-magic $NETWORK_MAGIC --out-file /dev/stdout | jq -r 'keys[0]')" \ - --tx-out "$(cat ${DELEGATORS_DIR}/payment${NODE_ID}.addr)+${AMOUNT_PER_DELEGATOR}" \ - --change-address "$(cat ${UTXO_DIR}/utxo${NODE_ID}.addr)" \ + --tx-in "$(cardano-cli query utxo --address "$sourceAddr" --testnet-magic $NETWORK_MAGIC --out-file /dev/stdout | jq -r 'keys[0]')" \ + --tx-out "${destAddr}+${AMOUNT_PER_DELEGATOR}" \ + --change-address "$sourceAddr" \ --out-file "${TRANSACTIONS_DIR}/tx${NODE_ID}.raw" - cardano-cli latest transaction sign --testnet-magic $NETWORK_MAGIC \ - --tx-body-file "${TRANSACTIONS_DIR}/tx${NODE_ID}.raw" \ - --signing-key-file "${UTXO_DIR}/utxo${NODE_ID}.skey" \ - --out-file "${TRANSACTIONS_DIR}/tx${NODE_ID}.signed" - - cardano-cli latest transaction submit \ - --testnet-magic $NETWORK_MAGIC \ - --tx-file "${TRANSACTIONS_DIR}/tx${NODE_ID}.signed" + cardano-cli latest transaction sign --testnet-magic $NETWORK_MAGIC \ + --tx-body-file "${TRANSACTIONS_DIR}/tx${NODE_ID}.raw" \ + --signing-key-file "${UTXO_DIR}/utxo${NODE_ID}.skey" \ + --out-file "${TRANSACTIONS_DIR}/tx${NODE_ID}.signed" + + if [ "$NODE_ID" -eq 1 ]; then + # This is the first transaction after startin the network. + # It usually takes a long time to be included in a block and often rolled back, so use submit with retry. + # Do not use submit with retry for regular transactions because it waits for 5 block confirmations before it returns + submitTransactionWithRetry "${TRANSACTIONS_DIR}/tx${NODE_ID}.signed" + else + cardano-cli latest transaction submit --testnet-magic $NETWORK_MAGIC --tx-file "${TRANSACTIONS_DIR}/tx${NODE_ID}.signed" + fi done -updatedBalance=$(getAddressBalance "$stakeAddr") +# Wait for funds to reach destAddr +for NODE_ID in ${SP_NODES_ID}; do + destAddr="$(cat ${DELEGATORS_DIR}/payment${NODE_ID}.addr)" -while [ "$currentBalance" -eq "$updatedBalance" ]; do - updatedBalance=$(getAddressBalance "$stakeAddr") - sleep 1 + currentBalance=$(getAddressBalance "$destAddr") + while [ "$currentBalance" -lt "$AMOUNT_PER_DELEGATOR" ]; do + echo "Waiting for funds to reach ${destAddr} ${currentBalance} < ${AMOUNT_PER_DELEGATOR}" + currentBalance=$(getAddressBalance "$destAddr") + sleep 1 + done done sleep 10 @@ -139,24 +196,26 @@ cardano-cli query utxo --whole-utxo --testnet-magic $NETWORK_MAGIC # REGISTER STAKE ADDRESSES -echo "Registering $(cat "${DELEGATORS_DIR}/payment${NODE_ID}.addr")" - keyDeposit=2000000 stakeAddr="$(cat "${DELEGATORS_DIR}/payment1.addr")" currentBalance=$(getAddressBalance "$stakeAddr") for NODE_ID in ${SP_NODES_ID}; do + stakeAddr=$(cat "${DELEGATORS_DIR}/payment${NODE_ID}.addr") + echo "Registering $stakeAddr" + cardano-cli latest stake-address registration-certificate \ --stake-verification-key-file "${DELEGATORS_DIR}/staking${NODE_ID}.vkey" \ --key-reg-deposit-amt ${keyDeposit} \ --out-file "${TRANSACTIONS_DIR}/staking${NODE_ID}reg.cert" # Wait for utxo to become available - txIn="$(cardano-cli latest query utxo --address "$(cat "${DELEGATORS_DIR}/payment${NODE_ID}.addr")" --testnet-magic $NETWORK_MAGIC --out-file /dev/stdout | jq -r 'keys[0]')"; + txIn="null"; while [ "$txIn" == "null" ]; do - echo "TxIN is null, retrying..." - txIn="$(cardano-cli latest query utxo --address "$(cat "${DELEGATORS_DIR}/payment${NODE_ID}.addr")" --testnet-magic $NETWORK_MAGIC --out-file /dev/stdout | jq -r 'keys[0]')"; - sleep 1 + echo "Waiting for ${stakeAddr} UTxO..." + txInJson="$(cardano-cli latest query utxo --address "$stakeAddr" --testnet-magic $NETWORK_MAGIC --out-file /dev/stdout)"; + txIn=$(jq -r 'keys[0]' <<< "$txInJson"); + sleep 0.1 done cardano-cli latest transaction build \ @@ -173,9 +232,7 @@ for NODE_ID in ${SP_NODES_ID}; do --signing-key-file "${DELEGATORS_DIR}/staking${NODE_ID}.skey" \ --out-file "${TRANSACTIONS_DIR}/reg-stake-tx${NODE_ID}.signed" - cardano-cli latest transaction submit \ - --testnet-magic $NETWORK_MAGIC \ - --tx-file "${TRANSACTIONS_DIR}/reg-stake-tx${NODE_ID}.signed" + cardano-cli latest transaction submit --testnet-magic $NETWORK_MAGIC --tx-file "${TRANSACTIONS_DIR}/reg-stake-tx${NODE_ID}.signed" done updatedBalance=$(getAddressBalance "$stakeAddr") From d5674cd2484080c350e63e8fa4c31327a2deaca0 Mon Sep 17 00:00:00 2001 From: Mircea Hasegan Date: Wed, 13 Nov 2024 16:49:12 +0100 Subject: [PATCH 9/9] chore: make blockfrost provider tests manual --- .github/workflows/continuous-integration-blockfrost-e2e.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/continuous-integration-blockfrost-e2e.yaml b/.github/workflows/continuous-integration-blockfrost-e2e.yaml index fab690b0d83..1f7ace78977 100644 --- a/.github/workflows/continuous-integration-blockfrost-e2e.yaml +++ b/.github/workflows/continuous-integration-blockfrost-e2e.yaml @@ -29,10 +29,7 @@ env: WS_PROVIDER_URL: 'http://localhost:4100/ws' on: - pull_request: - push: - branches: ['master'] - tags: ['*.*.*'] + workflow_dispatch: jobs: build_and_test: