Transaction Submit Error - Fails to send

I have been trying for several weeks to figure out why my first transactions are failing after running a stake server for about a year. I am trying to send the original pledge back to the investor. I have tested sending to several different wallets (Daedalus, Coinbase, Binance.us) with no sucess. I don’t have a clear understanding of payment.addr and stake.addr files which I recopied from my cold server back to the block producer because the addresses didn’t seem right. When I look in Pooltool.io the addresses (JETT2) don’t seem to match so that could also be an issue. I also don’t understand where in the transaction it says where to pull the funds from (ower/stake). Please help, because I am drowing in cloud fees while I can’t get the investors money back. The stake server was built based on Coincashew configuration. Both Stake and Cold environments are using 1.34.1. Any help or ideas would be very appreciated. Thank you in advance.
Below is the last attempt at

cardano-cli transaction submit
–tx-file tx.signed
–mainnet

Command failed: transaction submit  Error: Error while submitting tx: ShelleyTxVali
dationError ShelleyBasedEraAlonzo (ApplyTxError [UtxowFailure (WrappedShelleyEraFai
lure (UtxoFailure (ValueNotConservedUTxO (Value 25341032905 (fromList [(PolicyID {p
olicyID = ScriptHash "4247d5091db82330100904963ab8d0850976c80d3f1b927e052e07bd"},fr
omList [("Tokhun",2)]),(PolicyID {policyID = ScriptHash "547ceed647f57e64dc40a29b16
be4f36b0d38b5aa3cd7afb286fc094"},fromList [("bbHosky",1000)]),(PolicyID {policyID =
 ScriptHash "88691a70bb0fe49cf9124b4f78553c36c09fa6264844e2b294119173"},fromList [(
"Eusko",10)]),(PolicyID {policyID = ScriptHash "a0028f350aaabe0545fdcb56b039bfb08e4
bb4d8c4d7c3c7d481c235"},fromList [("HOSKY",1000000)]),(PolicyID {policyID = ScriptH
ash "af2e27f580f7f08e93190a81f72462f153026d06450924726645891b"},fromList [("DRIP",2
000000000)]),(PolicyID {policyID = ScriptHash "b0446f1c9105f0cc5bb6bd092f5c3e523e13
f8a999b31c870298fa40"},fromList [("QUID",3)]),(PolicyID {policyID = ScriptHash "b34
b3ea80060ace9427bda98690a73d33840e27aaa8d6edb7f0c757a"},fromList [("cNETA",1050)]),
(PolicyID {policyID = ScriptHash "b7c783f6304eddbdf8f0dece4715d63cb9f453be89d97c8fb
a155d57"},fromList [("RESI",100)]),(PolicyID {policyID = ScriptHash "d030b626219d81
673bd32932d2245e0c71ae5193281f971022b23a78"},fromList [("Cardogeo",420)]),(PolicyID
 {policyID = ScriptHash "d1333653aa3ac24adfa9c6d09c1a2cc8e2b7b86ad334c17f2acb8647"}
,fromList [("BioToken",2)]),(PolicyID {policyID = ScriptHash "f28f457472e539dc75e15
98a2beddf49ce5a717998c708f05f5de610"},fromList [("DEFS",50)]),(PolicyID {policyID =
 ScriptHash "ff97c85de383ebf0b047667ef23c697967719def58d380caf7f04b64"},fromList [(
"SOUL",666)])])) (Value 25341032905 (fromList [])))))])

The --tx-in options are the, well, inputs of the transaction. That’s where things come from. In addition, there might be --withdrawal options to withdraw from a stake address. Should be in the Coincashew guid how to do withdrawals.

This is the main error in your attempt.

It seems you are using an input with lots of different tokens on them. You have to tell cardano-cli for each of those tokens exactly, in which --tx-out it should go.

I am not understanding different tokens? I am trying to first do a small transaction 300 ADA to test the transfer and then I will transfer the complete delegation back. Here is what I did in this order.

Block Producer

currentSlot=$(cardano-cli query tip --mainnet | jq -r '.slot')
echo Current Slot: $currentSlot


amountToSend=300000000
echo amountToSend: $amountToSend

destinationAddress=DdzFFzCqrhsj7SapwZLSPRcK5U1ps7fsqHiKbGxGhwLKBMWUPe5M4Gzi5NeN2UvpHuu7ftBfNkXGmdzZ5Vpd3vScJXzWtoprGhAJRFVC
echo destinationAddress: $destinationAddress

cardano-cli query utxo \
    --address $(cat payment.addr) \
    --mainnet > fullUtxo.out

tail -n +3 fullUtxo.out | sort -k3 -nr > balance.out

cat balance.out

tx_in=""
total_balance=0
while read -r utxo; do
    in_addr=$(awk '{ print $1 }' <<< "${utxo}")
    idx=$(awk '{ print $2 }' <<< "${utxo}")
    utxo_balance=$(awk '{ print $3 }' <<< "${utxo}")
    total_balance=$((${total_balance}+${utxo_balance}))
    echo TxHash: ${in_addr}#${idx}
    echo ADA: ${utxo_balance}
    tx_in="${tx_in} --tx-in ${in_addr}#${idx}"
done < balance.out
txcnt=$(cat balance.out | wc -l)
echo Total ADA balance: ${total_balance}
echo Number of UTXOs: ${txcnt}


cardano-cli transaction build-raw \
    ${tx_in} \
    --tx-out $(cat payment.addr)+0 \
    --tx-out ${destinationAddress}+0 \
    --invalid-hereafter $(( ${currentSlot} + 10000)) \
    --fee 0 \
    --out-file tx.tmp

fee=$(cardano-cli transaction calculate-min-fee \
    --tx-body-file tx.tmp \
    --tx-in-count ${txcnt} \
    --tx-out-count 2 \
    --mainnet \
    --witness-count 1 \
    --byron-witness-count 0 \
    --protocol-params-file params.json | awk '{ print $1 }')
echo fee: $fee


txOut=$((${total_balance}-${fee}-${amountToSend}))
echo Change Output: ${txOut}

cardano-cli transaction build-raw \
    ${tx_in} \
    --tx-out $(cat payment.addr)+${txOut} \
    --tx-out ${destinationAddress}+${amountToSend} \
    --invalid-hereafter $(( ${currentSlot} + 500000)) \
    --fee ${fee} \
    --out-file tx.raw

Copy tx.raw to your cold environment.
Sign the transaction with the payment secret key.
Air-Gapped

cardano-cli transaction sign \
    --tx-body-file tx.raw \
    --signing-key-file payment.skey \
    --mainnet \
    --out-file tx.signed

Copy tx.signed to your hot environment.
Send the signed transaction.
Block Producer

cardano-cli transaction submit \
    --tx-file tx.signed \
    --mainnet

Check if the funds arrived.
Block Producer

cardano-cli query utxo \
    --address ${destinationAddress} \
    --mainnet

In the error message you see that the payment address you are sending from contains a collection of tokens:

From the composition I’d say that you have tried DripDropz with that address as the target address.

In the procedure you are following, you should also see them at:

This will print all the UTxOs on your payment address and one or two of those will contain all these tokens.

The rest of the procedure you are following uses the whole balance as input. You could just delete the lines with the additional tokens from balance.out before continuing and the transaction should go through.

But if you later want to completely empty that address, you would have to send these tokens somewhere.

So if I remove all of the lines of tokens except the below line out of the balance.out file, I should be able to send the delegated amount or less from the 25334826145?

c91217010317e10c0b4a0fe2ef6702d868a0ce68fbc9bf3a55104a34357535c8 0 25334826145 lovelace + TxOutDatumNone

Yes, should work.

(The copy-and-paste procedure you are following cannot deal with inputs that contain tokens. If you remove all of them from balance.out, before continuing with the tx_in="" … while read step, it won’t have to and should be able to send out 25,334.826145 ADA minus the required fees. The tokens will remain at the address.)

Thank you, I will try that when I get home tonight where I can rebuild the transaction.

That worked. Thank you so very much! I now have to figure out where to move all the different tokens and to what exchanges.

1 Like

When I try the same process on the other tokens, I get the following message when building the raw transaction. However, I do notice the balance.out looks different on the tokens though. Example below.

a0028f350aaabe0545fdcb56b039bfb08e4bb4d8c4d7c3c7d481c235.484f534b59 + 1000000000

versus before (do I just remove the numbers after the . or the +?)

25ef656c3c20e9bce8c9f93b8f73bbb31734b6b21a2703ee26f083fcfb63d2e5 0 34119481 lovelace + TxOutDatumNone

error below when doing the cardano-cli transaction build-raw \

expecting hexadecimal digit
Incorrect transaction id format:: “a0028f350aaabe0545fdcb56b039bfb08e4bb4d8c4d7c3c7d481c235”

I don’t quite follow, what you are doing.

This whole “Just copy and paste these lines.” hides much of how it really works from you.

The --tx-in options of cardano-cli transaction build-raw take unspent transcation outputs (UTxOs). Those are the things that were written in the fullUtxo.out and the balance.out file. So, cardano-cli expects to get a transaction ID followed by # followed by the transaction index there – the first two columns of the output of cardano-cli query utxo.

If there are native tokens in those inputs, then exactly the same number of tokens has to be in the transaction outputs – --tx-outs. But each output also has to have a minimal amount of ADA. Your procedure only had ADA in the output.

To add tokens you add + followed by amount of tokens followed by a space followed by policy ID in hex followed by . followed by asset name in hex. So, to add the 2 Tokhun to an output you would add +2 4247d5091db82330100904963ab8d0850976c80d3f1b927e052e07bd.546f6b68756e. Since there is a space in there, the --tx-out has to be protected by " around it.

And you will want to add all the tokens, so this will be a really long --tx-out option.

I think, I can more or less contruct it from public information:

$ destinationAddress="<address you want to send to>"
$ cardano-cli transaction build \
--tx-in 2e0e7fd50ff55818fd09bf6d1ee0f5ce03edb351f46a3930ac489bce9b66bf42#3 \
--tx-in da9b1622ca06264cecb0f733f3f77998e3d7d984db4a7a488cf7b85159b74687#5 \
--tx-out "${destinationAddress}+3200000+2 4247d5091db82330100904963ab8d0850976c80d3f1b927e052e07bd.546f6b68756e+1000 547ceed647f57e64dc40a29b16be4f36b0d38b5aa3cd7afb286fc094.6262486f736b79+10 88691a70bb0fe49cf9124b4f78553c36c09fa6264844e2b294119173.4575736b6f+1000000 a0028f350aaabe0545fdcb56b039bfb08e4bb4d8c4d7c3c7d481c235.484f534b59+2000000000 af2e27f580f7f08e93190a81f72462f153026d06450924726645891b.44524950+3 b0446f1c9105f0cc5bb6bd092f5c3e523e13f8a999b31c870298fa40.51554944+1050 b34b3ea80060ace9427bda98690a73d33840e27aaa8d6edb7f0c757a.634e455441+100 b7c783f6304eddbdf8f0dece4715d63cb9f453be89d97c8fba155d57.52455349+420 d030b626219d81673bd32932d2245e0c71ae5193281f971022b23a78.436172646f67656f+2 d1333653aa3ac24adfa9c6d09c1a2cc8e2b7b86ad334c17f2acb8647.42696f546f6b656e+50 f28f457472e539dc75e1598a2beddf49ce5a717998c708f05f5de610.44454653+666 ff97c85de383ebf0b047667ef23c697967719def58d380caf7f04b64.534f554c" \
--change-address ${destinationAddress} \
--out-file tx.raw
$ cardano-cli transaction sign \
–tx-body-file tx.raw \
–signing-key-file payment.skey \
–mainnet \
–out-file tx.signed
$ cardano-cli transaction submit \
–tx-file tx.signed \
–mainnet

After the tokens are gone, you can follow the usual guides to deregister the pool and the stake key to get your 500 ADA and 2 ADA deposits back and send everything to your wallet.

When that is all done, you can finally turn off your server.

I am still not getting it right. So when I run the utxo commands below. This is what I get. Maybe you can help me draft the cardano-cli transaction build to help me understand what I am doing wrong?

cardano-cli query utxo \
    --address $(cat payment.addr) \
    --mainnet > fullUtxo.out

tail -n +3 fullUtxo.out | sort -k3 -nr > balance.out
cat balance.out

1a05c597619fb2db27624c75bdb6d30390b5bbe5b632775499281d08e3c474c8     0        33940384 lovelace + TxOutDatumNone
da9b1622ca06264cecb0f733f3f77998e3d7d984db4a7a488cf7b85159b74687     4        3103380 lovelace + 1 4247d5091db82330100904963ab8d0850976c80d3f1b927e052e07bd.546f6b68756e + 500 547ceed647f57e64dc40a29b16be4f36b0d38b5aa3cd7afb286fc094.6262486f736b79 + 1000000 a0028f350aaabe0545fdcb56b039bfb08e4bb4d8c4d7c3c7d481c235.484f534b59 + 1000000000 af2e27f580f7f08e93190a81f72462f153026d06450924726645891b.44524950 + 1000 b34b3ea80060ace9427bda98690a73d33840e27aaa8d6edb7f0c757a.634e455441 + 50 b7c783f6304eddbdf8f0dece4715d63cb9f453be89d97c8fba155d57.52455349 + 420 d030b626219d81673bd32932d2245e0c71ae5193281f971022b23a78.436172646f67656f + 1 d1333653aa3ac24adfa9c6d09c1a2cc8e2b7b86ad334c17f2acb8647.42696f546f6b656e + 25 f28f457472e539dc75e1598a2beddf49ce5a717998c708f05f5de610.44454653 + 333 ff97c85de383ebf0b047667ef23c697967719def58d380caf7f04b64.534f554c + TxOutDatumNone
2e0e7fd50ff55818fd09bf6d1ee0f5ce03edb351f46a3930ac489bce9b66bf42     2        3103380 lovelace + 1 4247d5091db82330100904963ab8d0850976c80d3f1b927e052e07bd.546f6b68756e + 500 547ceed647f57e64dc40a29b16be4f36b0d38b5aa3cd7afb286fc094.6262486f736b79 + 10 88691a70bb0fe49cf9124b4f78553c36c09fa6264844e2b294119173.4575736b6f + 1000000000 af2e27f580f7f08e93190a81f72462f153026d06450924726645891b.44524950 + 3 b0446f1c9105f0cc5bb6bd092f5c3e523e13f8a999b31c870298fa40.51554944 + 50 b34b3ea80060ace9427bda98690a73d33840e27aaa8d6edb7f0c757a.634e455441 + 50 b7c783f6304eddbdf8f0dece4715d63cb9f453be89d97c8fba155d57.52455349 + 1 d1333653aa3ac24adfa9c6d09c1a2cc8e2b7b86ad334c17f2acb8647.42696f546f6b656e + 25 f28f457472e539dc75e1598a2beddf49ce5a717998c708f05f5de610.44454653 + 333 ff97c85de383ebf0b047667ef23c697967719def58d380caf7f04b64.534f554c + TxOutDatumNone

Then I run the second half I get.

tx_in=""
total_balance=0
while read -r utxo; do
    in_addr=$(awk '{ print $1 }' <<< "${utxo}")
    idx=$(awk '{ print $2 }' <<< "${utxo}")
    utxo_balance=$(awk '{ print $3 }' <<< "${utxo}")
    total_balance=$((${total_balance}+${utxo_balance}))
    echo TxHash: ${in_addr}#${idx}
    echo ADA: ${utxo_balance}
    tx_in="${tx_in} --tx-in ${in_addr}#${idx}"
done < balance.out
txcnt=$(cat balance.out | wc -l)
echo Total ADA balance: ${total_balance}
echo Number of UTXOs: ${txcnt}
TxHash: 1a05c597619fb2db27624c75bdb6d30390b5bbe5b632775499281d08e3c474c8#0
ADA: 33940384
TxHash: da9b1622ca06264cecb0f733f3f77998e3d7d984db4a7a488cf7b85159b74687#4
ADA: 3103380
TxHash: 2e0e7fd50ff55818fd09bf6d1ee0f5ce03edb351f46a3930ac489bce9b66bf42#2
ADA: 3103380
Total ADA balance: 40147144
Number of UTXOs: 3

I already did:

That’s all. You don’t do anything of the other stuff.

Especially:

This will never work with UTxOs containing native tokens! You can’t use that. You have to understand what it is doing and do a similar thing by hand (or rewrite it to also deal with native tokens).

Ran the cardano-cli transaction build exactly like you have it and got the following error.

Missing: (–mainnet | --testnet-magic NATURAL)

Build a balanced transaction (automatically calculates fees)

Please note the order of some cmd options is crucial. If used incorrectly may produce undesired tx body. See nested notation above for details.

If I add --mainnet \ to the transaction build command you provided. I get the following.

Command failed: transaction build Error: The following tx input(s) were not pre sent in the UTxO:
2e0e7fd50ff55818fd09bf6d1ee0f5ce03edb351f46a3930ac489bce9b66bf42#3
da9b1622ca06264cecb0f733f3f77998e3d7d984db4a7a488cf7b85159b74687#5

Ah, sorry, forgot --mainnet and that that indexes start at 0. Try:

$ destinationAddress="<address you want to send to>"
$ cardano-cli transaction build \
--mainnet \
--tx-in 2e0e7fd50ff55818fd09bf6d1ee0f5ce03edb351f46a3930ac489bce9b66bf42#2 \
--tx-in da9b1622ca06264cecb0f733f3f77998e3d7d984db4a7a488cf7b85159b74687#4 \
--tx-out "${destinationAddress}+3200000+2 4247d5091db82330100904963ab8d0850976c80d3f1b927e052e07bd.546f6b68756e+1000 547ceed647f57e64dc40a29b16be4f36b0d38b5aa3cd7afb286fc094.6262486f736b79+10 88691a70bb0fe49cf9124b4f78553c36c09fa6264844e2b294119173.4575736b6f+1000000 a0028f350aaabe0545fdcb56b039bfb08e4bb4d8c4d7c3c7d481c235.484f534b59+2000000000 af2e27f580f7f08e93190a81f72462f153026d06450924726645891b.44524950+3 b0446f1c9105f0cc5bb6bd092f5c3e523e13f8a999b31c870298fa40.51554944+1050 b34b3ea80060ace9427bda98690a73d33840e27aaa8d6edb7f0c757a.634e455441+100 b7c783f6304eddbdf8f0dece4715d63cb9f453be89d97c8fba155d57.52455349+420 d030b626219d81673bd32932d2245e0c71ae5193281f971022b23a78.436172646f67656f+2 d1333653aa3ac24adfa9c6d09c1a2cc8e2b7b86ad334c17f2acb8647.42696f546f6b656e+50 f28f457472e539dc75e1598a2beddf49ce5a717998c708f05f5de610.44454653+666 ff97c85de383ebf0b047667ef23c697967719def58d380caf7f04b64.534f554c" \
--change-address ${destinationAddress} \
--out-file tx.raw
$ cardano-cli transaction sign \
–tx-body-file tx.raw \
–signing-key-file payment.skey \
–mainnet \
–out-file tx.signed
$ cardano-cli transaction submit \
–tx-file tx.signed \
–mainnet

Now I’m getting this error.

Command failed: transaction build Error: Minimum UTxO threshold not met for tx output: addr1qyz86h4mes0r3lsszy38qque4st8nn0awa99ldva4gpuncgdxyz664jkgqvv0ynquflzajyn6qlf2kfx2hg34sd2h3wsm3l2ej + 3200000 lovelace + 2 4247d5091db82330100904963ab8d0850976c80d3f1b927e052e07bd.546f6b68756e + 1000 547ceed647f57e64dc40a29b16be4f36b0d38b5aa3cd7afb286fc094.6262486f736b79 + 10 88691a70bb0fe49cf9124b4f78553c36c09fa6264844e2b294119173.4575736b6f + 1000000 a0028f350aaabe0545fdcb56b039bfb08e4bb4d8c4d7c3c7d481c235.484f534b59 + 2000000000 af2e27f580f7f08e93190a81f72462f153026d06450924726645891b.44524950 + 3 b0446f1c9105f0cc5bb6bd092f5c3e523e13f8a999b31c870298fa40.51554944 + 1050 b34b3ea80060ace9427bda98690a73d33840e27aaa8d6edb7f0c757a.634e455441 + 100 b7c783f6304eddbdf8f0dece4715d63cb9f453be89d97c8fba155d57.52455349 + 420 d030b626219d81673bd32932d2245e0c71ae5193281f971022b23a78.436172646f67656f + 2 d1333653aa3ac24adfa9c6d09c1a2cc8e2b7b86ad334c17f2acb8647.42696f546f6b656e + 50 f28f457472e539dc75e1598a2beddf49ce5a717998c708f05f5de610.44454653 + 666 ff97c85de383ebf0b047667ef23c697967719def58d380caf7f04b64.534f554c
Minimum required UTxO: Lovelace 3482682

$ destinationAddress="<address you want to send to>"
$ cardano-cli transaction build \
--mainnet \
--tx-in 2e0e7fd50ff55818fd09bf6d1ee0f5ce03edb351f46a3930ac489bce9b66bf42#2 \
--tx-in da9b1622ca06264cecb0f733f3f77998e3d7d984db4a7a488cf7b85159b74687#4 \
--tx-out "${destinationAddress}+3482682+2 4247d5091db82330100904963ab8d0850976c80d3f1b927e052e07bd.546f6b68756e+1000 547ceed647f57e64dc40a29b16be4f36b0d38b5aa3cd7afb286fc094.6262486f736b79+10 88691a70bb0fe49cf9124b4f78553c36c09fa6264844e2b294119173.4575736b6f+1000000 a0028f350aaabe0545fdcb56b039bfb08e4bb4d8c4d7c3c7d481c235.484f534b59+2000000000 af2e27f580f7f08e93190a81f72462f153026d06450924726645891b.44524950+3 b0446f1c9105f0cc5bb6bd092f5c3e523e13f8a999b31c870298fa40.51554944+1050 b34b3ea80060ace9427bda98690a73d33840e27aaa8d6edb7f0c757a.634e455441+100 b7c783f6304eddbdf8f0dece4715d63cb9f453be89d97c8fba155d57.52455349+420 d030b626219d81673bd32932d2245e0c71ae5193281f971022b23a78.436172646f67656f+2 d1333653aa3ac24adfa9c6d09c1a2cc8e2b7b86ad334c17f2acb8647.42696f546f6b656e+50 f28f457472e539dc75e1598a2beddf49ce5a717998c708f05f5de610.44454653+666 ff97c85de383ebf0b047667ef23c697967719def58d380caf7f04b64.534f554c" \
--change-address ${destinationAddress} \
--out-file tx.raw
$ cardano-cli transaction sign \
–tx-body-file tx.raw \
–signing-key-file payment.skey \
–mainnet \
–out-file tx.signed
$ cardano-cli transaction submit \
–tx-file tx.signed \
–mainnet

That worked. Thank you so much. Do you think you could send me one for my other stake server JETT1 so I can get those other alt coins moved?

$ destinationAddress="<address you want to send to>"
$ cardano-cli transaction build --mainnet \
--tx-in 6fd3f3bdc7792bbe29c3e6fadcf6b6768ad17aeea8cf8f39d193f8a3a14edf61#4 \
--tx-in 44a47e17b59b3ae7b5c0b9ddca91c17478a7f6834851f79318d5de3d15f62b89#2 \
--tx-out "${destinationAddress}+4000000+2000000000 af2e27f580f7f08e93190a81f72462f153026d06450924726645891b.44524950+2 4247d5091db82330100904963ab8d0850976c80d3f1b927e052e07bd.546f6b68756e+50000000 5ad8deb64bfec21ad2d96e1270b5873d0c4d0f231b928b4c39eb2435.61646f736961+100 b7c783f6304eddbdf8f0dece4715d63cb9f453be89d97c8fba155d57.52455349+420 d030b626219d81673bd32932d2245e0c71ae5193281f971022b23a78.436172646f67656f+1 d1333653aa3ac24adfa9c6d09c1a2cc8e2b7b86ad334c17f2acb8647.42696f546f6b656e+6 b0446f1c9105f0cc5bb6bd092f5c3e523e13f8a999b31c870298fa40.51554944+25 f28f457472e539dc75e1598a2beddf49ce5a717998c708f05f5de610.44454653+20000 7f376e3d1cf52e6c4350a1a91c8f8d0f0b63baedd443999ebe8fe57a.424f52475a+1050 b34b3ea80060ace9427bda98690a73d33840e27aaa8d6edb7f0c757a.634e455441+3 d894897411707efa755a76deb66d26dfd50593f2e70863e1661e98a0.7370616365636f696e73+50 5029eeccd52fef299509d509a8318fd7930c3dffcce1f9f39ff11ef9.464743+333 ff97c85de383ebf0b047667ef23c697967719def58d380caf7f04b64.534f554c+1000 a4da8764a57e66a0085b5bfcde96c89b798d92ee83a75f59237e375b.46495245" \
--change-address ${destinationAddress} \
--out-file tx.raw
$ cardano-cli transaction sign --mainnet –tx-body-file tx.raw –signing-key-file payment.skey –out-file tx.signed
$ cardano-cli transaction submit --mainnet –tx-file tx.signed

Hope I got everything. …