Using any graphical based wallet it's trivial to delegate to a stake pool. How do you accomplish this same task using only CLI tools (e.g. cardano-cli)?
1 Answer
You can use cardano-cli to delegate.
First, make sure your stake address is registered on chain. If it isn't already and you want to do it from cardano-cli, you must first build the stake-address registration certificate:
cardano-cli stake-address registration-certificate \
--stake-verification-key-file <STAKE.VKEY_FILEPATH> \
--out-file <STAKE_ADDRESS_REGISTRATION_CERTIFICATE_FILE>
Submitting this certificate (if you haven't already) will cost 2 ADA as a deposit (which you can then reclaim if you de-register the stake address).
Next, construct a delegation certificate for the pool you wish to delegate to:
cardano-cli stake-address delegation-certificate \
--stake-verification-key-file <STAKE.VKEY_FILEPATH> \
--stake-pool-id <BECH32_OR_HEX-encoded_STAKEPOOL_ID> \
--out-file <DELEGATION_CERTIFICATE_FILEPATH> \
You may then submit these two certificates in a single transaction. If your stake address is already registered on chain you can skip the registration cert and only construct/submit the delegation cert.
For further clarification regarding this and/or signing/submitting these certs as transaction, I'd recommend the CoinCashew Guide, specifically the section on pool registration.
-
-
The CoinCashew Guide appears helpful but falls short because it's instructing on how to create a new stake pool instead of delegating to an existing stake pool.– prunmitApr 3, 2022 at 10:19
-
<STAKE>VKEY_FILEPATH> is just a placeholder name for where in your filesystem the stake verification key is located. Also, yes the guide is more involved than simple delegation, but manual delegation is part of the guide and can be used for more than just creating pools.– zheksonApr 3, 2022 at 12:50
-
I still don't understand where the stake verification key comes from. I've tried going through the guide and was unsuccessful because it's incomplete.– prunmitApr 3, 2022 at 13:43
-
1