Registering a stake address

Can someone please show an example of how to do this.
For example - if I need to include the "keyDeposit": 400000, amount in the transaction.
where do i do that? do I add 400000 to the fee? or do i simply minus 400000 from the amount returned to the Output?

For example if I have an UtXO with balance of 2000000000
and I pay a fee of 200000
and the key deposit is 400000
should I build the transaction like this?

cardano-cli shelley transaction build-raw
–tx-in 89290f1e6871dbbeb2d1521a169834ac1f81882604340f458d2bce483b9ba4e0#1
–tx-out $(cat ~/stake-keys/owner_payment_1.addr)+1994000000
–ttl 618000
–fee 200000
–certificate-file ~/certs/owner_stake_1.cert
–out-file tx3.raw \

or like this:

cardano-cli shelley transaction build-raw
–tx-in 89290f1e6871dbbeb2d1521a169834ac1f81882604340f458d2bce483b9ba4e0#1
–tx-out $(cat ~/stake-keys/owner_payment_1.addr)+1994000000
–ttl 618000
–fee 600000
–certificate-file ~/certs/owner_stake_1.cert
–out-file tx3.raw \

?

There is a fine example in the tutorials exercises, see https://github.com/input-output-hk/cardano-tutorials/blob/master/Shelley-testnet/Exercise-4.md and https://github.com/input-output-hk/cardano-tutorials/blob/master/Shelley-testnet/solutions/Exercise-4-solutions.md.

The IOHK.vkey in the example is the pool vrf key you want to delegate to.

This is if you just want a stake address to delegate to a pool, if you are creating a pool, follow instead https://github.com/input-output-hk/cardano-tutorials/blob/master/node-setup/020_keys_and_addresses.md#stake-address and
https://github.com/input-output-hk/cardano-tutorials/blob/master/node-setup/050_register_key.md.

1 Like

Thanks.
Also - for anyone else having problems with this- I found this tutorial which finally allowed me to get my pool up and running:


(This was the only tutorial I have found that clearly explains how to register the pool and make the pledge - the title is a bit misleading “Register a Stake Pool with Metadata” - if you scroll to the bottom you find all the details about how to build the raw transactions and certs needed to make the pool pledge) Thanks to all the great people who have made these tutorials.
1 Like