[quote=“kriskind75, post:5, topic:58991, full:true”]
laplasz:
so there are couple of things:
The current slotno is 28026463 - so you have to define greater value in invalidHereafter
how did you calculated the txout and how did you build the transaction?
I calculated the current slot:
currentSlot=$(cardano-cli query tip --mainnet | jq -r ‘.slot’)
echo Current Slot: $currentSlot
Current Slot: 28030173
I queried my balance:
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}
Total ADA balance: 71179835618
Number of UTXOs: 1
I calculated the deposit fee:
stakePoolDeposit=$(cat $NODE_HOME/params.json | jq -r ‘.stakePoolDeposit’)
echo stakePoolDeposit: $stakePoolDeposit
stakePoolDeposit: 500000000
I build the raw transaction. I added 10.000 Slots to the current
cardano-cli transaction build-raw
${tx_in}
–tx-out $(cat payment.addr)+$(( ${total_balance} - ${stakePoolDeposit}))
–invalid-hereafter $(( ${currentSlot} + 10000))
–fee 0
–certificate-file pool.cert
–certificate-file deleg.cert
–out-file tx.tmp
no error
Minimum fee:
fee=$(cardano-cli transaction calculate-min-fee
–tx-body-file tx.tmp
–tx-in-count ${txcnt}
–tx-out-count 1
–mainnet
–witness-count 3
–byron-witness-count 0
–protocol-params-file params.json | awk ‘{ print $1 }’)
echo fee: $fee
fee: 196433
tx_out
txOut=$((${total_balance}-${stakePoolDeposit}-${fee}))
echo txOut: ${txOut}
txOut: 70679639185
build transaction:
cardano-cli transaction build-raw
${tx_in}
–tx-out $(cat payment.addr)+${txOut}
–invalid-hereafter $(( ${currentSlot} + 10000))
–fee ${fee}
–certificate-file pool.cert
–certificate-file deleg.cert
–out-file tx.raw
no errors
sign (on cold machine):
cardano-cli transaction sign
–tx-body-file tx.raw
–signing-key-file payment.skey
–signing-key-file $HOME/cold-keys/node.skey
–signing-key-file stake.skey
–mainnet
–out-file tx.signed
no error
send. in this step the error occured
cardano-cli transaction submit
–tx-file tx.signed
–mainnet
Transaction successfully submitted.
No it worked. Sorry for bothering you! But with your comments you forced me to go through the process step by step!!
Thanks again!!