File tree Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22# Example usage:
33# ./scripts-demo/fund.sh addr_test1vq922scgdwrrfa3n2pzu3empkju9ekregg0tza0xnveya3gfl0ycn 1000000000
4+
5+ set -euo pipefail
6+
7+ trap ' rm -f fundint.txbody' EXIT
8+ rm -f funding.txbody funding.tx
9+
10+ run_cardano_cli () {
11+ cabal run -v0 cardano-cli -- " $@ "
12+ }
13+
414export CARDANO_NODE_SOCKET_PATH=./testnet-data/socket/node1/sock
515export CARDANO_NODE_NETWORK_ID=42
616SRC_ADDR=$( cat testnet-data/utxo-keys/utxo1/utxo.addr)
7- SRC_UTXO=$( cabal run cardano-cli -- latest query utxo --address $SRC_ADDR | jq -r ' keys' [0])
8- cabal run cardano-cli -- latest transaction build --tx-in $SRC_UTXO --tx-out $1 +$2 --change-address $SRC_ADDR --out-file funding.txbody
9- cabal run cardano-cli -- latest transaction sign --tx-body-file funding.txbody --signing-key-file testnet-data/utxo-keys/utxo1/utxo.skey --out-file funding.tx
10- cabal run cardano-cli -- latest transaction submit --tx-file funding.tx
11- rm -f funding.txbody funding.tx
17+ SRC_UTXO=$( run_cardano-cli latest query utxo --address " $SRC_ADDR " | jq -r ' keys[0]' )
18+ run_cardano-cli latest transaction build --tx-in " $SRC_UTXO " --tx-out " $1 +$2 " --change-address " $SRC_ADDR " --out-file funding.txbody
19+ run_cardano-cli latest transaction sign --tx-body-file funding.txbody --signing-key-file testnet-data/utxo-keys/utxo1/utxo.skey --out-file funding.tx
20+ run_cardano-cli latest transaction submit --tx-file funding.tx
You can’t perform that action at this time.
0 commit comments