You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
New features - Mnemonic wallet, Messages, Metadata
Generating Base/Staking-Keys with/from Mnemonics has been added to the script:
- 03a_genStakingPaymentAddr.sh
So you can now generate a set of Base(Payment)- and Staking-Keys derived from 24-Word Mnemonics. If Mnemonics are provided they are used, otherwise new ones are created. This makes it easier to use keys across the CLI and other wallets like Daedalus, Eternl, Typhoon, ...
---
Sending transaction messages including the option to encrypt the messages (CIP-0083) has been added to the following scripts:
- 03b_regStakingAddrCert.sh
- 05c_regStakepoolCert.sh
- 05d_poolWitness.sh
- 06_regDelegationCert.sh
- 07b_deregStakepoolCert.sh
- 08b_deregStakingAddrCert.sh
---
Attaching transaction metadata as *.json and *.cbor file has been added to the following scripts:
- 03b_regStakingAddrCert.sh
- 05c_regStakepoolCert.sh
- 05d_poolWitness.sh
- 06_regDelegationCert.sh
- 07b_deregStakepoolCert.sh
- 08b_deregStakingAddrCert.sh
So you can now add a comment or an encrypted message or metadata to every transaction that is possible via the StakepoolOperatorScripts.
#Check about required files: Registration Certificate, Signing Key and Address of the payment Account
19
54
#For StakeKeyRegistration
20
55
if [ !-f"${stakeAddr}.cert" ];thenecho -e "\n\e[35mERROR - \"${stakeAddr}.cert\" Registration Certificate does not exist! Please create it first with script 03a.\e[0m";exit 2;fi
21
56
if [ !-f"${stakeAddr}.addr" ];thenecho -e "\n\e[35mERROR - \"${stakeAddr}.addr\" Stake Address file does not exist! Please create it first with script 03a.\e[0m";exit 2;fi
22
-
#if ! [[ -f "${stakeAddr}.skey" || -f "${stakeAddr}.hwsfile" ]]; then echo -e "\n\e[35mERROR - \"${stakeAddr}.skey/hwsfile\" Staking Signing Key or HardwareFile does not exist! Please create it first with script 03a.\e[0m"; exit 2; fi
23
-
24
57
#For payment
25
58
if [ !-f"${fromAddr}.addr" ];thenecho -e "\n\e[35mERROR - \"${fromAddr}.addr\" does not exist! Please create it first with script 03a or 02.\e[0m";exit 1;fi
26
59
if! [[ -f"${fromAddr}.skey"||-f"${fromAddr}.hwsfile" ]];thenecho -e "\n\e[35mERROR - \"${fromAddr}.skey/hwsfile\" does not exist! Please create it first with script 03a or 02.\e[0m";exit 1;fi
elseecho -e "\n\e[35mERROR - The specified Metadata JSON/CBOR-File '${metafile}' does not exist. Fileextension must be '.json' or '.cbor' Please try again.\n\e[0m";exit 1;
91
+
fi
92
+
93
+
#Check it its a MessageComment. Adding it to the JSON array if the length is <= 64 chars
94
+
elif [[ "${paramValue,,}"=~ ^msg:(.*)$ ]];then#if the parameter starts with "msg:" then add it
95
+
msgString=$(trimString "${paramValue:4}");
96
+
97
+
#Split the messages within the parameter at the "|" char
if [ $?-ne 0 ];thenecho -e "\n\e[35mMessage-Adding-ERROR: \"${tmpMessage}\" contain invalid chars for a JSON!\n\e[0m";exit 1;fi
107
+
elseecho -e "\n\e[35mMessage-Adding-ERROR: \"${tmpMessage}\" is too long, max. 64 bytes allowed, yours is $(byteLength "${tmpMessage}") bytes long!\n\e[0m";exit 1;
108
+
fi
109
+
done
110
+
111
+
#Check if its a transaction message encryption type
112
+
elif [[ "${paramValue,,}"=~ ^enc:(.*)$ ]];then#if the parameter starts with "enc:" then set the encryption variable
113
+
encryption=$(trimString "${paramValue:4}");
114
+
115
+
#Check if its a transaction message encryption passphrase
116
+
elif [[ "${paramValue,,}"=~ ^pass:(.*)$ ]];then#if the parameter starts with "pass:" then set the passphrase variable
117
+
passphrase="${paramValue:5}";#don't do a trimstring here, because also spaces are a valid passphrase !
118
+
119
+
fi#end of different parameters check
120
+
121
+
done
122
+
123
+
#Check if there are transactionMessages, if so, save the messages to a xxx.transactionMessage.json temp-file and add it to the list. Encrypt it if enabled.
if [ $?-eq 0 ];then#json is valid, so no bad chars found
129
+
130
+
#Check if encryption is enabled, encrypt the msg part
131
+
if [[ "${encryption,,}"=="basic" ]];then
132
+
#check openssl
133
+
if! exists openssl;thenecho -e "\e[33mYou need 'openssl', its needed to encrypt the transaction messages !\n\nInstall it on Ubuntu/Debian like:\n\e[97msudo apt update && sudo apt -y install openssl\n\n\e[33mThx! :-)\e[0m\n";exit 2;fi
echo -e "\n\e[35mERROR - The given encryption mode '${encryption,,}' is not on the supported list of encryption methods. Only 'basic' from CIP-0083 is currently supported\n\n\e[0m";exit 1;
144
+
fi
145
+
146
+
echo"${tmp}">${transactionMessageMetadataFile}; metafileParameter="${metafileParameter}--metadata-json-file ${transactionMessageMetadataFile}";#add it to the list of metadata.jsons to attach
147
+
148
+
else
149
+
echo -e "\n\e[35mERROR - Additional Transaction Message-Metafile is not valid:\n\n$${transactionMessage}\n\nPlease check your added Message-Paramters.\n\e[0m";exit 1;
150
+
fi
151
+
152
+
fi
153
+
154
+
155
+
156
+
29
157
echo
30
158
echo -e "\e[0mRegister Staking Address\e[32m ${stakeAddr}.addr\e[0m with funds from Address\e[32m ${fromAddr}.addr\e[0m"
31
159
echo
32
160
33
161
162
+
34
163
checkAddr=$(cat ${stakeAddr}.addr)
35
164
typeOfAddr=$(get_addressType "${checkAddr}")
36
165
@@ -63,7 +192,6 @@ fi
63
192
#get live values
64
193
currentTip=$(get_currentTip)
65
194
ttl=$(get_currentTTL)
66
-
currentEPOCH=$(get_currentEpoch)
67
195
68
196
echo -e "Current Slot-Height:\e[32m ${currentTip}\e[0m (setting TTL[invalid_hereafter] to ${ttl})"
0 commit comments