Skip to content

Commit 4d3a032

Browse files
committed
Update 2025-12 - ImportHelper Script for ConwayEra
The 0x_importHelper.sh script was updated to be compatible with latest cardano-cli release 10.12.0.0. The script was also lacking the requirement to set the correct stakeaddress-deposit-fee value while generating the xxx.deleg.cert file during the import process. Also some minor changes in the calling commands for cardano-cli. Other changes: - Minimum cardano-hw-cli version is not set to 1.19.0 to be in line with the new trezor message signing functions.
1 parent b1f8d91 commit 4d3a032

File tree

5 files changed

+65
-33
lines changed

5 files changed

+65
-33
lines changed

cardano/mainnet/00_common.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ maxNodeVersion="99.99.9" #maximum allowed node version, 99.99.9 = no limit so
334334
minLedgerCardanoAppVersion=${ENV_MINLEDGERCARDANOAPPVERSION:-"7.1.4"} #minimum version for the cardano-app on the Ledger HW-Wallet
335335
minTrezorCardanoAppVersion="2.7.2" #minimum version for the firmware on the Trezor HW-Wallet
336336
minKeystoneCardanoAppVersion="1.7.7" #minimum version for the firmware on the Keystone HW-Wallet
337-
minHardwareCliVersion="1.18.2" #minimum version for the cardano-hw-cli
337+
minHardwareCliVersion="1.19.0" #minimum version for the cardano-hw-cli
338338
minCardanoSignerVersion="1.27.0" #minimum version for the cardano-signer binary
339339
minCatalystToolboxVersion="0.5.0" #minimum version for the catalyst-toolbox binary
340340

