SubQuery powers the next generation of Polkadot dApps by allowing developers to extract, transform and query blockchain data in real time using GraphQL. In addition to this, SubQuery provides production quality hosting infrastructure to run these projects in.
This subquery indexes the least staking amount required for a validator to be elected.
This is an example of using @polkadot/api
in the mapping function. Proofs:
- historical metadatas are correctly handled, registry, consts are swapped. (see maxNominatorRewardedPerValidator)
- Queries are restricted to the current processed block. (see validators and exposures)
- api.queryMulti is supported. (see activeEra, currentEra)
git clone https://github.com/subquery/subql-examples.git
cd validator-threshold
# Yarn
yarn
#NPM
npm install
#Yarn
yarn codegen
#NPM
npm run-script codegen
#Yarn
yarn build
#NPM
npm run-script build
#Yarn
yarn start:docker
#NPM
npm run start:docker
{
query{
validatorThresholds{
nodes{
leastStaked,
totalStaked
}
}
}
}