Skip to content

Commit

Permalink
Mainnet Conway - node 9.0.0
Browse files Browse the repository at this point in the history
# Mainnet Release for Conway-Era and Cardano-Node 9.0.0

NOTICE-1: For Ledger HW-Wallet users, at the time of the commit, the Cardano-App 7.1.x for Ledger release was still pending. However, you can load it anyway via Ledger-Live by going into the Settings -> Experimental Features -> My Ledger Provider = 3

NOTICE-2: This commit is only a subset of updated scripts for conway era. The governance scripts (starting with 2*.sh) will be published into the mainnet folder once the light-mode is also working with koios support.

Some of the changes:

- Min. Node- and CLI-Version is now 9.0.0
- The requirement for 'curl' is removed in offline-mode
- The currentEpoch offline calculation was corrected to support unusual byron-era epoch/slot lengths
- The currentSlot/Tip offline calculation was corrected to support unusual byron-era epoch/slot lengths
- Parameter Support added for .coinsPerUTxOByte
- Added offline support for governance

- 01_clainRewards.sh updated fee calculation
- 01_protectKey.sh can encrypt/decrypt DRep and CC-Hot/CC-Cold keys
- 01_queryAddress.sh now shows a DRep delegation for stake accounts
- 01_sendAssets.sh updated fee calculation
- 01_sendLovelaves.sh updated fee calculation
- 01_workOffline.sh now supports DRep entries and takes care of last action IDs and the constitution values
- 03b_regStakingAddrCert.sh now also signs the tx with the staking.skey, thats a new requirement for conway-era
- 03c_checkStakingAddrOnChain.sh now also shows a DRep delegation
- 04e_checkNodeOpCert.sh added errorcheck for onDiekKESStart
- 05c_regStakepoolCert.sh enhanced error message if there is no xxx.pool.json file present
- 05c_regStakepoolCert.sh updated fee calculation
- 06_regDelegationCert.sh updated fee calculation
- 07b_deregStakepoolCert.sh updated fee calculation
- 08b_deregStakingAddrCert.sh udpated fee calculation
- 09a_catalystVoteF10.sh was removed, the normal 09a_catalystVote.sh can be used
- 11a_mintAsset.sh updated fee calculation
- 11b_burnAsset.sh updated fee calculation
- 12b_checkAssetMetaServer.sh better error handling if there was no data found on the metadata server
- 13a_spoPoll.sh and 13b_sendSpoPoll.sh was removed, will be done via governance info-actions in the future

- cardano-signer version bumped to v1.16.1
- README.md updated with the new minimum versions
  • Loading branch information
gitmachtl committed Jul 14, 2024
1 parent eb49587 commit a584986
Show file tree
Hide file tree
Showing 39 changed files with 902 additions and 1,669 deletions.
168 changes: 109 additions & 59 deletions cardano/mainnet/00_common.sh

Large diffs are not rendered by default.

20 changes: 16 additions & 4 deletions cardano/mainnet/01_claimRewards.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
#!/bin/bash

# Script is brought to you by ATADA Stakepool, Telegram @atada_stakepool
############################################################
# _____ ____ ____ _____ _ __
# / ___// __ \/ __ \ / ___/__________(_)___ / /______
# \__ \/ /_/ / / / / \__ \/ ___/ ___/ / __ \/ __/ ___/
# ___/ / ____/ /_/ / ___/ / /__/ / / / /_/ / /_(__ )
# /____/_/ \____/ /____/\___/_/ /_/ .___/\__/____/
# /_/
#
# Scripts are brought to you by Martin L. (ATADA Stakepool)
# Telegram: @atada_stakepool Github: github.com/gitmachtl
#
############################################################

