Skip to content

Commit

Permalink
Expanded on CLI tools in "Becoming a Validator" (#1436)
Browse files Browse the repository at this point in the history
* added cli to procedure

* added multiple options

* refactored using cli

* combined using block explorer and cli

* rebase

* rebase

* minor fixes

* minor fix

* Update entering-staking.adoc
  • Loading branch information
LandauRaz authored Nov 26, 2024
1 parent 83ba638 commit 41e6255
Showing 1 changed file with 45 additions and 19 deletions.
64 changes: 45 additions & 19 deletions components/Starknet/modules/staking/pages/entering-staking.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -22,30 +22,56 @@ For more information on what happens during the staking process, see xref:archit
* A Starknet-compatible xref:tools:ref-block-explorers.adoc[block explorer] or xref:tools:devtools/clis.adoc[CLI tool].
* Sufficient STRK token balance in your wallet.
+
[TIP]
[NOTE]
====
For validators who wish to use a secure hardware wallet, the https://www.ledger.com/[Ledger hardware wallet] is supported by both https://www.argent.xyz/blog/ledger-argent-integration/[Argent] and https://braavos.app/wallet-features/ledger-on-braavos/[Braavos] wallets.
====

.Procedure (using a block explorer)
.Procedure

. Approve the STRK ERC20 contract for the transfer of tokens from your address to the staking contract:
+
.. Using a Starknet block explorer, navigate to the STRK contract by searching for xref:tools:important-addresses.adoc#fee_tokens[its address].
. If you are using a block explorer:
.. Navigate to the STRK contract by searching for xref:tools:important-addresses.adoc#fee_tokens[its address]
.. In the contract interface, locate and select the `approve` function.
.. Enter the following parameters:
* In *`spender`*, enter the xref:overview.adoc#staking_contract[staking contract's address].
* In *`amount`*, enter the number of STRK tokens you want to stake (note the xref:overview.adoc#economic_parameters[minimum stake for validators] and that STRK has 18 decimals).
.. Submit the transaction to execute the approval.
. Using a Starknet block explorer, navigate to the staking contract by searching for xref:overview.adoc#staking_contract[its address].
. In the contract interface, locate and select the `stake` function.
. Enter the following parameters:
+
* In *`reward_address`*, enter the address where the rewards will be sent.
* In *`operational_address`*, enter the address that xref:overview.adoc#first_stage[in the future] will be used for block attestations and sequencing.
* In *`amount`*, enter the number of STRK tokens you want to stake (note the xref:overview.adoc#economic_parameters[minimum stake for validators] and that STRK has 18 decimals).
* In *`pool_enabled`*, enter `1` (true) if you wish to enable delegation pooling, otherwise enter `0` (false).
* In *`commission`*, enter the commission rate for any delegated staking. The rate should be entered as a percentage with precision, where 10000 represents 100%. For example, to set a 5% commission, you would enter 500.
. Submit the transaction to execute the staking operation.
. Pre-approve the STRK ERC20 contract for the transfer of tokens from your address to the staking contract by invoking its `approve` function with the following parameters:
* In the first parameter (`spender`), enter the xref:overview.adoc#staking_contract[staking contract's address].
* In the second parameter (`amount`), enter the number of STRK tokens you want to stake (note the xref:overview.adoc#economic_parameters[minimum stake for validators] and that STRK has 18 decimals).

[TIP]
====
If you using Starkli as CLI tool, the following example, which approves the STRK contract to transfer 1 STRK to the staking contract on Sepolia, can be used as reference:
[source,bash]
----
starkli invoke 0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d approve \
0x03745ab04a431fc02871a139be6b93d9260b0ff3e779ad9c8b377183b23109f1 u256:1000000000000000000 \
--network=sepolia
----
====

[start=3]
. If you are using a block explorer:
.. Navigate to the staking contract by searching for xref:overview.adoc#staking_contract[its address].
.. In the contract interface, locate and select the `stake` function.
. Invoke the staking contract's `stake` function with the following parameters:
* In the first parameter (`reward_address`), enter the address where the rewards will be sent.
* In the second parameter (`operational_address`), enter the address that xref:overview.adoc#first_stage[in the future] will be used for block attestations and sequencing.
* In the third parameter (`amount`), enter the number of STRK tokens you want to stake (note the xref:overview.adoc#economic_parameters[minimum stake for validators] and that STRK has 18 decimals).
* In the fourth parameter (`pool_enabled`), enter `1` (true) if you wish to enable delegation pooling, otherwise enter `0` (false).
* In the fifth parameter (`commission`), enter the commission rate for any delegated staking. The rate should be entered as a percentage with precision, where 10000 represents 100%. For example, to set a 5% commission, you would enter 500.

[TIP]
====
If you are using Starkli as CLI tool, the following example, which stakes 1 STRK with delegation pooling enabled and 1% commission on Sepolia, can be used as reference:
[source,bash]
----
starkli invoke 0x03745ab04a431fc02871a139be6b93d9260b0ff3e779ad9c8b377183b23109f1 stake \
<reward_address> <operational_address> 1000000000000000000 1 100 \
--network=sepolia
----
====

[start=5]
. Register your validator on link:https://forms.gle/BUMEZx9dpd3DcdaT8[Karnot's], link:https://stakingrewards.typeform.com/to/aZdO6pW7[Staking Rewards'], and link:https://forms.gle/WJqrRbUwxSyG7M9x7[Voyager's] dashboards.

0 comments on commit 41e6255

Please sign in to comment.