Transaction scripts

Create the transaction script file (transaction.sh for example) in a new subfolder of the transactions folder, sign it and submit it to the blockchain:
#!/bin/bash
​
​
source ../../pool-scripts/env
​
ADDRESS=$(cat payment.addr)
TRANS=$(cardano-cli query utxo ${NET} --address $ADDRESS | tail -n 1)
UTXO=$(echo ${TRANS} | awk '{print $1}')
ID=$(echo ${TRANS} | awk '{print $2}')
TXIN="${UTXO}#${ID}"
​
cardano-cli transaction build \
${NET} \
--witness-override 3 \
--tx-in ${TXIN} \
--change-address ${ADDRESS} \
--certificate-file pool-registration.cert \
--certificate-file stake-registration.cert \
--certificate-file delegation.cert \
--out-file tx.raw
​
cardano-cli transaction sign \
--tx-body-file tx.raw \
--signing-key-file cold.skey \
--signing-key-file stake.skey \
--signing-key-file payment.skey \
${NET} \
--out-file tx.signed
​
cardano-cli transaction submit \
--tx-file tx.signed \
${NET}