#load variables and functions from common.sh
. "$(dirname "$0")"/00_common.sh
Expand Down Expand Up @@ -554,10 +565,11 @@ if [[ ${rxcnt} == 1 ]]; then
${cardanocli} ${cliEra} transaction build-raw ${txInString} --tx-out "${sendFromAddr}+${totalLovelaces}${assetsOutString}" --tx-out ${sendToAddr}+${rewardsSum} --invalid-hereafter ${ttl} --fee 200000 ${metafileParameter} --withdrawal ${withdrawal} --out-file ${txBodyFile}
checkError "$?"; if [ $? -ne 0 ]; then exit $?; fi
fi
fee=$(${cardanocli} ${cliEra} transaction calculate-min-fee --tx-body-file ${txBodyFile} --protocol-params-file <(echo ${protocolParametersJSON}) --tx-in-count ${txcnt} --tx-out-count ${rxcnt} --witness-count 2 | awk '{ print $1 }')

#cardano-cli new fee calculation
#fee=$(${cardanocli} ${cliEra} transaction calculate-min-fee --tx-body-file ${txBodyFile} --protocol-params-file <(echo ${protocolParametersJSON}) --witness-count 2 | awk '{ print $1 }')
#calculate the transaction fee. new parameters since cardano-cli 8.21.0
fee=$(${cardanocli} ${cliEra} transaction calculate-min-fee --tx-body-file ${txBodyFile} --protocol-params-file <(echo ${protocolParametersJSON}) --witness-count 2 --reference-script-size 0 2> /dev/stdout)
if [ $? -ne 0 ]; then echo -e "\n\e[35m${fee}\e[0m\n"; exit 1; fi
fee=${fee%% *} #only get the first part of 'xxxxxx Lovelaces'

echo -e "\e[0mMimimum transfer Fee for ${txcnt}x TxIn & ${rxcnt}x TxOut & Withdrawal: \e[32m $(convertToADA ${fee}) ADA / ${fee} lovelaces \e[90m"

Expand Down
16 changes: 15 additions & 1 deletion cardano/mainnet/01_protectKey.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
#!/bin/bash

# Script is brought to you by ATADA Stakepool, Telegram @atada_stakepool
############################################################
# _____ ____ ____ _____ _ __
# / ___// __ \/ __ \ / ___/__________(_)___ / /______
# \__ \/ /_/ / / / / \__ \/ ___/ ___/ / __ \/ __/ ___/
# ___/ / ____/ /_/ / ___/ / /__/ / / / /_/ / /_(__ )
# /____/_/ \____/ /____/\___/_/ /_/ .___/\__/____/
# /_/
#
# Scripts are brought to you by Martin L. (ATADA Stakepool)
# Telegram: @atada_stakepool Github: github.com/gitmachtl
#
############################################################

#load variables and functions from common.sh
. "$(dirname "$0")"/00_common.sh
Expand All @@ -16,6 +27,9 @@ Usage: $(basename $0) <ENC|ENCRYPT|DEC|DECRYPT> <Name of SKEY-File>
Example: $(basename $0) enc mywallet ... Encrypts the mywallet.skey file
$(basename $0) enc owner.payment ... Encrypts the owner.payment.skey file
$(basename $0) enc mypool.node.skey ... Encrypts the mypool.node.skey file
$(basename $0) enc mydrep.drep ... Encrypts the mydrep.drep.skey file
$(basename $0) enc mycom.cc-hot.skey ... Encrypts the mycom.cc-hot.skey file
$(basename $0) dec mywallet ... Decrypts the mywallet.skey file
$(basename $0) dec owner.staking ... Decrypts the owner.staking.skey file
Expand Down
51 changes: 50 additions & 1 deletion cardano/mainnet/01_queryAddress.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
#!/bin/bash

# Script is brought to you by ATADA Stakepool, Telegram @atada_stakepool
############################################################
# _____ ____ ____ _____ _ __
# / ___// __ \/ __ \ / ___/__________(_)___ / /______
# \__ \/ /_/ / / / / \__ \/ ___/ ___/ / __ \/ __/ ___/
# ___/ / ____/ /_/ / ___/ / /__/ / / / /_/ / /_(__ )
# /____/_/ \____/ /____/\___/_/ /_/ .___/\__/____/
# /_/
#
# Scripts are brought to you by Martin L. (ATADA Stakepool)
# Telegram: @atada_stakepool Github: github.com/gitmachtl
#
############################################################

