@@ -33,7 +33,7 @@ export SCRIPT_TX_VALUE=**MINIUM_SCRIPT_TX_VALUE**
33
33
A common value for the transaction amount used when a script transaction is made is:
34
34
35
35
``` bash
36
- export SCRIPT_TX_VALUE=2000000
36
+ export SCRIPT_TX_VALUE=2100000
37
37
```
38
38
39
39
Compute 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:
129
129
Verify that the payment address has funds:
130
130
131
131
``` 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
133
136
TxHash TxIx Amount
134
137
--------------------------------------------------------------------------------------
135
138
f0c0345f151f9365fbbb4e7afa217e56b987d9e91fd754ca609d9dfec97275c7 0 10000000000 lovelace + TxOutDatumNone
@@ -151,6 +154,9 @@ $CARDANO_CLI $CARDANO_ERA transaction build $CARDANO_NETWORK_MAGIC \
151
154
--change-address $( cat $CARDANO_WALLET_PATH /payment.addr) \
152
155
--out-file $ASSETS_PATH /tx.raw \
153
156
--socket-path $CARDANO_NODE_SOCKET_PATH
157
+ ```
158
+
159
+ ``` bash
154
160
Estimated transaction fee: Lovelace 168669
155
161
```
156
162
@@ -171,20 +177,29 @@ $CARDANO_CLI $CARDANO_ERA transaction submit \
171
177
$CARDANO_NETWORK_MAGIC \
172
178
--tx-file $ASSETS_PATH /tx.signed \
173
179
--socket-path $CARDANO_NODE_SOCKET_PATH
180
+ ```
181
+
182
+ ``` bash
174
183
Transaction successfully submitted.
175
184
```
176
185
177
186
Also get the transaction id:
178
187
179
188
``` 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
181
193
6518b3cea0b49b55746ec61148e7c60ab042959d534f6bb6e8f6a844d4af69fb
182
194
```
183
195
184
196
We need to wait a few seconds before the transaction is available and we can see the initial datum for the script address:
185
197
186
198
``` 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
188
203
TxHash TxIx Amount
189
204
--------------------------------------------------------------------------------------
190
205
6518b3cea0b49b55746ec61148e7c60ab042959d534f6bb6e8f6a844d4af69fb 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
196
211
The full utxo json representation:
197
212
198
213
``` 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
200
218
{
201
219
" address" : " addr_test1qzzngukkj9ydjemqjlgfn42sevy2xnvauay46weushlpuq9thd4ray00csjssf4sxftv04xeequ3xfx72nujg9y4d5ysgkxxlh" ,
202
220
" datum" : null,
@@ -219,6 +237,28 @@ $CARDANO_CLI query utxo --address $(cat $CARDANO_WALLET_PATH/payment.addr) $CARD
219
237
}
220
238
```
221
239
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
+
222
262
## Update Era Markers: Write a new version of datum on chain
223
263
224
264
> [ !IMPORTANT]
@@ -228,7 +268,10 @@ $CARDANO_CLI query utxo --address $(cat $CARDANO_WALLET_PATH/payment.addr) $CARD
228
268
Retrieve the utxo of the payment address:
229
269
230
270
``` 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
232
275
TxHash TxIx Amount
233
276
--------------------------------------------------------------------------------------
234
277
6518b3cea0b49b55746ec61148e7c60ab042959d534f6bb6e8f6a844d4af69fb 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.
284
327
Also get the transaction id:
285
328
286
329
``` 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
288
334
1fd4d3e131afe3c8b212772a3f3083d2fbc6b2a7b20e54e4ff08e001598818d8
289
335
```
290
336
291
337
We need to wait a few seconds before the transaction is available and we can see the updated datum for the script address:
292
338
293
339
``` 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
295
344
TxHash TxIx Amount
296
345
--------------------------------------------------------------------------------------
297
346
1f139b47017c9c90d4622ac768e249d25d37ad4461db44a20486b7da72a78915 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:
303
352
The full utxo json representation:
304
353
305
354
``` 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
307
359
{
308
360
" address" : " addr_test1qzzngukkj9ydjemqjlgfn42sevy2xnvauay46weushlpuq9thd4ray00csjssf4sxftv04xeequ3xfx72nujg9y4d5ysgkxxlh" ,
309
361
" datum" : null,
@@ -325,3 +377,25 @@ $CARDANO_CLI query utxo --address $(cat $CARDANO_WALLET_PATH/payment.addr) $CARD
325
377
}
326
378
}
327
379
```
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