Polkascan Development Update #6
Polkascan Account Module
Our mission is to make multi-chain data accessible and understandable. With the Polkascan project we are working towards a multi-chain exploration and data analytic platform for the Polkadot-ecosystem. This development update is part of our work that extends Polkascan with a rich account-module. The new features offered by this grant work allow for data exploration and data discovery from the account’s perspective. This project was funded by Web3 Foundation. Through Polkascan Foundation we offer a hosted version of our multi-chain explorer: polkascan.io.
1. Getting started
This development update will help you get started by running the sixth milestone release of Polkascan OS yourself.
1.1. Polkascan on Github
Repositories: The source code of Polkascan OS can be found at our Github organization. This organization consists of a number of distinct repositories which collectively form Polkascan OS. We apply a number of conventions for branches and versioned releases across these Polkascan OS repositories.
Branches: Each repository has our most recent work in the master-branch.
Releases: This development update’s work is released and tagged as ‘v0.6.x’.
1.2. What makes Polkascan?
Polkascan consists of a number of distinct software artifacts which collectively orchestrate Polkascan. The Harvester transforms a Substrate node’s raw data into relational data, with the help of Substrate Interface Library and the SCALE Codec Library. The produced relational data is disseminated by the Explorer API and in turn made accessible to end users by the Explorer GUI. We provide full Docker support for all our artifacts, hence all our repositories have Dockerfiles in their root.
Although these five distinct components of Polkascan could be applied independently (even in other projects), we offer a sixth piece of software, called Polkascan OS that glues together all these components with Docker Compose.
1.3. Requirements
- Recommended hardware: Memory: >8GB (more is better), Storage: >100GB (SSD is better), Processor: more and faster cores is better (Intel i7 quad core), Bandwidth: more and faster is better (>20 Mbps). These requirements will go down as the project matures.
- Software requirements: Git, Docker & Docker Compose.
- Deployment of Polkascan has been tested on Mac, Linux and Windows.
- The Explorer GUI has been tested on Safari, Firefox, Chrome, Edge and Brave.
1.4. Quick deployment of Polkascan
This paragraph provides a step-by-step guide on running our milestone 6 release of Polkascan OS on your own machine. Please note that this section provides instructions for a quick deployment of Polkascan OS. This quick deployment instruction builds and runs Polkascan Explorer GUI and utilizes the API endpoints hosted by Polkascan Foundation. Instructions for a full deployment of Polkascan OS can be found in the next sections of this document.
- Clone the repository:
git clone https://github.com/polkascan/polkascan-os.git
- Go to the new folder:
cd polkascan-os
- Check available releases:
git tag
- Checkout the latest release in the v0.6.x range (replace ‘x’ with highest number):
git checkout v0.6.x
- Initialize and update submodules:
git submodule update --init --recursive
- Build and initialize the other containers:
docker-compose -p kusama -f docker-compose.kusama-quick.yml up --build
- The Explorer GUI should now be available in a browser: http://127.0.0.1:8080
1.5. Full deployment of Polkascan
This paragraph provides a step-by-step guide on running our milestone 6 release of Polkascan OS on your own machine. This full deployment instruction builds and runs the full Polkascan OS stack. In addition to the Polkascan Explorer GUI, this instruction also runs a Substrate-node, a MySQL DBMS, the Polkascan Harvester, and the Polkascan Explorer API. Please note that fully syncing the Kusama network with a Substrate node and harvesting all required data into a relational database may take up to a full week of work on a heavy machine. Section 1.4 provides a convenience method to only run the user-interface and rely on the databases hosted by Polkascan Foundation.
- Clone the repository:
git clone https://github.com/polkascan/polkascan-os.git
- Go to the new folder:
cd polkascan-os
- Check available releases:
git tag
- Checkout the latest release in the v0.6.x range (replace ‘x’ with highest number):
git checkout v0.6.x
- Initialize and update submodules:
git submodule update --init --recursive
- Build and initialize the MySQL container:
docker-compose -p kusama -f docker-compose.kusama-full.yml up -d mysql
- Build and initialize the other containers:
docker-compose -p kusama -f docker-compose.kusama-full.yml up --build
- The Explorer GUI should now be available in a browser: http://127.0.0.1:8080
- The Database should now be accessible via your favorite tool:
docker-Host: 127.0.0.1
Port: 33061
Database: polkascan
Username: root
Password: root
1.6. Cleaning up
The following [docker] commands should help you clean up.
- Stop all containers of the Docker Compose file.
docker-compose -p kusama -f docker-compose.kusama-quick.yml down
docker-compose -p kusama -f docker-compose.kusama-full.yml down - Remove all unused containers, volumes and images.
docker system prune
[confirm] Y - Remove all containers and images.
docker system prune -a
[confirm] Y - Remove all volumes.
docker volume prune
[confirm] Y
2. Accounts, identities & roles
This section dives into the enhancements we made to the Polkascan platform, related to accounts, their respective identities and their respective roles.
2.1. Account details
The account detail page lists a number of useful attributes, related to balances, identities and roles. Identities are attributes that are voluntarily set by accounts. In general these identities are useful for accounts that serve a public function, such as: validators, council members, technical committee members, etc.
2.2. Account transactions
An account can submit many types of transactions to the chain. The transaction-tab on the account detail page lists all transactions that have been submitted by the respective account. The details button will navigate to the transaction detail page.
2.3. Account identities
If an account has an on-chain identity set, the user-interface displays this identity everywhere. We have implemented the Polkadot Human-Interface Guidelines to the best of our ability.
2.4. Account roles
Various special roles can be identified based on the account’s on-chain activity. The Polkascan platform classifies accounts as: validator, nominator, council member, technical committee member, registrar, treasury or sudo.
Various shortcuts have been added to the Accounts-menu to filter accounts based on their current role.
2.5. Account lifecycle
An account has a lifecycle. In general an account exists in the state of the chain if it has a balance above the so-called existential deposit. The account-lifecycle tab shows the events when an account is first created and when an account is removed. The details button will navigate to the event detail page.
2.6. Identity activity
An account’s identity has a lifecycle. In general an identity is set, changed or removed and a Registrar can provide a judgement of the identity. The identity-activity tab shows the events when those identity-related activities occur. The details button will navigate to the event or transaction detail page.
3. Staking, validators and nominators
This section dives into the enhancements we made to the Polkascan platform, related to accounts, specifically related to staking, validators and nominators.
3.1. Staking activity
An account’s staking activity is displayed on the staking activity tab. The tab shows various staking related events and extrinsics, such as: bonding activity, changing payout settings, and specifically for validators when validation activities commence. The details button will navigate to the event or transaction detail page.
Additionally for nominators the staking activity tab displays when a nominator changes its nominees. The details button will navigate to the event or transaction detail page.
3.2. Staking sessions
An account’s staking activity takes place in a session. The sessions in which staking activities have taken place are listed in descending order on the staking sessions tab. The details button will navigate to the event or transaction detail page.
3.3. Authored blocks
A validator produces blocks. The authored blocks tab lists all blocks that have been produced by the respective account in descending order. The details button will navigate to the event or transaction detail page.
3.4. Slash events
A validator or nominator could get slashed. The slash events tab lists all slash events for the respective account in descending order. The details button will navigate to the event or transaction detail page.
3.5. ImOnline activity
A validator is required to be online for block production. The imonline activity tab lists all events when a validator is reported as offline. This tab does not show any heartbeat events. The details button will navigate to the event or transaction detail page.
4. Democracy, council & technical committee
This section dives into the enhancements we made to the Polkascan platform, related to accounts, specifically related to democracy, council and technical committee.
4.1. Proposal activity
Any account can make a democracy proposal. The proposal activity tab lists all occurrences when an account creates or seconds a proposal.The details button will navigate to the event or transaction detail page.
4.2. Referendum activity
Any account can cast a vote on a democracy referendum. The referendum activity tab lists all the account’s votes on referenda. The details button will navigate to the event or transaction detail page.
4.3. Election activity
Council members are elected through an elections process. Any account can vote on candidate council members. The election activity tab lists all the account’s votes both from the active perspective as from the passive perspective. The details button will navigate to the event or transaction detail page.
4.4. Council terms
Elected council members serve a council term. The council terms tab lists all the council member’s council terms in descending order. The details button will navigate to the event or transaction detail page.
4.5. Council activity
Elected council members are authorized to propose and vote on council motions. The council activity tab lists all the council member’s council activity in descending order. The details button will navigate to the event or transaction detail page.
4.6. Treasury activity
Any account can make a treasury spending proposal. The treasury activity tab lists all the account’s proposals for treasury spendings. The details button will navigate to the event or transaction detail page.
4.7. Technical committee activity
Technical committee members have a limited number of special authorizations in on-chain governance. The techcomm activity tab lists all the technical committee member’s activity in descending order. The details button will navigate to the event or transaction detail page.
5. Balances
This section dives into the enhancements we made to the Polkascan platform, related to account balances.
5.1. Balance transfers
The balance transfers tab lists a balance transfer activity. This includes regular account-to-account balance transfers but also block author deposits and claims. The details button will navigate to the event or transaction detail page.
5.2. Balance history
The balance history tab shows a graph that plots the balance history. This particular example shows the balance history for one of the exchanges that offers a KSM trading pair.
5.3. Balance ranking
The accounts menu offers an overview page of accounts ranked on balance in descending order, effectively serving as a rich-list.
About Polkascan
Polkascan contributes to the Polkadot ecosystem by providing block exploration and data analytic technologies. We will continue providing updates to our multi-chain explorer platform polkascan.io through our not-for-profit organization Polkascan Foundation.
The following public resources enable tracking of progress of the project: Medium, Twitter & GitHub. We encourage you to reach out if you would like to collaborate especially if you intend to be a Substrate implementer or ecosystem service provider. You can find us on the Riot channels on a daily basis. Come say hello and talk to us on how to get involved.