#load variables and functions from common.sh
. "$(dirname "$0")"/00_common.sh
Expand Down Expand Up @@ -227,6 +238,8 @@ elif [[ ${typeOfAddr} == ${addrTypeStake} ]]; then #Staking Address

esac

# jq -r . <<< ${rewardsJSON}

rewardsEntryCnt=$(jq -r 'length' <<< ${rewardsJSON})

if [[ ${rewardsEntryCnt} == 0 ]]; then echo -e "\e[35mStaking Address is not on the chain, register it first !\e[0m\n"; exit 1;
Expand All @@ -242,6 +255,8 @@ elif [[ ${typeOfAddr} == ${addrTypeStake} ]]; then #Staking Address

delegationPoolID=$(jq -r ".[${tmpCnt}].delegation // .[${tmpCnt}].stakeDelegation" <<< ${rewardsJSON})

drepDelegationHASH=$(jq -r ".[${tmpCnt}].voteDelegation // \"notSet\"" <<< ${rewardsJSON})

rewardsSum=$((${rewardsSum}+${rewardsAmount}))
rewardsSumInADA=$(bc <<< "scale=6; ${rewardsSum} / 1000000")

Expand Down Expand Up @@ -295,6 +310,40 @@ elif [[ ${typeOfAddr} == ${addrTypeStake} ]]; then #Staking Address

fi

#Show the current status of the voteDelegation
case ${drepDelegationHASH} in
"alwaysNoConfidence")
#always-no-confidence
echo -e " \t\e[0mVoting-Power of Staking Address is currently set to: \e[94mALWAYS NO CONFIDENCE\e[0m\n";
;;

"alwaysAbstain")
#always-abstain
echo -e " \t\e[0mVoting-Power of Staking Address is currently set to: \e[94mALWAYS ABSTAIN\e[0m\n";
;;

"notSet")
#no votingpower delegated
echo -e " \t\e[0mVoting-Power of Staking Address is not delegated to a DRep !\e[0m\n";
;;

*)
#normal drep-id or drep-script-id
case "${drepDelegationHASH%%-*}" in
"keyHash") drepDelegationID=$(${bech32_bin} "drep" <<< "${drepDelegationHASH##*-}" 2> /dev/null)
echo -e " \t\e[0mVoting-Power of Staking Address is delegated to DRepID(HASH): \e[32m${drepDelegationID}\e[0m (\e[94m${drepDelegationHASH##*-}\e[0m)\n";
;;
"scriptHash") drepDelegationID=$(${bech32_bin} "drep_script" <<< "${drepDelegationHASH##*-}" 2> /dev/null)
echo -e " \t\e[0mVoting-Power of Staking Address is delegated to DRep-Script-ID(HASH): \e[32m${drepDelegationID}\e[0m (\e[94m${drepDelegationHASH##*-}\e[0m)\n";
;;
*) #unknown type
echo -e " \t\e[0mVoting-Power of Staking Address is delegated to DRep-HASH: \e[32m${drepDelegationHASH}\e[0m\n";
;;
esac
;;

esac

echo

done
Expand Down
24 changes: 18 additions & 6 deletions cardano/mainnet/01_sendAssets.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
#!/bin/bash

# Script is brought to you by ATADA Stakepool, Telegram @atada_stakepool
############################################################
# _____ ____ ____ _____ _ __
# / ___// __ \/ __ \ / ___/__________(_)___ / /______
# \__ \/ /_/ / / / / \__ \/ ___/ ___/ / __ \/ __/ ___/
# ___/ / ____/ /_/ / ___/ / /__/ / / / /_/ / /_(__ )
# /____/_/ \____/ /____/\___/_/ /_/ .___/\__/____/
# /_/
#
# Scripts are brought to you by Martin L. (ATADA Stakepool)
# Telegram: @atada_stakepool Github: github.com/gitmachtl
#
############################################################

