How to Stake on Zeitgeist
Head to polkadot.js to control your account's staking.
Get the List of Candidates
Choose Developer > Chain state
Choose
parachainStaking
Choose
candidatePool(): ParachainStakingSetOrderedSetBond
Click
+
to make a queryCopy the candidate address that you want to delegate your tokens to
Get the Candidate Delegation Count
Choose Developer > Chain state
Choose
parachainStaking
Choose
candidateInfo(AccountId32): Option<ParachainStakingCandidateMetadata>
Paste the collator candidate's address
Enable the "include option"
Click
+
to make a queryGet the number of delegationCount
Get the Number of Existing Delegations
Choose Developer > JavaScript and copy the following code to the editor box:
// Simple script to get your number of existing delegations.
// Remember toreplace YOUR_ADDRESS_HERE with your delegator address.
const yourDelegatorAccount = 'YOUR_ADDRESS_HERE';
const delegatorInfo = await api.query.parachainStaking.delegatorState(yourDelegatorAccount);
console.log(delegatorInfo.toHuman()["delegations"].length);
Replace
YOUR_ADDRESS_HERE
with your addressClick Run button
Get the number of existing delegations
Check the Amount You Can Stake
You have a balance which consists of transferrable, locked and reserved tokens. You can only stake transferrable tokens. To see the amount of transferrable tokens, check the Accounts page:
Stake Your Tokens
Choose Developer > Extrinsics.
Choose the account you would like to delegate your tokens to
Choose
parachainStaking
Choose
delegate(candidate, amount, candidateDelegationCount, delegationCount)
Copy the candidate's address to delegate (the one you get from "Get the list of candidates" step)
Specify the amount that you would like to stake. The amount is given in Pennocks, which means you need to multiply the amount in ZTG by , so if you want to stake 1 ZTG, you should fill in
10000000000
Enter the
delegationCount
from Get the Candidate Delegation CountEnter the number of existing delegations from Get the Number of Existing Delegations (if you did not stake before, then enter
0
)
Check the Stake Result
Once the transaction is confirmed, you can check the result on the Accounts page:
Click the triangle button
You can see the reserved balance
How to Stop Delegations
Schedule Request to Stop Delegations
Choose Developer > Extrinsics.
Select the account you want to execute the revocation for
Choose
parachainStaking
Choose
scheduleRevokeDelegation(collator)
Select the account you want to remove the delegation for
Submit this transaction
Execute Request to Stop Delegations
Choose Developer > Extrinsics.
Select the account you want to execute the revocation
Choose
parachainStaking
Choose
executeDelegationRequest
Select the delegator's address
Select the account you want to remove the delegation for
Submit this transaction
Remove All Ongoing Delegations
Choose Developer > Extrinsics.
Select the account you want to remove all delegations for
Choose
parachainStaking
Choose
executeLeaveDelegators
Select the account you want to remove all delegations for
Enter the total number that you have delegated. To check the number, see Get the Number of Existing Delegations
Submit this transaction
Verify Your State
You can verify whether your delegation was removed by following step:
Choose Developer > Chain state.
Choose
parachainStaking
Choose
delegatorState
Select your account
Enable the "Include option"
Click the
+
Your latest result
Cancel Request to Stop Delegations
Choose Developer > Extrinsics.
Select your account
Choose
parachainStaking
Choose the
cancelDelegationRequest
or thecancelLeaveDelegators
, depending on whether your scheduled the request viascheduleRevokeDelegation
orscheduleLeaveDelegators
Enter the candidate's address
Submit this transaction