@@ -4,6 +4,17 @@ mkdir -p ${ARTIFACTS_DIR_TEMP}
4
4
# Step 1: Bootstrap the devnet artifacts
5
5
# Adapted from https://github.com/IntersectMBO/cardano-node/blob/master/scripts/babbage/mkfiles.sh
6
6
7
+ # Is semver on the first argument strictly lower than equal to the second argument?
8
+ version_lt () {
9
+ VERSION_LHS=$1
10
+ VERSION_RHS=$2
11
+ if [ " ${VERSION_LHS} " != " ${VERSION_RHS} " ] && [ " ${VERSION_LHS} " = " ` echo -e " ${VERSION_LHS} \n${VERSION_RHS} " | sort -V | head -n1` " ]; then
12
+ echo " true"
13
+ else
14
+ echo " false"
15
+ fi
16
+ }
17
+
7
18
UNAME=$( uname -s) SED=
8
19
case $UNAME in
9
20
Darwin ) SED=" gsed" ;;
@@ -72,11 +83,17 @@ $CARDANO_CLI byron genesis genesis \
72
83
cp $SCRIPT_DIRECTORY /configuration/babbage/alonzo-babbage-test-genesis.json " ${ARTIFACTS_DIR_TEMP} /genesis.alonzo.spec.json"
73
84
cp $SCRIPT_DIRECTORY /configuration/babbage/conway-babbage-test-genesis.json " ${ARTIFACTS_DIR_TEMP} /genesis.conway.spec.json"
74
85
75
- if [ " ${CARDANO_NODE_VERSION } " = " 8.1.2" ]; then
86
+ if [ " ${CARDANO_NODE_VERSION_RELEASE } " = " 8.1.2" ]; then
76
87
# Fix 8.1.2, to avoid the following error: 'Command failed: genesis create-staked Error: Error while decoding Shelley genesis at: example/genesis.conway.spec.json Error: Error in $: key "genDelegs" not found'
77
88
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 ' . += {"genDelegs":{}}' > ${ARTIFACTS_DIR_TEMP} /genesis.conway.spec.json && rm ${ARTIFACTS_DIR_TEMP} /genesis.conway.spec.json.tmp
78
89
fi
79
90
91
+ if [ $( version_lt " ${CARDANO_NODE_VERSION_RELEASE} " " 8.8.0" ) = " false" ]; then
92
+ # 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
93
+ 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
94
+ cat ${ARTIFACTS_DIR_TEMP} /genesis.conway.spec.json
95
+ fi
96
+
80
97
cp $SCRIPT_DIRECTORY /configuration/byron/configuration.yaml " ${ARTIFACTS_DIR_TEMP} /"
81
98
$SED -i " ${ARTIFACTS_DIR_TEMP} /configuration.yaml" \
82
99
-e ' s/Protocol: RealPBFT/Protocol: Cardano/' \
@@ -188,18 +205,6 @@ for ADDR in ${USER_ADDRS}; do
188
205
--stake-verification-key-file addresses/${ADDR} -stake.vkey \
189
206
--testnet-magic ${NETWORK_MAGIC} \
190
207
--out-file addresses/${ADDR} -stake.addr
191
-
192
- # Stake addresses registration certs
193
- ./cardano-cli stake-address registration-certificate \
194
- --stake-verification-key-file addresses/${ADDR} -stake.vkey \
195
- --out-file addresses/${ADDR} -stake.reg.cert
208
+
196
209
done
197
210
198
- # User N will delegate to pool N
199
- for N in ${POOL_NODES_N} ; do
200
- # Stake address delegation certs
201
- ./cardano-cli stake-address delegation-certificate \
202
- --stake-verification-key-file addresses/user${N} -stake.vkey \
203
- --cold-verification-key-file node-pool${N} /shelley/cold.vkey \
204
- --out-file addresses/user${N} -stake.deleg.cert
205
- done
0 commit comments