#load variables and functions from common.sh
. "$(dirname "$0")"/00_common.sh
Expand Down Expand Up @@ -662,13 +673,14 @@ if [[ ${lovelacesToSend} -lt ${minOutUTXO} ]]; then lovelacesToSend=${minOutUTXO
txBodyFile="${tempDir}/dummy.txbody"
rm ${txBodyFile} 2> /dev/null
dummyReturnAmount=$(( ${totalLovelaces} - ${lovelacesToSend} ))
${cardanocli} ${cliEra} transaction build-raw ${txInString} --tx-out "${sendToAddr}+${lovelacesToSend}${assetsSendString}" --tx-out "${sendToAddr}+${dummyReturnAmount}${assetsReturnString}" --invalid-hereafter ${ttl} --fee 200000 ${metafileParameter} --out-file ${txBodyFile}
checkError "$?"; if [ $? -ne 0 ]; then exit $?; fi
fee=$(${cardanocli} ${cliEra} transaction calculate-min-fee --tx-body-file ${txBodyFile} --protocol-params-file <(echo ${protocolParametersJSON}) --tx-in-count ${txcnt} --tx-out-count ${rxcnt} --witness-count 1 | awk '{ print $1 }')
#cardano-cli new fee calculation
#fee=$(${cardanocli} ${cliEra} transaction calculate-min-fee --tx-body-file ${txBodyFile} --protocol-params-file <(echo ${protocolParametersJSON}) --witness-count 1 | awk '{ print $1 }')
${cardanocli} ${cliEra} transaction build-raw ${txInString} --tx-out "${sendToAddr}+${lovelacesToSend}${assetsSendString}" --tx-out "${sendFromAddr}+${dummyReturnAmount}${assetsReturnString}" --invalid-hereafter ${ttl} --fee 200000 ${metafileParameter} --out-file ${txBodyFile}
checkError "$?"; if [ $? -ne 0 ]; then exit $?; fi

#calculate the transaction fee. new parameters since cardano-cli 8.21.0
fee=$(${cardanocli} ${cliEra} transaction calculate-min-fee --tx-body-file ${txBodyFile} --protocol-params-file <(echo ${protocolParametersJSON}) --witness-count 1 --reference-script-size 0 2> /dev/stdout)
if [ $? -ne 0 ]; then echo -e "\n\e[35m${fee}\e[0m\n"; exit 1; fi
fee=${fee%% *} #only get the first part of 'xxxxxx Lovelaces'

echo -e "\e[0mMinimum Transaction Fee for ${txcnt}x TxIn & ${rxcnt}x TxOut: \e[32m $(convertToADA ${fee}) ADA / ${fee} lovelaces \e[90m"
#
# Set the right amount of lovelacesToSend, lovelacesToReturn and also check about sendinglimits like minOutUTXO for returning assets if available
Expand Down
35 changes: 27 additions & 8 deletions cardano/mainnet/01_sendLovelaces.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
#!/bin/bash

# Script is brought to you by ATADA Stakepool, Telegram @atada_stakepool
############################################################
# _____ ____ ____ _____ _ __
# / ___// __ \/ __ \ / ___/__________(_)___ / /______
# \__ \/ /_/ / / / / \__ \/ ___/ ___/ / __ \/ __/ ___/
# ___/ / ____/ /_/ / ___/ / /__/ / / / /_/ / /_(__ )
# /____/_/ \____/ /____/\___/_/ /_/ .___/\__/____/
# /_/
#
# Scripts are brought to you by Martin L. (ATADA Stakepool)
# Telegram: @atada_stakepool Github: github.com/gitmachtl
#
############################################################

#load variables and functions from common.sh
. "$(dirname "$0")"/00_common.sh
Expand Down Expand Up @@ -413,7 +424,7 @@ fi

#Read ProtocolParameters
case ${workMode} in
"online") protocolParametersJSON=$(${cardanocli} ${cliEra} query protocol-parameters);; #onlinemode
"online") protocolParametersJSON=$(${cardanocli} ${cliEra} query protocol-parameters );; #onlinemode
"light") protocolParametersJSON=${lightModeParametersJSON};; #lightmode
"offline") protocolParametersJSON=$(jq ".protocol.parameters" <<< ${offlineJSON});; #offlinemode
esac
Expand All @@ -434,6 +445,7 @@ case "${lovelacesToSend}" in
rxcnt=2; #assets on the address, they must be sent back to the source
dummySendAmount="${totalLovelaces}"
dummyReturnAmount=$(calc_minOutUTXO "${protocolParametersJSON}" "${sendToAddr}+1000000${assetsOutString}")
checkError "$?"; if [ $? -ne 0 ]; then exit $?; fi
else
rxcnt=1; #no assets on the address
fi;;
Expand All @@ -459,16 +471,15 @@ if [[ ${rxcnt} == 1 ]]; then #Sending ALLFUNDS or sending ALL lovelaces and no
checkError "$?"; if [ $? -ne 0 ]; then exit $?; fi
else #Sending chosen amount of lovelaces or ALL lovelaces but return the assets to the address
#a fee of 200000 lovelaces was choosen to produce a 5byte cbor representation, like any value between 65536 and 4294967296 lovelaces
${cardanocli} ${cliEra} transaction build-raw ${txInString} --tx-out "${sendToAddr}+${dummyReturnAmount}${assetsOutString}" --tx-out ${sendToAddr}+${dummySendAmount} --invalid-hereafter ${ttl} --fee 200000 ${metafileParameter} --out-file ${txBodyFile}
${cardanocli} ${cliEra} transaction build-raw ${txInString} --tx-out "${sendFromAddr}+${dummyReturnAmount}${assetsOutString}" --tx-out "${sendToAddr}+${dummySendAmount}" --invalid-hereafter ${ttl} --fee 200000 ${metafileParameter} --out-file ${txBodyFile}
checkError "$?"; if [ $? -ne 0 ]; then exit $?; fi
fi

