Skip to content

Commit 66f26c3

Browse files
authored
CLI Doc: Update conway stake address registration (#1408)
* CLI Doc: Update conway stake address registration * CLI Doc: Standardized cardano-cli conway query * CLI Doc: Replace cli `conway` with `latest` * Revert "CLI Doc: Replace cli `conway` with `latest`" This reverts commit 85cbb20. * CLI Doc: Replace cli `conway` with `latest` in stakeaddress registration
1 parent 38e7836 commit 66f26c3

File tree

1 file changed

+24
-23
lines changed

1 file changed

+24
-23
lines changed

docs/get-started/cardano-cli/get-started/stakeaddress-registration.md

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,20 @@ keywords: [cardano-cli, cli, keys, stake addresses, register, cardano-node, tran
88
---
99

1010
:::tip
11-
To integrate the Conway era, which differs significantly from previous eras, `cardano-cli` has introduced `<era>` as a top-level command, replacing the former `<era>` flags. For example, instead of using era-specific flags like `--babbage-era` with commands such as `cardano-cli conway transaction build --babbage-era`, users must now utilize the syntax `cardano-cli conway transaction build <options>`.
11+
To integrate the latest (Conway) era, which differs significantly from previous eras, `cardano-cli` has introduced `<era>` as a top-level command, replacing the former `<era>` flags. For example, instead of using era-specific flags like `--babbage-era` with commands such as `cardano-cli transaction build --babbage-era`, users must now utilize the syntax `cardano-cli <era> transaction build <options>`.
1212
:::
1313

1414
## Registering a stake address
1515

16-
To participate in the protocol, such as delegating stake to a stake pool to earn rewards or, in the upcoming Conway era, delegating stake to a delegate representative, you must first register your stake credentials on the chain. This registration is accomplished by submitting a **stake address registration certificate** within a transaction. The process includes paying a deposit, the amount of which is determined by the `stakeAddressDeposit` protocol parameter. You can get the deposit back when you submit a **stake address deregistration certificate**.
16+
To participate in the protocol, such as delegating stake to a stake pool to earn rewards or, in the Conway era, delegating stake to a delegate representative, you must first register your stake credentials on the chain. This registration is accomplished by submitting a **stake address registration certificate** within a transaction. The process includes paying a deposit, the amount of which is determined by the `stakeAddressDeposit` protocol parameter. You can get the deposit back when you submit a **stake address deregistration certificate**.
1717

1818
Delegating to a stake pool also involves submitting a certificate to the chain, in this case, a **stake address delegation certificate**.
1919

20-
You can easily generate such certificates with `cardano-cli`. The corresponding commands can be found under `cardano-cli conway stake-address`:
20+
You can easily generate such certificates with `cardano-cli`. The corresponding commands can be found under `cardano-cli latest stake-address`:
2121

2222
```shell
23-
cardano-cli conway stake-address
24-
Usage: cardano-cli conway stake-address
23+
cardano-cli latest stake-address
24+
Usage: cardano-cli latest stake-address
2525
( key-gen
2626
| key-hash
2727
| build
@@ -43,15 +43,16 @@ Usage: cardano-cli conway stake-address
4343
Query the protocol parameters to find out the amount of lovelace required as a deposit for registering a stake address, in this case, it is 2000000 lovelace (two ada):
4444

4545
```shell
46-
cardano-cli conway query protocol-parameters | jq .stakeAddressDeposit
46+
cardano-cli latest query protocol-parameters | jq .stakeAddressDeposit
4747
2000000
4848
```
4949

5050
To generate the registration certificate, run:
5151

5252
```shell
53-
cardano-cli stake-address registration-certificate \
53+
cardano-cli latest stake-address registration-certificate \
5454
--stake-verification-key-file stake.vkey \
55+
--key-reg-deposit-amt 2000000 \
5556
--out-file registration.cert
5657
```
5758

@@ -75,8 +76,8 @@ It's important to note that when using `build`, the deposit is automatically inc
7576
### Using the `build` command
7677

7778
```shell
78-
cardano-cli conway transaction build \
79-
--tx-in $(cardano-cli query utxo --address $(< payment.addr) --output-json | jq -r 'keys[0]') \
79+
cardano-cli latest transaction build \
80+
--tx-in $(cardano-cli latest query utxo --address $(< payment.addr) --output-json | jq -r 'keys[0]') \
8081
--change-address $(< payment.addr) \
8182
--certificate-file registration.cert \
8283
--out-file tx.raw
@@ -144,7 +145,7 @@ Using the `build-raw` command involves a slightly more intricate process. Simila
144145
Query the balance of the `payment.addr`:
145146

146147
```shell
147-
cardano-cli conway query utxo --address $(< paymentstake.addr)
148+
cardano-cli latest query utxo --address $(< paymentstake.addr)
148149
TxHash TxIx Amount
149150
--------------------------------------------------------------------------------------
150151
0690c70f117281627fc128ede51b1fe762c2bbc15c2e3d4eff2101c9d2613cd8 0 9999834851 lovelace + TxOutDatumNone
@@ -154,7 +155,7 @@ cardano-cli conway query utxo --address $(< paymentstake.addr)
154155
You can leverage `jq` by having `cardano-cli` return the output in JSON:
155156

156157
```shell
157-
cardano-cli conway query utxo --address $(< paymentstake.addr) --output-json
158+
cardano-cli latest query utxo --address $(< paymentstake.addr) --output-json
158159
{
159160
"0690c70f117281627fc128ede51b1fe762c2bbc15c2e3d4eff2101c9d2613cd8#0": {
160161
"address": "addr_test1qp9khgeajxw8snjjvaaule727hpytrvpsnq8z7h9t3zeue2jrk54ttv0yj7llrfuhr66z4wynpcqxuqeln0jp9y70e0qvjewan",
@@ -170,23 +171,23 @@ cardano-cli conway query utxo --address $(< paymentstake.addr) --output-json
170171
```
171172
Using `jq` to parse that JSON
172173
```shell
173-
cardano-cli conway query utxo --address $(< payment.addr) --output-json | jq -r .[].value.lovelace
174+
cardano-cli latest query utxo --address $(< payment.addr) --output-json | jq -r .[].value.lovelace
174175
9999834851
175176
```
176177
:::
177178

178179
Query the protocol parameters:
179180

180181
```shell
181-
cardano-cli conway query protocol parameters --out-file pparams.json
182+
cardano-cli latest query protocol parameters --out-file pparams.json
182183
```
183184

184185
Draft the transaction to calculate its transaction fee:
185186

186187
```shell
187-
cardano-cli conway transaction build-raw \
188-
--tx-in $(cardano-cli query utxo --address $(< payment.addr) --output-json | jq -r 'keys[0]') \
189-
--tx-out $(< payment.addr)+"$(cardano-cli conway query utxo --address $(< payment.addr) --out-file /dev/stdout | jq -r .[].value.lovelace)" \
188+
cardano-cli latest transaction build-raw \
189+
--tx-in $(cardano-cli latest query utxo --address $(< payment.addr) --output-json | jq -r 'keys[0]') \
190+
--tx-out $(< payment.addr)+"$(cardano-cli latest query utxo --address $(< payment.addr) --out-file /dev/stdout | jq -r .[].value.lovelace)" \
190191
--fee 0 \
191192
--certificate-file registration.cert \
192193
--out-file tx.draft
@@ -195,7 +196,7 @@ cardano-cli conway transaction build-raw \
195196
Calculate the transaction fee, it is useful to assign the output to a variable (`fee`):
196197

197198
```shell
198-
cardano-cli conway transaction calculate-min-fee \
199+
cardano-cli latest transaction calculate-min-fee \
199200
--tx-body-file tx.draft \
200201
--protocol-params-file pparams.json \
201202
--tx-in-count 1 \
@@ -210,14 +211,14 @@ Calculate the change of the transaction. Note that the deposit is not explicitly
210211
Query the protocol parameters to get the deposit amount:
211212

212213
```shell
213-
cardano-cli conway query protocol-parameters | jq .stakeAddressDeposit
214+
cardano-cli latest query protocol-parameters | jq .stakeAddressDeposit
214215
2000000
215216
```
216217
Query the current balance of `payment.addr`:
217218

218219

219220
```shell
220-
cardano-cli conway query utxo --address $(< payment.addr) --output-json | jq -r .[].value.lovelace
221+
cardano-cli latest query utxo --address $(< payment.addr) --output-json | jq -r .[].value.lovelace
221222
9999834851
222223
```
223224

@@ -228,8 +229,8 @@ change=$((9999834851 - 171089 - 2000000))
228229
Build the transaction:
229230

230231
```shell
231-
cardano-cli conway transaction build-raw \
232-
--tx-in $(cardano-cli query utxo --address $(< payment.addr) --output-json | jq -r 'keys[0]') \
232+
cardano-cli latest transaction build-raw \
233+
--tx-in $(cardano-cli latest query utxo --address $(< payment.addr) --output-json | jq -r 'keys[0]') \
233234
--tx-out $(< payment.addr)+$change \
234235
--fee 171089 \
235236
--certificate-file registration.cert \
@@ -238,13 +239,13 @@ cardano-cli conway transaction build-raw \
238239
## Sign and submit the transaction
239240

240241
```shell
241-
cardano-cli conway transaction sign \
242+
cardano-cli latest transaction sign \
242243
--tx-body-file tx.raw \
243244
--signing-key-file payment.skey \
244245
--out-file tx.signed
245246
```
246247
```shell
247-
cardano-cli conway transaction submit \
248+
cardano-cli latest transaction submit \
248249
--tx-file tx.signed
249250
```
250251

0 commit comments

Comments
 (0)