Skip to content

Commit

Permalink
fix: make devnet work with '8.9.1+'
Browse files Browse the repository at this point in the history
  • Loading branch information
jpraynaud committed Jun 28, 2024
1 parent 4a0e524 commit a8fee6e
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions mithril-test-lab/mithril-devnet/mkfiles/mkfiles-cardano.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,19 +89,25 @@ if [ "${CARDANO_NODE_VERSION_RELEASE}" = "8.1.2" ]; then
fi

if [ $(version_lt "${CARDANO_NODE_VERSION_RELEASE}" "8.8.0") = "false" ]; then
# Fix >=8.8.0, to avoid the following errors: 'Command failed: genesis create-staked Error: Error: Error while decoding Shelley genesis at: ./temp/genesis.conway.spec.json Error: Error in $.poolVotingThresholds: key "motionNoConfidence" not found
# Fix >=8.8.0, to avoid the following errors: 'Command failed: genesis create-staked Error: Error: Error while decoding Shelley genesis at: ./temp/genesis.conway.spec.json Error: Error in $.poolVotingThresholds: key "motionNoConfidence" not found'
mv ${ARTIFACTS_DIR_TEMP}/genesis.conway.spec.json ${ARTIFACTS_DIR_TEMP}/genesis.conway.spec.json.tmp && cat ${ARTIFACTS_DIR_TEMP}/genesis.conway.spec.json.tmp | jq '. += {"poolVotingThresholds": {"motionNoConfidence": 0.51, "committeeNormal": 0.51, "committeeNoConfidence": 0.51, "hardForkInitiation": 0.51, "ppSecurityGroup": 0.51}, "dRepVotingThresholds": {"motionNoConfidence": 0.51, "committeeNormal": 0.51, "committeeNoConfidence": 0.51, "updateToConstitution": 0.51, "hardForkInitiation": 0.51, "ppNetworkGroup": 0.51, "ppEconomicGroup": 0.51, "ppTechnicalGroup": 0.51, "ppGovGroup": 0.51, "treasuryWithdrawal": 0.51}}' > ${ARTIFACTS_DIR_TEMP}/genesis.conway.spec.json && rm ${ARTIFACTS_DIR_TEMP}/genesis.conway.spec.json.tmp
cat ${ARTIFACTS_DIR_TEMP}/genesis.conway.spec.json
fi

if [ $(version_lt "${CARDANO_NODE_VERSION_RELEASE}" "8.9.1") = "false" ]; then
# Fix >=8.9.1, to avoid the following errors: 'Command failed: genesis create-staked Error: Error while decoding Shelley genesis at: ./temp/genesis.conway.spec.json Error: Error in $.committee: key "quorum" not found'
mv ${ARTIFACTS_DIR_TEMP}/genesis.conway.spec.json ${ARTIFACTS_DIR_TEMP}/genesis.conway.spec.json.tmp && cat ${ARTIFACTS_DIR_TEMP}/genesis.conway.spec.json.tmp | jq '. += {"committee": {"quorum": 0.51, "members": {}}}' > ${ARTIFACTS_DIR_TEMP}/genesis.conway.spec.json && rm ${ARTIFACTS_DIR_TEMP}/genesis.conway.spec.json.tmp
cat ${ARTIFACTS_DIR_TEMP}/genesis.conway.spec.json
fi

if [ $(version_lt "${CARDANO_NODE_VERSION_RELEASE}" "8.10.0") = "false" ]; then
# Fix >=8.10.0, to avoid the following errors: 'Command failed: genesis create-staked Error: Error while decoding Shelley genesis at: ./temp/genesis.conway.spec.json Error: Error in $: key "minFeeRefScriptCostPerByte" not found
# Fix >=8.10.0, to avoid the following errors: 'Command failed: genesis create-staked Error: Error while decoding Shelley genesis at: ./temp/genesis.conway.spec.json Error: Error in $: key "minFeeRefScriptCostPerByte" not found'
mv ${ARTIFACTS_DIR_TEMP}/genesis.conway.spec.json ${ARTIFACTS_DIR_TEMP}/genesis.conway.spec.json.tmp && cat ${ARTIFACTS_DIR_TEMP}/genesis.conway.spec.json.tmp | jq '. += {"minFeeRefScriptCostPerByte": 0, "committee": {"members": {}, "threshold": 0.67}}' > ${ARTIFACTS_DIR_TEMP}/genesis.conway.spec.json && rm ${ARTIFACTS_DIR_TEMP}/genesis.conway.spec.json.tmp
cat ${ARTIFACTS_DIR_TEMP}/genesis.conway.spec.json
fi

if [ $(version_lt "${CARDANO_NODE_VERSION_RELEASE}" "8.11.0") = "false" ]; then
# Fix >=8.11.0, to avoid the following errors: 'Command failed: genesis create-staked Error: Error while decoding Shelley genesis at: ./temp/genesis.conway.spec.json Error: Error in $: key "plutusV3CostModel" not found
# Fix >=8.11.0, to avoid the following errors: 'Command failed: genesis create-staked Error: Error while decoding Shelley genesis at: ./temp/genesis.conway.spec.json Error: Error in $: key "plutusV3CostModel" not found'
mv ${ARTIFACTS_DIR_TEMP}/genesis.conway.spec.json ${ARTIFACTS_DIR_TEMP}/genesis.conway.spec.json.tmp && cat ${ARTIFACTS_DIR_TEMP}/genesis.conway.spec.json.tmp | jq '. += {"plutusV3CostModel": []}' > ${ARTIFACTS_DIR_TEMP}/genesis.conway.spec.json && rm ${ARTIFACTS_DIR_TEMP}/genesis.conway.spec.json.tmp
cat ${ARTIFACTS_DIR_TEMP}/genesis.conway.spec.json
fi
Expand Down

0 comments on commit a8fee6e

Please sign in to comment.