#cardano-cli 8.17 and below
fee=$(${cardanocli} ${cliEra} transaction calculate-min-fee --tx-body-file ${txBodyFile} --protocol-params-file <(echo ${protocolParametersJSON}) --tx-in-count ${txcnt} --tx-out-count ${rxcnt} --witness-count 1 | awk '{ print $1 }')
#calculate the transaction fee. new parameters since cardano-cli 8.21.0
fee=$(${cardanocli} ${cliEra} transaction calculate-min-fee --tx-body-file ${txBodyFile} --protocol-params-file <(echo ${protocolParametersJSON}) --witness-count 1 --reference-script-size 0 2> /dev/stdout)
if [ $? -ne 0 ]; then echo -e "\n\e[35m${fee}\e[0m\n"; exit 1; fi
fee=${fee%% *} #only get the first part of 'xxxxxx Lovelaces'

#cardano-cli with the new fee calculation
#fee=$(${cardanocli} ${cliEra} transaction calculate-min-fee --tx-body-file ${txBodyFile} --protocol-params-file <(echo ${protocolParametersJSON}) --witness-count 1 | awk '{ print $1 }')
checkError "$?"; if [ $? -ne 0 ]; then exit $?; fi

echo -e "\e[0mMinimum Transaction Fee for ${txcnt}x TxIn & ${rxcnt}x TxOut: \e[32m $(convertToADA ${fee}) ADA / ${fee} lovelaces \e[90m"
echo
Expand All @@ -482,6 +493,7 @@ case "${lovelacesToSend}" in
"ALLFUNDS" ) #If keyword ALLFUNDS was used, send all lovelaces and all assets to the destination address - rxcnt=1
lovelacesToSend=$(( ${totalLovelaces} - ${fee} ))
minOutUTXO=$(calc_minOutUTXO "${protocolParametersJSON}" "${sendToAddr}+1000000${assetsOutString}")
checkError "$?"; if [ $? -ne 0 ]; then exit $?; fi
echo -e "\e[0mLovelaces to send to ${showToAddr}: \e[33m ${lovelacesToSend} lovelaces \e[90m"
if [[ ${lovelacesToSend} -lt ${minOutUTXO} ]]; then echo -e "\e[35mNot enough funds on the source Addr! Minimum UTXO value is ${minOutUTXO} lovelaces.\e[0m"; exit 1; fi
if [[ ${totalAssetsCnt} -gt 0 ]]; then #assets are also send completly over, so display them
Expand All @@ -501,6 +513,7 @@ case "${lovelacesToSend}" in
if [[ ${totalAssetsCnt} -gt 0 ]]; then
#assets on the address, they must be sent back to the source address with the minOutUTXO amount of lovelaces, rxcnt=2
minOutUTXO=$(calc_minOutUTXO "${protocolParametersJSON}" "${sendFromAddr}+1000000${assetsOutString}")
checkError "$?"; if [ $? -ne 0 ]; then exit $?; fi
lovelacesToSend=$(( ${totalLovelaces} - ${fee} - ${minOutUTXO} )) #so send less over to
lovelacesToReturn=${minOutUTXO} #minimum amount to return all the assets to the source address
echo -e "\e[0mLovelaces to send to ${showToAddr}: \e[33m $(convertToADA ${lovelacesToSend}) ADA / ${lovelacesToSend} lovelaces \e[90m"
Expand All @@ -509,13 +522,15 @@ case "${lovelacesToSend}" in
else
#no assets on the address, so just send over all the lovelaces, rxcnt=1
minOutUTXO=$(calc_minOutUTXO "${protocolParametersJSON}" "${sendToAddr}+1000000")
checkError "$?"; if [ $? -ne 0 ]; then exit $?; fi
lovelacesToSend=$(( ${totalLovelaces} - ${fee} ))
echo -e "\e[0mLovelaces to send to ${showToAddr}: \e[33m $(convertToADA ${lovelacesToSend}) ADA / ${lovelacesToSend} lovelaces \e[90m"
if [[ ${lovelacesToSend} -lt ${minOutUTXO} ]]; then echo -e "\e[35mNot enough funds on the source Addr! Minimum UTXO value is ${minOutUTXO} lovelaces.\e[0m"; exit 1; fi
fi;;

