Error sending TX

Hi guys,
I am getting an error when submitting the transaction to pay the pool deposit fee. I have recreated the transaction 3 times but still receive an error;
Error while submitting tx: ApplyTxError [LedgerFailure (DelegsFailure (DelplFailure (DelegFailure (StakeDelegationImpossibleDELEG

I was able to successfully send the registration transaction.
TIA

1 Like

Hi Steve,

Something is not right. Can you share the details of the stake address registration transaction and what you are trying to submit for your pool registration transaction?

Your friend, FROG

1 Like

Hi,
Thanks for your reply. For the stake address registration I just followed step 11, Would you like me to paste each command here?

For the pool registration transaction I did the following;

cardano-cli shelley stake-pool registration-certificate
–cold-verification-key-file $HOME/cold-keys/node.vkey
–vrf-verification-key-file vrf.vkey
–pool-pledge 176738000000
–pool-cost 345000000
–pool-margin 0.02
–pool-reward-account-verification-key-file stake.vkey
–pool-owner-stake-verification-key-file stake.vkey
–mainnet
–single-host-pool-relay rn1.aussie-stakehouse.io
–pool-relay-port 6000
–metadata-url https://tinyurl.com/y5wu28x3
–metadata-hash fab2c081984bb0645fd5d4ee0e37f342777b060b53202a3ed5bb2b38f27bebfc
–out-file pool.cert

Hi Steve,

The error implies your stake address was not registered correctly.

Can you please provide the terminal build and sign commands you used to do that (obfuscate any sensitive data)? I don’t have visibility into the specific documentation you are using.

Thank you - FROG

Hi Frog,
Thanks for the advice. I retried the stake registration transaction steps but received a different error. Please see below for commands and output.
cardano@vmi433015:~/cardano-my-node$ cardano-cli shelley query utxo \

--address $(cat payment.addr) \
--mainnet > fullUtxo.out

cardano@vmi433015:~/cardano-my-node$
cardano@vmi433015:~/cardano-my-node$ tail -n +3 fullUtxo.out | sort -k3 -nr > balance.out
cardano@vmi433015:~/cardano-my-node$
cardano@vmi433015:~/cardano-my-node$ cat balance.out
3ee5e871ea4a3a853ecebb0a701183718e42f1d9effa15cdea52266a8686b607 0 176738442668
9de598d3a9722c7482aa25f8d73e51a28e05b8225a0a03d02e062a41e95ec1e0 0 97821299
cardano@vmi433015:~/cardano-my-node$
cardano@vmi433015:~/cardano-my-node$ tx_in=“”
cardano@vmi433015:~/cardano-my-node$ total_balance=0
cardano@vmi433015:~/cardano-my-node$ 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
TxHash: 3ee5e871ea4a3a853ecebb0a701183718e42f1d9effa15cdea52266a8686b607#0
ADA: 176738442668
TxHash: 9de598d3a9722c7482aa25f8d73e51a28e05b8225a0a03d02e062a41e95ec1e0#0
ADA: 97821299
cardano@vmi433015:~/cardano-my-node$ txcnt=$(cat balance.out | wc -l)
cardano@vmi433015:~/cardano-my-node$ echo Total ADA balance: ${total_balance}
Total ADA balance: 176836263967
cardano@vmi433015:~/cardano-my-node$ echo Number of UTXOs: ${txcnt}
Number of UTXOs: 2
cardano@vmi433015:~/cardano-my-node$ keyDeposit=$(cat $NODE_HOME/params.json | jq -r ‘.keyDeposit’)
cardano@vmi433015:~/cardano-my-node$ echo keyDeposit: $keyDeposit
keyDeposit: 2000000
cardano@vmi433015:~/cardano-my-node$ cardano-cli shelley transaction build-raw
${tx_in}
–tx-out $(cat payment.addr)+0
–ttl $(( ${currentSlot} + 10000))
–fee 0
–out-file tx.tmp
–certificate stake.cert
cardano@vmi433015:~/cardano-my-node$ fee=$(cardano-cli shelley transaction calculate-min-fee
–tx-body-file tx.tmp
–tx-in-count ${txcnt}
–tx-out-count 1
–mainnet
–witness-count 2
–byron-witness-count 0
–protocol-params-file params.json | awk ‘{ print $1 }’)
cardano@vmi433015:~/cardano-my-node$ echo fee: $fee
fee: 182045
cardano@vmi433015:~/cardano-my-node$ txOut=$((${total_balance}-${keyDeposit}-${fee}))
cardano@vmi433015:~/cardano-my-node$ echo Change Output: ${txOut}
Change Output: 176834081922
cardano@vmi433015:~/cardano-my-node$ cardano-cli shelley transaction build-raw
${tx_in}
–tx-out $(cat payment.addr)+${txOut}
–ttl $(( ${currentSlot} + 10000))
–fee ${fee}
–certificate-file stake.cert
–out-file tx.raw
cardano@vmi433015:~/cardano-my-node$ cardano-cli shelley transaction submit
–tx-file tx.signed
–mainnet
Error while submitting tx: ApplyTxError [LedgerFailure (DelegsFailure (DelplFailure (DelegFailure (StakeKeyInRewardsDELEG (KeyHashObj (KeyHash “da93a69dd5cdc1551596d621cc616167182186968e3eb80b5d0ef5ee”))))))]
cardano@vmi433015:~/cardano-my-node$

Thanks again for your assistance!

Hi Steve,

Something is wrong with your scripting - possibly the ttl slot number (meaning potentially the node may not be in sync or some other error is in play).

I would recommend crafting the transaction manually if you can. This will give you a good idea how everything works under the hood. Let me know if you need help here.

Regards,

ADAfrog

Thanks for the reply. I’ll do as you recommended & let you know how I go.

Awesome, Steve. I’ll be here.

1 Like

Hi frog,
Do you have a link for steps to drafting the transaction manually. I’ve attempted to do it using step 3.3 of this guide;
https://docs.cardano.org/projects/cardano-node/en/latest/stake-pool-operations/simple_transaction.html

Below is the commands I used to generate payment address UTXO details;
cardano@vmi433015:~/cardano-my-node$ cardano-cli shelley query utxo \

–address $(cat payment.addr)
–mainnet
TxHash TxIx Lovelace


3ee5e871ea4a3a853ecebb0a701183718e42f1d9effa15cdea52266a8686b607 0 176738442668
9de598d3a9722c7482aa25f8d73e51a28e05b8225a0a03d02e062a41e95ec1e0 0 97821299

cardano@vmi433015:~/cardano-my-node$ cat payment.addr
addr1q809przfldfkn0fvlw7qeqatvcmdgc06pryzj75a35zqafpe0nyy8njhach0tmltc2zrhz4saq7rpsuqyglvuu64wleqcpdhfu

Below is what I used to generate the transaction.
cardano-cli shelley transaction build-raw
–tx-in 3ee5e871ea4a3a853ecebb0a701183718e42f1d9effa15cdea52266a8686b607#0
–tx-out addr1q809przfldfkn0fvlw7qeqatvcmdgc06pryzj75a35zqafpe0nyy8njhach0tmltc2zrhz4saq7rpsuqyglvuu64wleqcpdhfu+176834081922
–ttl 6830620
–fee 200569
–out-file tx.draft

Does the transaction look correct?

TIA

Nice work, Steve!

You’re really close - you just need to attach your stake certificate and tweak your math for the top utxo only (txout amount should equal starting amount from a single utxo - 2000000 stake address deposit - transaction fee):

Here’s an example:

create stake certification file

cardano-cli shelley stake-address registration-certificate
–staking-verification-key-file stake.vkey
–out-file stake.cert

build transaction

cardano-cli shelley transaction build-raw
–tx-in [utxo-to-withdraw-from]#[TxIx]
–tx-out $(cat payment.addr)+[utxo starting balance - 200000 - 2000000]
–ttl 7000000
–fee 200000
–out-file tx.raw
–certificate-file stake.cert

sign transaction

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

submit

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

Let me know if this helps!

Your friend, FROG

1 Like

Hi,
It definitely helped but I am still unable to send the transaction. I am able to generate the tx.raw and tx.signed but not send it. I receive the following error;
ApplyTxError [LedgerFailure (DelegsFailure (DelplFailure (DelegFailure (StakeKeyInRewardsDELEG

I used the following to generate the tx.raw

cardano-cli shelley transaction build-raw
–tx-in 3ee5e871ea4a3a853ecebb0a701183718e42f1d9effa15cdea52266a8686b607#0
–tx-out $(cat payment.addr)+176736242668
–ttl 7000000
–fee 200000
–out-file tx.raw
–certificate-file stake.cert

The figure at the end of tx-out is utxo starting balance-200000-2000000

Please also send me your cardano wallet address so I can send you a small tip for being so patient & helpful!

Hi Steve,

From what I’ve seen this is either a ttl error (but yours looks ok), or perhaps the stake address was already registered successfully. Can you see whether or not the ~2.xxx ADA is missing from your payment address originally used? This would imply the stake address is registered and we can proceed to the pool registration.

If not, can you do a separate test and recreate payment/stake addresses and try registering a brand new stake address using the commands you have built? But make sure you don’t overwrite any of you existing keys (change the name to payment2/stake2, etc). You can use the same payment address to pay for the transaction so you don’t need to fund it again.

Alternatively, if we feel the stake address is correctly registered, you could proceed to register the pool to see what happens.

No need for tips - though I truly appreciate the gesture.

Your friend, FROG

2 Likes

Thanks Frog. I have recreated the transaction but I an now receiving a different error.
option --tx-out: Failed reading: takeWhile1

Below is what I’m using to generate the transaction;

cardano-cli shelley transaction build-raw
–tx-in a6f1cb3be4cb696c979926db226ba02312a66c54e0e00a89d1f559d2a09409bb#0
–tx-out $(cat payment.addr)+[176836000000-200000-2000000]
–ttl 7000000
–fee 200000
–out-file tx.raw
–certificate-file stake.cert

TIA

Hi Steve,

Try this:

cardano-cli shelley transaction build-raw
–tx-in a6f1cb3be4cb696c979926db226ba02312a66c54e0e00a89d1f559d2a09409bb#0
–tx-out $(cat payment.addr)+176833800000
–ttl 7500000
–fee 200000
–out-file tx.raw
–certificate-file stake.cert

Your friend, FROG

Thanks for the reply. I did as you recommended but unfortunately it failed too.
Error while submitting tx: ApplyTxError [LedgerFailure (DelegsFailure (DelplFailure (DelegFailure (StakeKeyInRewardsDELEG (KeyHashObj (KeyHash “da93a69dd5cdc1551596d621cc616167182186968e3eb80b5d0ef5ee”))))))]

I’ve raised a case with IOGB. I’m happy to wipe the BP node and start again if you think it will help?

Are you missing 2 ADA by chance (would have been from registering the payment address)? Just trying to figure out if you registered the stake address already in your original script.

You don’t need to wipe the bp node, buy have you tried with a different new stake address? You can use the same payment address as before to pay for the transaction, but create a whole new set of addresses starting with payment2.vkey/skey, payment2.addr and then generate stake keys, address and cert from there.

No I’m not missing 2 ADA unfortunately. Yes I tried with a different stake address today but I’ll give it another go.
Thanks

ok good to know - make sure to rebuild the stake.cert file too from the newly created stake address files

and make sure you backup your existing private keys to your payment address to avoid overwriting those

FROG

Thanks for the suggestions. I have recreated keys & transaction multiple times but I’m still unable to send it. Any other suggestions? IOGB haven’t responded to my ticket yet.
Thanks

Thanks, Steve.

If you are unable to get the transaction to submit for a separate address, I can only assume there’s something awry with the transaction itself.

Can you provide the steps, in sequence as to what you are doing? You are working on mainnet, correct?

Also, the current slot number is above 7,000,000 now as an FYI, so make sure that was set higher (incorrect ttl is a common reason for this error).

You can determine current slot via:

cardano-cli shelley query tip --mainnet

Your friend, FROG