Skip to content

Commit d9f7d4d

Browse files
authored
fix(stake-tool): flare stake tool 4.1.2 updates (#799)
2 parents 2c74420 + 9ab3a0d commit d9f7d4d

File tree

1 file changed

+99
-57
lines changed

1 file changed

+99
-57
lines changed

docs/network/guides/using-flare-stake-tool.mdx

Lines changed: 99 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ keywords: [intermediate, solidity, smart-contract, flare-network]
77
sidebar_position: 9
88
---
99

10+
import Tabs from "@theme/Tabs";
11+
import TabItem from "@theme/TabItem";
12+
1013
Staking works by locking funds for a period of time to support a specific network validator. The guide details out how to stake using the [flare-stake-tool](https://github.com/flare-foundation/flare-stake-tool) CLI.
1114

1215
<details>
@@ -74,7 +77,7 @@ Install the following tools:
7477
| _| | | (_| | | | __/ ___) | || (_| | < __/ | |___| |___ | |
7578
|_| |_|\__,_|_| \___| |____/ \__\__,_|_|\_\___| \____|_____|___|
7679
77-
Version: 3.0.2
80+
Version: 4.1.2
7881
```
7982

8083
3. You can specify the account from which staking will take place in different ways - [using Ledger](#using-ledger-recommended) or [using a private key](#using-private-key).
@@ -220,7 +223,7 @@ It is highly recommended to [use Ledger](#using-ledger-recommended) instead.
220223
### Check validator info
221224

222225
1. Note down the `NodeID` of the validator you want to stake to:
223-
- If you created the validator, retrieve its `NodeID` by running:
226+
- If you created the validator, retrieve its `NodeID`, `publicKey` and `proofOfPossession` by running:
224227

225228
```bash
226229
curl \
@@ -278,6 +281,7 @@ It is highly recommended to [use Ledger](#using-ledger-recommended) instead.
278281
```plaintext
279282
? What do you want to do? Move assets from C-chain to P-chain
280283
? Enter amount (in FLR): 50000
284+
? Enter fees (in FLR): (1)
281285
```
282286

283287
:::warning[Transaction Fees]
@@ -295,19 +299,12 @@ It is highly recommended to [use Ledger](#using-ledger-recommended) instead.
295299
Using network: flare
296300
Fetching account from ledger...
297301
Creating export transaction...
298-
Using fee of 0.00028075 FLR
299-
Please review and sign the transaction on your ledger device...
300-
Sending transaction to the node...
301-
Transaction with id ●●●●●●●● sent to the node
302+
Transaction finalized!
302303
// highlight-next-line
303304
Please approve import transaction
304305
Using network: flare
305306
Fetching account from ledger...
306-
Creating export transaction...
307-
Please review and sign the transaction on your ledger device...
308-
Sending transaction to the node...
309-
Transaction with id ●●●●●●●● sent to the node
310-
Finished execution
307+
Creating import transaction...
311308
```
312309

313310
If you encounter any issues during this process, refer to the [Troubleshooting](#troubleshooting) section.
@@ -324,27 +321,9 @@ If you encounter any issues during this process, refer to the [Troubleshooting](
324321

325322
- If you are going to stake to another node (delegation), select **Delegate to a validator node** (You may need to scroll down to see this option).
326323

327-
:::info[First-time address registration.]
328-
329-
The first time you use the **Add a validator node** or **Delegate to a validator node** options you are asked to sign an additional transaction.
330-
This step is required so that staking rewards accrued on the P-chain can be claimed on the C-chain and participate in the wider ecosystem.
331-
332-
This procedure only needs to be done once per P-chain address:
333-
334-
```plaintext
335-
Checking Address Registration...
336-
No address found for key 0x●●●●●●●●
337-
Note: You need to register your wallet address before you can delegate your funds
338-
// highlight-next-line
339-
Please complete this registration transaction to proceed
340-
Submitting txn to the chain
341-
```
342-
343-
:::
344-
345324
2. You then need to provide the following information:
346325
- **amount**: Amount must be provided in FLR units.
347-
- **NodeID**, **start time** and **end time**: Use the values noted down from the [setup](#setup).
326+
- **NodeID** and **end time**: Use the values noted down from the [setup](#setup).
348327

349328
If you are adding a validator node, you also need to provide the proof of possession **BLS public key** and **BLS signature**.
350329

@@ -381,7 +360,6 @@ If you encounter any issues during this process, refer to the [Troubleshooting](
381360
? What do you want to do? Add a validator node
382361
? Enter amount (in FLR): 50000
383362
? Enter Node NodeId (E.g. NodeID-FQKTLuZHEsjCxPeFTFgsojsucmdyNDsz1): NodeID-●●●●●●●●
384-
? Enter start time(E.g. 1693185095): ●●●●●●●●
385363
? Enter end time(E.g. 1693185095): ●●●●●●●●
386364
? Enter delegation fee(E.g. 10): 10
387365
? Please enter the popBLSPublicKey: 0x●●●●●●●●
@@ -472,28 +450,22 @@ If you encounter any issues, refer to [Troubleshooting](#troubleshooting).
472450
Using network: flare
473451
Fetching account from ledger...
474452
Creating export transaction...
475-
Please review and sign the transaction on your ledger device...
476-
Sending transaction to the node...
477-
Transaction with id ●●●●●●●● sent to the node
453+
? Enter fees (in FLR): (1)
478454
// highlight-next-line
479455
Please approve import transaction
480456
Using network: flare
481457
Fetching account from ledger...
482-
Creating export transaction...
483-
Using fee of 0.00028075 FLR
484-
Please review and sign the transaction on your ledger device...
485-
Sending transaction to the node...
486-
Transaction with id ●●●●●●●● sent to the node
458+
Creating import transaction...
487459
Finished execution
488460
```
489461

490462
If you encounter any issues, refer to [Troubleshooting](#troubleshooting).
491463

492-
## Claiming rewards
464+
## Claiming staking rewards
493465

494466
At the end of every reward epoch, participants are rewarded according to how well their chosen validator performed in that period, but these rewards are not claimable yet. Every 4 reward epochs, rewards are accumulated in a dedicated smart contract and can then be claimed from the Flare Stake CLI tool:
495467

496-
1. Select the **Claim Rewards** option when executing:
468+
1. Select the **Claim staking rewards** option when executing:
497469

498470
```bash
499471
flare-stake-tool interactive
@@ -502,27 +474,77 @@ At the end of every reward epoch, participants are rewarded according to how wel
502474
You are shown the amount of pending rewards (in wei) and are asked how much you want to claim (in FLR):
503475

504476
```plaintext
505-
? What do you want to do? Claim Rewards
506-
Checking your Rewards status...
507-
You have unclaimed rewards worth 1000000000000000000
508-
? Enter amount to claim (in FLR): 1
477+
? What do you want to do? Claim staking rewards
478+
State of rewards for 0x●●●●●●●●:
479+
Total rewards: 2000.0 FLR
480+
Claimed rewards: 1010.0 FLR
481+
Unclaimed rewards: 990.0 FLR
509482
```
510483

511-
2. Select **Receive with another wallet** and enter the C-chain address where you want the rewards to be sent.
512-
This can be the same address from where you are staking.
484+
2. Claim all or a portion of the rewards and optionally choose to wrap them or not:
485+
486+
<Tabs groupId="claim" block>
487+
488+
<TabItem value="all" label="Claim All" default>
489+
490+
```plaintext
491+
? Do you want to claim all unclaimed rewards? (total unclaimed: 990.0 FLR) Yes
492+
? Should claimed rewards be wrapped? Yes
493+
```
494+
495+
</TabItem>
496+
497+
<TabItem value="partial" label="Claim Partial">
513498

514499
```plaintext
515-
? Where do you want to receive your rewards? Receive with another wallet
516-
? Please enter the C-address where you want to receive your rewards: 0x●●●●●●●●
500+
? Do you want to claim all unclaimed rewards? (total unclaimed: 990.0 FLR) No
501+
? Please enter the amount to claim: 100
502+
? Should claimed rewards be wrapped? Yes
503+
```
504+
505+
</TabItem>
506+
507+
</Tabs>
508+
509+
3. Decide the recipient address for the rewards - defaults to the address you used to connect to the Flare Stake Tool.
510+
511+
```plaintext
512+
? Please enter the recipient address (default address is reward owner): 0x●●●●●●●●
517513
```
518514

519515
You are then asked to confirm the staking transaction on your hardware wallet.
520516

521-
```text hl_lines="1"
522-
Please sign the transaction on your ledger
523-
Submitting txn to the chain
524-
Rewards successfully claimed
525-
Finished execution
517+
```plaintext
518+
Using network: flare
519+
Creating claim transaction...
520+
Signing transaction...
521+
// highlight-next-line
522+
Transaction with hash 0x●●●●●●●● built and sent to the network
523+
```
524+
525+
## Transfer P-chain funds to another P-chain address
526+
527+
1. You can transfer P-chain funds to another P-chain address by selecting the **Transfer funds to another P-chain address** option:
528+
529+
```bash
530+
flare-stake-tool interactive
531+
```
532+
533+
```plaintext
534+
? What do you want to do?
535+
❯ Transfer funds to another P-chain address
536+
Claim staking rewards
537+
Quit
538+
```
539+
540+
2. Select the amount to transfer and the destination P-chain address:
541+
542+
```plaintext
543+
? Enter amount (in FLR): 100
544+
? Please enter the destination P-chain address: P-flare●●●●●●●●
545+
Using network: flare
546+
Fetching account from ledger...
547+
Creating transfer transaction...
526548
```
527549

528550
## Troubleshooting
@@ -555,18 +577,38 @@ Try the operation again after a while.
555577
Transfer operations require [an export and an import transaction](#move-funds-to-p-chain).
556578
If the export succeeds, but then the import fails, it looks like the funds have disappeared from both chains, but they are still retrievable.
557579

558-
Repeat the failed import operation manually:
580+
Import the funds using the interactive tool:
559581

560582
- If you are moving funds from the C-chain to the P-chain:
561583

562584
```bash
563-
flare-stake-tool transaction importCP --ledger --blind
585+
flare-stake-tool interactive
586+
```
587+
588+
```plaintext
589+
? What do you want to do?
590+
❯ Import Funds (in case export fails for either P chain or C chain)
591+
```
592+
593+
```plaintext
594+
? Please select the destination chain to which you want to import your funds? (Use arrow keys)
595+
❯ P
564596
```
565597

566598
- If you are moving funds from the P-chain to the C-chain:
567599

568600
```bash
569-
flare-stake-tool transaction importPC --ledger --blind
601+
flare-stake-tool interactive
602+
```
603+
604+
```plaintext
605+
? What do you want to do?
606+
❯ Import Funds (in case export fails for either P chain or C chain)
607+
```
608+
609+
```plaintext
610+
? Please select the destination chain to which you want to import your funds? (Use arrow keys)
611+
❯ C
570612
```
571613

572614
</details>

0 commit comments

Comments
 (0)