How to Inquiry and Operate on- chain

When encountering issues during Delegate and Mining, you can check out on- chain module to inquiry and operate.
Khala Network address: Polkadot/Substrate Portal

Reminder: All Khala data can be retrieved on your own, please DO NOT believe rumors.

Searching for Information

To find out whether the Worker is on-chain/on-chain confidence level:

Developer->Chain state->phalaRegistry->workers(WorkerPublicKey):Option
Type in the woker-public-key to get Worker’s on- chain information. confidenceLevel is your Worker’s confidence level and initialScore is your on- chain performance score.

Total number of Workers

open Delegate | Phala App , sort by Worker
OR open Polkadot/Substrate Portal
select ChainState under Developer,select phalaMining on the left and OnlineMiners on the right. Click on + for result

Total number of total token mined

open Polkadot/Substrate Portal
select ChainState under Developer, select phalaMining on the left and miners (Accountid) on the right. Remove option and click on + for results

Total number of StakePool

Developer-> Chain state-> phalaStakePool->poolCount()

For Owner of StakePool: Delegator list information and number

Developer->Chain state->phalaStakePool->poolStakers(u64,AccountId)
Type in StakePool pid and select Stakepool owner’s account to get information

To find out your total Delegation

Developer->Chain state->phalaStakePool->stakeLedger(AccountId):Option

For detailed information on a specific StakePool(Delegated, Free Delegation, Process fee, worker list etc.)

Developer->Chain state->phalaStakePool->Option

Number of current online Worker

Developer->Chain state->phalaMining->onlineMiners()

For a list of V- value list

Developer->Chain state->phalaMining->miners: Option

For delegation details

Developer->Chain state->phalaMining->stakes: Option

Operation Guide

Creating StakePool


Staking $PHA

pid is the StakePool pid and amount is number of $PHA you are staking

Setting StakePool commission ratio

pid is the StakePool pid, payout-commission is the share ratio (i.e. if you set ratio as 50% then you need to type in 500000)

Setting StakePool cap

pid is the StakePool pid, cap is the staking cap

Adding Worker to the StakePool

pid is the StakePool pid, pubkey is Worker’s public key

Starting Staking for Worker on-chain

pid is the StakePool pid, worker is Worker’s public key, and stake is the number of Staking

Stop mining for Worker on- chain

pid is the StakePool pid, worker is Worker’s public key

Removing Worker from StakePool


Claiming Mining reward

pid is the StakePool pid, target is the specific account you want the reward to transfer to

Withdrawing tokens from a StakePool

pid is the StakePool pid, shares is the number of token you wish to withdraw

More functions are coming…