Staking & Unstaking Your Validator Node
Staking SHM enables your validator to actively participate in the Shardeum network and earn rewards. Unstaking allows you to withdraw your staked SHM along with any accumulated rewards. This guide provides step-by-step instructions for managing staking and unstaking operations using the operator-cli
tool.
Step 1: Staking Your Node
Once your validator node is running and in the need-stake
state, you can stake SHM to it.
Command:
- Replace
<AMOUNT>
with the amount of SHM you want to stake (e.g.,operator-cli stake 2400
). - The minimum stake amount is 2400 SHM on stagenet. If you stake less, you'll receive an error like:
Stake amount is less than minimum required stake amount
Important Considerations for Staking
- Cooldown Period: A 30-minute cooldown follows a successful stake before staking again from the same wallet.
stakeable.restakeAllowed: false
andstakeable.reason: 'Stake lock period active'
will indicate this.stakeable.remainingTime
will show the remaining time in milliseconds.
- Sufficient Funds: Ensure your wallet has enough SHM for the stake plus transaction fees.
- Network Health: Network issues may cause timeouts such as
AxiosError: timeout of 2000ms exceeded
.
After Staking
- Node state transitions:
need-stake → waiting-for-network → standby → active
. - Check
nominatorAddress
andlockedStake
viaoperator-cli status
.
Unstaking Your Node
Unstaking removes SHM from your validator and claims accumulated rewards.
Command:
Correct Unstaking Sequence
-
Wait for Standby:
- The node must be in
standby
state. - If on a small test network, it may go directly to
active
. Wait for it to complete its cycle.
- The node must be in
-
Stop the Node:
Confirm: “Node process stopped”.
-
Check Stake Lock Time: via
operator-cli status
:stakeState.unlocked
should betrue
.stakeState.remainingTime
should be0
.
-
Unstake:
Unstaking Considerations
- Node State is Key: Must be
standby
and stopped. - CLI Behavior:
- Older versions may appear stuck due to retry logic.
- "No stake found" could mean a previous attempt succeeded.
- Transaction Confirmation:
- Transactions are not instant. Verify status via the explorer.
- Force Unstaking: Only for emergencies; may incur penalties.
Common Errors
- No stake found: Wallet has no associated stake or previous unstake succeeded.
- Wrong node state: Node not yet ready for unstaking.
- Timestamp out of range: Possibly due to clock mismatch.
- RPC error (code 101): Inspect detailed error message.
Recovering Stake from a Lost/Deleted Node
- Stake is linked to the wallet and nominee public key.
- Use another validator with the original wallet’s private key to unstake.
- Refer to "Programmatic Unstaking & Disaster Recovery" for full instructions.
Unstaking a Shardeum Node Without the App Interface
This guide explains unstaking using direct API calls.
Prerequisites
- Wallet’s private key and address
- Tools:
curl
, Node.js,ethers.js
Step 1: Get Active Nodes
Example response:
Step 2: Check Stake Info
Step 3: Can You Unstake?
Response includes:
stakeUnlocked.unlocked
stakeUnlocked.reason
stakeUnlocked.remainingTime
Step 4: Submit Unstake Transaction
Create and sign transaction using a script.
Technical Details
- To address:
0x0000000000000000000000000000000000010000
- Transaction data:
Complete Script Example
To Use This Script
- Save as
unstake-shardeum.js
- Install dependencies:
- Update configuration
- Run:
By following these steps, you’ll be well equipped to manage staking and unstaking operations for your Shardeum validator node.