-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcreate-address-update-reference-script.sh
More file actions
executable file
·37 lines (30 loc) · 1.13 KB
/
create-address-update-reference-script.sh
File metadata and controls
executable file
·37 lines (30 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh
# A helper script for showing how to store the scripts on chain as reference scripts.
## Variables
mainDir="../../../ignored/"
walletDir="${mainDir}wallets/"
optionsDir="${mainDir}options-files/"
tmpDir="${mainDir}tmp/"
scriptFile="${optionsDir}address_update_observer.plutus"
## Export the script.
echo "Exporting the address update observer script..."
cardano-options scripts \
--address-update-script \
--out-file $scriptFile
## Create and submit the transaction.
cardano-cli transaction build \
--tx-in a7c0a2283eb804111bd39f40f9e9cafa05d6da14d4bf8d20d2aaa67b5fb0cde6#1 \
--tx-in a7c0a2283eb804111bd39f40f9e9cafa05d6da14d4bf8d20d2aaa67b5fb0cde6#0 \
--tx-out "$(cat "${walletDir}01.addr") + 15000000 lovelace" \
--tx-out-reference-script-file $scriptFile \
--change-address "$(cat "${walletDir}01.addr")" \
--testnet-magic 1 \
--out-file "${tmpDir}tx.body"
cardano-cli transaction sign \
--tx-body-file "${tmpDir}tx.body" \
--signing-key-file "${walletDir}/01.skey" \
--testnet-magic 1 \
--out-file "${tmpDir}tx.signed"
cardano-cli transaction submit \
--testnet-magic 1 \
--tx-file "${tmpDir}tx.signed"