Help building draft transaction on testnet

I am following the stake-pool course, I am currently in the “draft the transaction” section of this guide https://cardano-foundation.gitbook.io/stake-pool-course/stake-pool-guide/stake-pool-operations/transactions but when I enter this set of commands

cardano-cli transaction build-raw
–mary-era
–tx-in 8eaf398b3e6a3d30a555fd9bfa121e985cbacb14898ebc019e19c1e2ba2d89cb#0 \
–tx-out $(cat payment2.addr)+100000000
–tx-out $(cat payment.addr)+0
–ttl 0
–fee 0
–out-file tx.raw

I get this error

$ cardano-cli transaction build-raw \

–mary-era
–tx-in 8eaf398b3e6a3d30a555fd9bfa121e985cbacb14898ebc019e19c1e2ba2d89cb#0 \
Invalid argument ` ’

Did you mean this?
-h

Usage: cardano-cli transaction build-raw [–byron-era | --shelley-era |
–allegra-era | --mary-era]
(–tx-in TX-IN) [–tx-out TX-OUT]
[–mint VALUE] [–invalid-before SLOT]
[–invalid-hereafter SLOT]
[–fee LOVELACE]
[–certificate-file FILE]
[–withdrawal WITHDRAWAL]
[–json-metadata-no-schema |
–json-metadata-detailed-schema]
[–script-file FILE]
[–metadata-json-file FILE |
–metadata-cbor-file FILE]
[–update-proposal-file FILE]
–out-file FILE
Build a transaction (low-level, inconvenient)

I changed the era line to be mary-era and the address on tx-in.
I got the address with this commands

>~/keysAndAdresses$  cardano-cli query utxo \
> --mary-era \
> --address $(cat payment.addr) \
> --testnet-magic 1097911063
                           TxHash                                 TxIx        Amount
--------------------------------------------------------------------------------------
8eaf398b3e6a3d30a555fd9bfa121e985cbacb14898ebc019e19c1e2ba2d89cb     0        1000000000 lovelace

Does anyone know where I went wrong? it looks like it isn’t reading my tx-in correctly, but I think I got it right.

There are some double-quotes, backslashes, and dollar signs missing in what you pasted. The following should work:

cardano-cli transaction build-raw \
--mary-era \
--tx-in 8eaf398b3e6a3d30a555fd9bfa121e985cbacb14898ebc019e19c1e2ba2d89cb#0 \
--tx-out "$(cat payment2.addr)+100000000" \
--tx-out "$(cat payment.addr)+0" \
--ttl 0 \
--fee 0 \
--out-file tx.raw
2 Likes

thanks a lot man, I tried your suggestion and it worked at the first try. I am new to this whole thing (including Linux) and was just copying from the guide. I also found out that I had an 'space" after my tx-in, that was what was throwing the first error

1 Like