cardano/mainnet/0x_importHelper.sh

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ importNodeSkey() {
288288

289289
#Generate the pairing Vkey file from the Skey file
290290
echo -ne "\e[0mGenerating file '\e[32m${poolName}/${poolName}.node.vkey\e[0m' ... " >&2;
291-
${cardanocli} key verification-key --signing-key-file "${poolName}/${poolName}.node.skey" --verification-key-file "${poolName}/${poolName}.node.vkey"; checkError "$?"; if [ $? -ne 0 ]; then exit $?; fi
291+
${cardanocli} ${cliEra} key verification-key --signing-key-file "${poolName}/${poolName}.node.skey" --verification-key-file "${poolName}/${poolName}.node.vkey"; checkError "$?"; if [ $? -ne 0 ]; then exit $?; fi
292292
file_lock "${poolName}/${poolName}.node.vkey"
293293
echo -e "\e[32mOK\e[0m" >&2;
294294

@@ -298,7 +298,7 @@ importNodeSkey() {
298298
poolNodeCounter=$((${poolNodeCounter}+1))
299299
echo -e "\e[0mNew OpCertCounter for this import: \e[32m${poolNodeCounter}\e[0m" >&2;
300300
echo -ne "\e[0mGenerating file '\e[32m${poolName}/${poolName}.node.counter\e[0m' ... " >&2;
301-
${cardanocli} node new-counter --cold-verification-key-file "${poolName}/${poolName}.node.vkey" --counter-value ${poolNodeCounter} --operational-certificate-issue-counter-file "${poolName}/${poolName}.node.counter"
301+
${cardanocli} ${cliEra} node new-counter --cold-verification-key-file "${poolName}/${poolName}.node.vkey" --counter-value ${poolNodeCounter} --operational-certificate-issue-counter-file "${poolName}/${poolName}.node.counter"
302302
checkError "$?"; if [ $? -ne 0 ]; then exit $?; fi
303303
#NodeCounter file was written, now add the description in the file to reflect the next node counter number
304304
newCounterJSON=$(jq ".description = \"Next certificate issue number: ${poolNodeCounter}\"" < "${poolName}/${poolName}.node.counter")
@@ -339,8 +339,8 @@ importVrfSkey() {
339339
if [[ ! "$(jq -r .type $1)" == *"SigningKey"* ]]; then echo -e "\n\e[35mERROR - \"$1\" is not a valid vrf.skey file.\e[0m\n" >&2; exit 1; fi;
340340

341341
#Probe the given VRF key hash with the one that is online
342-
newVRFstring=$(${cardanocli} key verification-key --signing-key-file "${1}" --verification-key-file /dev/stdout | jq -r .cborHex) #the maybe new vrf string
343-
newVRFhash=$(${cardanocli} node key-hash-VRF --verification-key "${newVRFstring:4}") #crop the first 4 chars before handing over the string
342+
newVRFstring=$(${cardanocli} ${cliEra} key verification-key --signing-key-file "${1}" --verification-key-file /dev/stdout | jq -r .cborHex) #the maybe new vrf string
343+
newVRFhash=$(${cardanocli} ${cliEra} node key-hash-VRF --verification-key "${newVRFstring:4}") #crop the first 4 chars before handing over the string
344344
oldVRFhash=$(jq -r ".vrf_key_hash" 2> /dev/null <<< ${importJSON} )
345345
if [[ ! "${newVRFhash}" == "${oldVRFhash}" ]]; then echo -e "\n\e[35mWARNING - VRF KeyHash does not match up with the one that is online right now!\e[0m\n" >&2; exit 1; fi;
346346

@@ -353,7 +353,7 @@ importVrfSkey() {
353353

354354
#Generate the pairing Vkey file from the Skey file
355355
echo -ne "\e[0mGenerating file '\e[32m${poolName}/${poolName}.vrf.vkey\e[0m' ... " >&2;
356-
${cardanocli} key verification-key --signing-key-file "${poolName}/${poolName}.vrf.skey" --verification-key-file "${poolName}/${poolName}.vrf.vkey"; checkError "$?"; if [ $? -ne 0 ]; then exit $?; fi
356+
${cardanocli} ${cliEra} key verification-key --signing-key-file "${poolName}/${poolName}.vrf.skey" --verification-key-file "${poolName}/${poolName}.vrf.vkey"; checkError "$?"; if [ $? -ne 0 ]; then exit $?; fi
357357
file_lock ${poolName}/${poolName}.vrf.vkey
358358
echo -e "\e[32mOK\e[0m\n" >&2;
359359

@@ -394,12 +394,12 @@ importPaymentSkey() {
394394

395395
#Generate the pairing Vkey file from the Skey file
396396
echo -ne "\t\e[0mGenerating file '\e[32m${poolName}/${ownerName}.payment.vkey\e[0m' ... " >&2;
397-
${cardanocli} key verification-key --signing-key-file "${poolName}/${ownerName}.payment.skey" --verification-key-file "${poolName}/${ownerName}.payment.vkey"; checkError "$?"; if [ $? -ne 0 ]; then exit $?; fi
397+
${cardanocli} ${cliEra} key verification-key --signing-key-file "${poolName}/${ownerName}.payment.skey" --verification-key-file "${poolName}/${ownerName}.payment.vkey"; checkError "$?"; if [ $? -ne 0 ]; then exit $?; fi
398398

399399
#If the verification key is an extended one, convert it into a non-extended one
400400
tmp=$(jq -r .type "${poolName}/${ownerName}.payment.vkey" 2> /dev/null)
401401
if [[ "${tmp^^}" == *"EXTENDED"* ]]; then
402-
${cardanocli} key non-extended-key --extended-verification-key-file "${poolName}/${ownerName}.payment.vkey" --verification-key-file "${poolName}/${ownerName}.payment.vkey";
402+
${cardanocli} ${cliEra} key non-extended-key --extended-verification-key-file "${poolName}/${ownerName}.payment.vkey" --verification-key-file "${poolName}/${ownerName}.payment.vkey";
403403
checkError "$?"; if [ $? -ne 0 ]; then exit $?; fi;
404404
fi
405405

@@ -430,12 +430,12 @@ importStakingSkey() {
430430

431431
#Generate the pairing Vkey file from the Skey file
432432
echo -ne "\t\e[0mGenerating file '\e[32m${poolName}/${ownerName}.staking.vkey\e[0m' ... " >&2;
433-
${cardanocli} key verification-key --signing-key-file "${poolName}/${ownerName}.staking.skey" --verification-key-file "${poolName}/${ownerName}.staking.vkey"; checkError "$?"; if [ $? -ne 0 ]; then exit $?; fi
433+
${cardanocli} ${cliEra} key verification-key --signing-key-file "${poolName}/${ownerName}.staking.skey" --verification-key-file "${poolName}/${ownerName}.staking.vkey"; checkError "$?"; if [ $? -ne 0 ]; then exit $?; fi
434434

435435
#If the verification key is an extended one, convert it into a non-extended one
436436
tmp=$(jq -r .type "${poolName}/${ownerName}.staking.vkey" 2> /dev/null)
437437
if [[ "${tmp^^}" == *"EXTENDED"* ]]; then
438-
${cardanocli} key non-extended-key --extended-verification-key-file "${poolName}/${ownerName}.staking.vkey" --verification-key-file "${poolName}/${ownerName}.staking.vkey";
438+
${cardanocli} ${cliEra} key non-extended-key --extended-verification-key-file "${poolName}/${ownerName}.staking.vkey" --verification-key-file "${poolName}/${ownerName}.staking.vkey";
439439
checkError "$?"; if [ $? -ne 0 ]; then exit $?; fi;
440440
fi
441441

@@ -491,29 +491,39 @@ while [[ ! "${ownerName}" == "" ]]; do
491491

492492
#Building a Payment Address
493493
echo -ne "\t\e[0mGenerating file '\e[32m${poolName}/${ownerName}.payment.addr\e[0m' ... ";
494-
${cardanocli} address build --payment-verification-key-file "${poolName}/${ownerName}.payment.vkey" --staking-verification-key-file "${poolName}/${ownerName}.staking.vkey" ${addrformat} > "${poolName}/${ownerName}.payment.addr"
494+
${cardanocli} ${cliEra} address build --payment-verification-key-file "${poolName}/${ownerName}.payment.vkey" --staking-verification-key-file "${poolName}/${ownerName}.staking.vkey" ${addrformat} > "${poolName}/${ownerName}.payment.addr"
495495
checkError "$?"; if [ $? -ne 0 ]; then exit $?; fi
496496
file_lock "${poolName}/${ownerName}.payment.addr"
497497
echo -e "\e[32mOK\e[0m";
498498

499499
#Building a Staking Address
500500
echo -ne "\t\e[0mGenerating file '\e[32m${poolName}/${ownerName}.staking.addr\e[0m' ... ";
501-
${cardanocli} stake-address build --staking-verification-key-file "${poolName}/${ownerName}.staking.vkey" ${addrformat} > "${poolName}/${ownerName}.staking.addr"
501+
${cardanocli} ${cliEra} stake-address build --staking-verification-key-file "${poolName}/${ownerName}.staking.vkey" ${addrformat} > "${poolName}/${ownerName}.staking.addr"
502502
checkError "$?"; if [ $? -ne 0 ]; then exit $?; fi
503503
file_lock "${poolName}/${ownerName}.staking.addr"
504504
echo -e "\e[32mOK\e[0m";
505505

506506
#Create an address registration certificate
507-
echo -ne "\t\e[0mGenerating file '\e[32m${poolName}/${ownerName}.staking.cert\e[0m' ... ";
508-
${cardanocli} stake-address registration-certificate --staking-verification-key-file "${poolName}/${ownerName}.staking.vkey" --out-file "${poolName}/${ownerName}.staking.cert"
507+
#Read ProtocolParameters
508+
case ${workMode} in
509+
"online") protocolParametersJSON=$(${cardanocli} ${cliEra} query protocol-parameters);; #onlinemode
510+
"light") protocolParametersJSON=${lightModeParametersJSON};; #lightmode
511+
"offline") readOfflineFile; #Reads the offlinefile into the offlineJSON variable
512+
protocolParametersJSON=$(jq ".protocol.parameters" <<< ${offlineJSON});; #offlinemode
513+
esac
514+
checkError "$?"; if [ $? -ne 0 ]; then exit $?; fi
515+
#Lets use the currently set keyDeposit amount
516+
stakeAddressDepositFee=$(jq -r .stakeAddressDeposit <<< ${protocolParametersJSON})
517+
echo -ne "\t\e[0mGenerating file '\e[32m${poolName}/${ownerName}.staking.cert\e[0m' with ${stakeAddressDepositFee} lovelace deposit fee ... ";
518+
${cardanocli} ${cliEra} stake-address registration-certificate --staking-verification-key-file "${poolName}/${ownerName}.staking.vkey" --key-reg-deposit-amt "${stakeAddressDepositFee}" --out-file "${poolName}/${ownerName}.staking.cert"
509519
checkError "$?"; if [ $? -ne 0 ]; then exit $?; fi
510520
file_lock "${poolName}/${ownerName}.staking.cert"
511521
echo -e "\e[32mOK\e[0m";
512522

513523
#Create the delegation certificate to this pool
514524
if [ -f "${poolName}/${poolName}.node.vkey" ] && [ -f "${poolName}/${ownerName}.staking.vkey" ]; then
515525
echo -ne "\t\e[0mGenerating file '\e[32m${poolName}/${ownerName}.deleg.cert\e[0m' ... ";
516-
${cardanocli} stake-address delegation-certificate --stake-verification-key-file "${poolName}/${ownerName}.staking.vkey" --cold-verification-key-file "${poolName}/${poolName}.node.vkey" --out-file "${poolName}/${ownerName}.deleg.cert"
526+
${cardanocli} ${cliEra} stake-address stake-delegation-certificate --stake-verification-key-file "${poolName}/${ownerName}.staking.vkey" --cold-verification-key-file "${poolName}/${poolName}.node.vkey" --out-file "${poolName}/${ownerName}.deleg.cert"
517527
checkError "$?"; if [ $? -ne 0 ]; then exit $?; fi
518528
file_lock "${poolName}/${ownerName}.deleg.cert"
519529
echo -e "\e[32mOK\e[0m";

cardano/mainnet/sha256sum_sposcripts.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
577f23191b6adf251bf5a691d1ae6e42851f488ceb5bf6c112b5e8564efaadd4 00_common.sh
1+
bae3604732da0b3c54872adbeb78f7962f73dffb872b220a18868ac358a67c80 00_common.sh
22
3f5685d008f29a31085082f72670de881ecb89b7c549b260e1a0771bd6c69ecf 01_claimRewards.sh
33
8f98ef3f0983ed12ba714390b9a528ccf06b41f51dfcd1d52c50d86f038455c8 01_protectKey.sh
44
0bf24a499ccc8f6665cc9b5b2e40f8af3f653656b23cd5e3eb99e27ac9279678 01_queryAddress.sh
@@ -25,7 +25,7 @@ f6cc27f6f8ad0f1714c271a97b9ed5f7c655ceaf82a92f57e26d1231e9017413 06_regDelegati
2525
f37a0edc7816884e9ad79cd5200017b7acccdc01b7ba5c2402ef09903601b078 08a_genStakingAddrRetireCert.sh
2626
d3eb0567ef878e6cea9d34bd96f4a62eaee8b207cf3a43f3b79ce6f08f7d7e35 08b_deregStakingAddrCert.sh
2727
8796e9d0c061982ea91e58d2a9644a88aa5f64c33efbb6a96df9a158c5ee59b9 09a_catalystVote.sh
28-
3034f216530fb9f8500dc5080dc5011269fe62f6c972e624cf997c8580fa0948 0x_importHelper.sh
28+
c53c3c3da63a07738652e0a7aad7f6eebe0999948307ae26a67aca2985eeaaf5 0x_importHelper.sh
2929
c419a6ba2b60619d09fde60b6709ea9d60550048c358ab3773565d2ba7a1b8bd 10_genPolicy.sh
3030
6dcee638d97cb9ad859eb464cf0194ef11521102fdfb5492b4b06d84498265bb 11a_mintAsset.sh
3131
852d63be0b4985a974c295ca073b8d8bfd7d84118d739730005fba6ec19fc99b 11b_burnAsset.sh

cardano/testnet/00_common.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ maxNodeVersion="99.99.9" #maximum allowed node version, 99.99.9 = no limit so
334334
minLedgerCardanoAppVersion=${ENV_MINLEDGERCARDANOAPPVERSION:-"7.1.4"} #minimum version for the cardano-app on the Ledger HW-Wallet
335335
minTrezorCardanoAppVersion="2.7.2" #minimum version for the firmware on the Trezor HW-Wallet
336336
minKeystoneCardanoAppVersion="1.7.7" #minimum version for the firmware on the Keystone HW-Wallet
337-
minHardwareCliVersion="1.18.2" #minimum version for the cardano-hw-cli
337+
minHardwareCliVersion="1.19.0" #minimum version for the cardano-hw-cli
338338
minCardanoSignerVersion="1.27.0" #minimum version for the cardano-signer binary
339339
minCatalystToolboxVersion="0.5.0" #minimum version for the catalyst-toolbox binary
340340

0 commit comments

Comments
 (0)