"MIN" ) #If keyword MIN was used, send just the minimal possible amount of lovelces to the destination address, rest will be returned to the source address, rxcnt=2
minOutUTXO=$(calc_minOutUTXO "${protocolParametersJSON}" "${sendToAddr}+1000000")
checkError "$?"; if [ $? -ne 0 ]; then exit $?; fi
lovelacesToSend=${minOutUTXO}
echo -e "\e[0mLovelaces to send to ${showToAddr}: \e[33m $(convertToADA ${lovelacesToSend}) ADA / ${lovelacesToSend} lovelaces \e[90m"
lovelacesToReturn=$(( ${totalLovelaces} - ${fee} - ${lovelacesToSend} ))
Expand All @@ -529,6 +544,7 @@ case "${lovelacesToSend}" in

* ) #If no keyword was used, its just the amount of lovelacesToSend to the destination address, rest will be returned to the source address, rxcnt=2
minOutUTXO=$(calc_minOutUTXO "${protocolParametersJSON}" "${sendToAddr}+1000000")
checkError "$?"; if [ $? -ne 0 ]; then exit $?; fi
echo -e "\e[0mLovelaces to send to ${showToAddr}: \e[33m $(convertToADA ${lovelacesToSend}) ADA / ${lovelacesToSend} lovelaces \e[90m"
if [[ ${lovelacesToSend} -lt ${minOutUTXO} ]]; then echo -e "\e[35mNot enough lovelaces to send to the destination! Minimum UTXO value is ${minOutUTXO} lovelaces.\e[0m"; exit 1; fi
lovelacesToReturn=$(( ${totalLovelaces} - ${fee} - ${lovelacesToSend} ))
Expand Down Expand Up @@ -569,6 +585,9 @@ rm ${txFile} 2> /dev/null
#If payment address is a hardware wallet, use the cardano-hw-cli for the signing
if [[ -f "${fromAddr}.hwsfile" ]]; then

# #remove the tag(258) from the txBodyFile
# sed -si 's/00d901028182/008182/g' "${txBodyFile}"

echo -ne "\e[0mAutocorrect the TxBody for canonical order: "
tmp=$(autocorrect_TxBodyFile "${txBodyFile}"); if [ $? -ne 0 ]; then echo -e "\e[35m${tmp}\e[0m\n\n"; exit 1; fi
echo -e "\e[32m${tmp}\e[90m\n"
Expand Down
Loading

0 comments on commit a584986

Please sign in to comment.