Skip to content

Commit 3aaf367

Browse files
committed
Flare Stake Tool 4.1.2 updates
1 parent 6beafed commit 3aaf367

File tree

1 file changed

+106
-63
lines changed

1 file changed

+106
-63
lines changed

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

Lines changed: 106 additions & 63 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,78 @@ 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
482+
```
483+
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
509493
```
510494

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.
495+
</TabItem>
496+
497+
<TabItem value="partial" label="Claim Partial">
498+
499+
```plaintext
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+
510+
3. Decide the recipient address for the rewards - defaults to the address you used to connect to the Flare Stake Tool.
513511

514512
```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●●●●●●●●
513+
? Please enter the recipient address (default address is reward owner): 0x●●●●●●●●
517514
```
518515

519516
You are then asked to confirm the staking transaction on your hardware wallet.
520517

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
518+
```plaintext
519+
Using network: flare
520+
Creating claim transaction...
521+
Signing transaction...
522+
// highlight-next-line
523+
Transaction with hash 0x●●●●●●●● built and sent to the network
524+
```
525+
526+
## Transfer P-chain funds to another P-chain address
527+
528+
1. You can transfer P-chain funds to another P-chain address by selecting the **Transfer funds to another P-chain address** option:
529+
530+
```bash
531+
flare-stake-tool interactive
532+
```
533+
534+
```plaintext
535+
? What do you want to do?
536+
❯ Transfer funds to another P-chain address
537+
Claim staking rewards
538+
Quit
539+
```
540+
541+
2. Select the amount to transfer and the destination P-chain address:
542+
543+
```plaintext
544+
? Enter amount (in FLR): 100
545+
? Please enter the destination P-chain address: P-flare●●●●●●●●
546+
Using network: flare
547+
Fetching account from ledger...
548+
Creating transfer transaction...
526549
```
527550

528551
## Troubleshooting
@@ -555,19 +578,39 @@ Try the operation again after a while.
555578
Transfer operations require [an export and an import transaction](#move-funds-to-p-chain).
556579
If the export succeeds, but then the import fails, it looks like the funds have disappeared from both chains, but they are still retrievable.
557580

558-
Repeat the failed import operation manually:
581+
Import the funds using the interactive tool:
582+
583+
- If you are moving funds from the C-chain to the P-chain:
584+
585+
```bash
586+
flare-stake-tool interactive
587+
```
588+
589+
```plaintext
590+
? What do you want to do?
591+
❯ Import Funds (in case export fails for either P chain or C chain)
592+
```
593+
594+
```plaintext
595+
? Please select the destination chain to which you want to import your funds? (Use arrow keys)
596+
❯ P
597+
```
559598

560-
- If you are moving funds from the C-chain to the P-chain:
599+
- If you are moving funds from the P-chain to the C-chain:
561600

562-
```bash
563-
flare-stake-tool transaction importCP --ledger --blind
564-
```
601+
```bash
602+
flare-stake-tool interactive
603+
```
565604

566-
- If you are moving funds from the P-chain to the C-chain:
605+
```plaintext
606+
? What do you want to do?
607+
❯ Import Funds (in case export fails for either P chain or C chain)
608+
```
567609

568-
```bash
569-
flare-stake-tool transaction importPC --ledger --blind
570-
```
610+
```plaintext
611+
? Please select the destination chain to which you want to import your funds? (Use arrow keys)
612+
❯ C
613+
```
571614

572615
</details>
573616

0 commit comments

Comments
 (0)