- Builds a comprehensive Sui blockchain validator analytics tool using Python and the pysui library with Chainstack node endpoints.
- Analyzes validator commission rates, stake distribution, and network decentralization metrics directly from on-chain data.
- Provides interactive search functionality to explore individual validators and their detailed metadata including names, descriptions, and URLs.
- Demonstrates how all validator data (financial metrics, operational data, and branding materials) is stored and accessible on-chain without external APIs.
Overview
In this tutorial, weโll build a simple analytics tool for the Sui blockchain network using Python and thepysui
library. Our script will analyze validator performance metrics, commission rates, stake distribution, and provide interactive search capabilities for exploring the validator ecosystem.
The Sui network relies on a proof-of-stake consensus mechanism where validators secure the network and process transactions.
Our analytics tool will provide insights into:
- Validator commission rates and distribution.
- Stake concentration across validators.
- Network epoch information.
- Individual validator details and search functionality.
Prerequisites
- pysui - Python SDK for Sui blockchain
- A Chainstack Sui Mainnet node endpointโregister on Chainstack
Implementation
Our script connects to the Sui blockchain through a Chainstack endpoint and retrieves comprehensive validator data directly from the chain. The Sui network stores all validator information on-chain, including not just technical metrics like stake amounts and commission rates, but also metadata such as validator names, descriptions, website URLs, and even profile images. Using thepysui
library, we fetch the current system state which contains the complete list of active validators and their properties. This includes financial data (stake balances, commission rates), operational data (voting power, gas prices), and presentation data (names, descriptions, project URLs, image URLs). The script processes this on-chain data to generate analytics on commission rate distributions, stake concentration, and provides search functionality to explore individual validators.
The beauty of this approach is that all the data comes directly from the blockchainโthereโs no need for external APIs or databases. Everything from validator performance metrics to their branding materials is stored on-chain and accessible through our Chainstack node endpoint.
The script:
Usage examples
Running the analytics tool
-
Install dependencies:
-
Configure your Chainstack endpoint:
Replace
CHAINSTACK_NODE_URL
in the script with your actual Chainstack Sui mainnet endpoint. -
Run the script: