@@ -33,7 +33,7 @@ export SCRIPT_TX_VALUE=**MINIUM_SCRIPT_TX_VALUE**
3333A common value for the transaction amount used when a script transaction is made is:
3434
3535``` bash
36- export SCRIPT_TX_VALUE=2000000
36+ export SCRIPT_TX_VALUE=2100000
3737```
3838
3939Compute the network magic parameter that handles both the Cardano mainnet and Cardano test networks:
@@ -129,7 +129,10 @@ An example output of the command is:
129129Verify that the payment address has funds:
130130
131131``` bash
132- $CARDANO_CLI query utxo --address $( cat $CARDANO_WALLET_PATH /payment.addr) $CARDANO_NETWORK_MAGIC --socket-path $CARDANO_NODE_SOCKET_PATH
132+ $CARDANO_CLI $CARDANO_ERA query utxo --address $( cat $CARDANO_WALLET_PATH /payment.addr) $CARDANO_NETWORK_MAGIC --socket-path $CARDANO_NODE_SOCKET_PATH
133+ ```
134+
135+ ``` bash
133136 TxHash TxIx Amount
134137--------------------------------------------------------------------------------------
135138f0c0345f151f9365fbbb4e7afa217e56b987d9e91fd754ca609d9dfec97275c7 0 10000000000 lovelace + TxOutDatumNone
@@ -151,6 +154,9 @@ $CARDANO_CLI $CARDANO_ERA transaction build $CARDANO_NETWORK_MAGIC \
151154 --change-address $( cat $CARDANO_WALLET_PATH /payment.addr) \
152155 --out-file $ASSETS_PATH /tx.raw \
153156 --socket-path $CARDANO_NODE_SOCKET_PATH
157+ ```
158+
159+ ``` bash
154160Estimated transaction fee: Lovelace 168669
155161```
156162
@@ -171,20 +177,29 @@ $CARDANO_CLI $CARDANO_ERA transaction submit \
171177 $CARDANO_NETWORK_MAGIC \
172178 --tx-file $ASSETS_PATH /tx.signed \
173179 --socket-path $CARDANO_NODE_SOCKET_PATH
180+ ```
181+
182+ ``` bash
174183Transaction successfully submitted.
175184```
176185
177186Also get the transaction id:
178187
179188``` bash
180- $CARDANO_CLI transaction txid --tx-file $ASSETS_PATH /tx.signed
189+ $CARDANO_CLI $CARDANO_ERA transaction txid --tx-file $ASSETS_PATH /tx.signed
190+ ```
191+
192+ ``` bash
1811936518b3cea0b49b55746ec61148e7c60ab042959d534f6bb6e8f6a844d4af69fb
182194```
183195
184196We need to wait a few seconds before the transaction is available and we can see the initial datum for the script address:
185197
186198``` bash
187- $CARDANO_CLI query utxo --address $( cat $CARDANO_WALLET_PATH /payment.addr) $CARDANO_NETWORK_MAGIC --socket-path $CARDANO_NODE_SOCKET_PATH
199+ $CARDANO_CLI $CARDANO_ERA query utxo --address $( cat $CARDANO_WALLET_PATH /payment.addr) $CARDANO_NETWORK_MAGIC --socket-path $CARDANO_NODE_SOCKET_PATH
200+ ```
201+
202+ ``` bash
188203 TxHash TxIx Amount
189204--------------------------------------------------------------------------------------
1902056518b3cea0b49b55746ec61148e7c60ab042959d534f6bb6e8f6a844d4af69fb 0 1500000 lovelace + TxOutDatumInline ReferenceTxInsScriptsInlineDatumsInBabbageEra (ScriptDataConstructor 0 [ScriptDataBytes " [{\" n\" :\" thales\" ,\" e\" :1}]" ,ScriptDataBytes " \165\143\232\227\&6\244e\222\211\187\167\197\167\175\229\181\162o/\182[|Nnt.h\ACKE\241=\242\139\242\182:a\204r\217\200&\190I\SO,\US\DLE\152\217U\223P5\128\164\232\153\181\ETB8\132\227\SO" ])
@@ -196,7 +211,10 @@ Optional: We can retrieve the initial value stored in the datum with the cardano
196211The full utxo json representation:
197212
198213``` bash
199- $CARDANO_CLI query utxo --address $( cat $CARDANO_WALLET_PATH /payment.addr) $CARDANO_NETWORK_MAGIC --socket-path $CARDANO_NODE_SOCKET_PATH --out-file temp.json && cat temp.json | jq ' . [] | select(.inlineDatum | . != null and . != "")'
214+ $CARDANO_CLI $CARDANO_ERA query utxo --address $( cat $CARDANO_WALLET_PATH /payment.addr) $CARDANO_NETWORK_MAGIC --socket-path $CARDANO_NODE_SOCKET_PATH --out-file temp.json && cat temp.json | jq ' .[] | select(.inlineDatum | . != null and . != "")'
215+ ```
216+
217+ ``` bash
200218{
201219 " address" : " addr_test1qzzngukkj9ydjemqjlgfn42sevy2xnvauay46weushlpuq9thd4ray00csjssf4sxftv04xeequ3xfx72nujg9y4d5ysgkxxlh" ,
202220 " datum" : null,
@@ -219,6 +237,28 @@ $CARDANO_CLI query utxo --address $(cat $CARDANO_WALLET_PATH/payment.addr) $CARD
219237}
220238```
221239
240+ The parsed era markers json representation:
241+
242+ ``` bash
243+ $CARDANO_CLI $CARDANO_ERA query utxo --address $( cat $CARDANO_WALLET_PATH /payment.addr) $CARDANO_NETWORK_MAGIC --socket-path $CARDANO_NODE_SOCKET_PATH --out-file temp.json && cat temp.json | jq -r ' .[] | select(.inlineDatum | . != null and . != "")| .inlineDatum.fields[].bytes' | tr ' \n' ' ' | xxd -r -p | jq
244+ ```
245+
246+ ``` json
247+ {
248+ "markers" : [
249+ {
250+ "name" : " thales" ,
251+ "epoch" : 1
252+ },
253+ {
254+ "name" : " pythagoras" ,
255+ "epoch" : null
256+ }
257+ ],
258+ "signature" : " a83a8dee3b875a7e8d259500a8ce14cc73587ef838899d269ad58aadd16086cfe0486528e54b841b3a1d5aa8b7176d55c0803337ca59fbd3654b2bdd5a480d05"
259+ }
260+ ```
261+
222262## Update Era Markers: Write a new version of datum on chain
223263
224264> [ !IMPORTANT]
@@ -228,7 +268,10 @@ $CARDANO_CLI query utxo --address $(cat $CARDANO_WALLET_PATH/payment.addr) $CARD
228268Retrieve the utxo of the payment address:
229269
230270``` bash
231- $CARDANO_CLI query utxo --address $( cat $CARDANO_WALLET_PATH /payment.addr) $CARDANO_NETWORK_MAGIC --socket-path $CARDANO_NODE_SOCKET_PATH
271+ $CARDANO_CLI $CARDANO_ERA query utxo --address $( cat $CARDANO_WALLET_PATH /payment.addr) $CARDANO_NETWORK_MAGIC --socket-path $CARDANO_NODE_SOCKET_PATH
272+ ```
273+
274+ ``` bash
232275 TxHash TxIx Amount
233276--------------------------------------------------------------------------------------
2342776518b3cea0b49b55746ec61148e7c60ab042959d534f6bb6e8f6a844d4af69fb 0 1500000 lovelace + TxOutDatumInline ReferenceTxInsScriptsInlineDatumsInBabbageEra (ScriptDataConstructor 0 [ScriptDataBytes " [{\" n\" :\" thales\" ,\" e\" :1}]" ,ScriptDataBytes " \165\143\232\227\&6\244e\222\211\187\167\197\167\175\229\181\162o/\182[|Nnt.h\ACKE\241=\242\139\242\182:a\204r\217\200&\190I\SO,\US\DLE\152\217U\223P5\128\164\232\153\181\ETB8\132\227\SO" ])
@@ -284,14 +327,20 @@ Transaction successfully submitted.
284327Also get the transaction id:
285328
286329``` bash
287- $CARDANO_CLI transaction txid --tx-file $ASSETS_PATH /tx.signed
330+ $CARDANO_CLI $CARDANO_ERA transaction txid --tx-file $ASSETS_PATH /tx.signed
331+ ```
332+
333+ ``` bash
2883341fd4d3e131afe3c8b212772a3f3083d2fbc6b2a7b20e54e4ff08e001598818d8
289335```
290336
291337We need to wait a few seconds before the transaction is available and we can see the updated datum for the script address:
292338
293339``` bash
294- $CARDANO_CLI query utxo --address $( cat $CARDANO_WALLET_PATH /payment.addr) $CARDANO_NETWORK_MAGIC --socket-path $CARDANO_NODE_SOCKET_PATH
340+ $CARDANO_CLI $CARDANO_ERA query utxo --address $( cat $CARDANO_WALLET_PATH /payment.addr) $CARDANO_NETWORK_MAGIC --socket-path $CARDANO_NODE_SOCKET_PATH
341+ ```
342+
343+ ``` bash
295344 TxHash TxIx Amount
296345--------------------------------------------------------------------------------------
2973461f139b47017c9c90d4622ac768e249d25d37ad4461db44a20486b7da72a78915 0 2000000 lovelace + TxOutDatumInline ReferenceTxInsScriptsInlineDatumsInBabbageEra (ScriptDataConstructor 0 [ScriptDataBytes " [{\" n\" :\" thales\" ,\" e\" :1},{\" n\" :\" pythagoras\" ,\" e\" :null}]" ,ScriptDataBytes " ^P\EOT\248k3\196/\139\tU\173H\138\FS\194MD\240\153\227\142z\181\134\213\168\&2\222\219i1\246\NAK\\ ]\247\154U\143-^vmtq\204\207#\236\213\f\201\&1\152\145(\161\ETX;\183\128\195\r" ])
@@ -303,7 +352,10 @@ We can retrieve the updated value stored in the datum with the cardano cli:
303352The full utxo json representation:
304353
305354``` bash
306- $CARDANO_CLI query utxo --address $( cat $CARDANO_WALLET_PATH /payment.addr) $CARDANO_NETWORK_MAGIC --socket-path $CARDANO_NODE_SOCKET_PATH --out-file temp.json && cat temp.json | jq ' . [] | select(.inlineDatum | . != null and . != "")'
355+ $CARDANO_CLI $CARDANO_ERA query utxo --address $( cat $CARDANO_WALLET_PATH /payment.addr) $CARDANO_NETWORK_MAGIC --socket-path $CARDANO_NODE_SOCKET_PATH --out-file temp.json && cat temp.json | jq ' .[] | select(.inlineDatum | . != null and . != "")'
356+ ```
357+
358+ ``` bash
307359{
308360 " address" : " addr_test1qzzngukkj9ydjemqjlgfn42sevy2xnvauay46weushlpuq9thd4ray00csjssf4sxftv04xeequ3xfx72nujg9y4d5ysgkxxlh" ,
309361 " datum" : null,
@@ -325,3 +377,25 @@ $CARDANO_CLI query utxo --address $(cat $CARDANO_WALLET_PATH/payment.addr) $CARD
325377 }
326378}
327379```
380+
381+ The parsed era markers json representation:
382+
383+ ``` bash
384+ $CARDANO_CLI $CARDANO_ERA query utxo --address $( cat $CARDANO_WALLET_PATH /payment.addr) $CARDANO_NETWORK_MAGIC --socket-path $CARDANO_NODE_SOCKET_PATH --out-file temp.json && cat temp.json | jq -r ' .[] | select(.inlineDatum | . != null and . != "")| .inlineDatum.fields[].bytes' | tr ' \n' ' ' | xxd -r -p | jq
385+ ```
386+
387+ ``` json
388+ {
389+ "markers" : [
390+ {
391+ "name" : " thales" ,
392+ "epoch" : 1
393+ },
394+ {
395+ "name" : " pythagoras" ,
396+ "epoch" : 123
397+ }
398+ ],
399+ "signature" : " a83a8dee3b875a7e8d259500a8ce14cc73587ef838899d269ad58aadd16086cfe0486528e54b841b3a1d5aa8b7176d55c0803337ca59fbd3654b2bdd5a480d05"
400+ }
401+ ```
0 commit comments