All tools
Chain Sight
Fetch validator and governance proposal data into PostgreSQL from the command line
View on GitHub
Best forbuilding chain datasets
Overview
Chain Sight is a command-line tool for fetching blockchain data — validators and governance proposals — and storing it in a PostgreSQL database.
Chain endpoints are imported once from a JSON file into the database; after that, validator or governance data for any configured chain can be fetched with a single command, ready for queries, dashboards and reports.
Key Features
- Fetch validators — Retrieve validator data for a configured chain.
- Fetch governance proposals — Retrieve governance proposal data for a configured chain.
- Manage chain configurations — Import chain configurations from a JSON file and display what is stored in the database.
- PostgreSQL storage — All fetched data is written to PostgreSQL.
- Logging — Console and file logging with a configurable log file and level.
Installation
Database
- Set up a PostgreSQL database.
- Create a .env file with the connection string, e.g. DATABASE_URL=postgresql://user:password@localhost/chain_sight_db
git clone https://github.com/ChainTools-Tech/chain_sight.git
cd chain_sight
pip install -r requirements.txtChain Configuration
chains.json lists the chains to work with and their endpoints:
{
"chains": [
{
"name": "Beezee",
"chain_id": "beezee-1",
"prefix": "bze",
"rpc_endpoint": "https://rpc.beezee.chaintools.tech",
"api_endpoint": "https://api.beezee.chaintools.tech",
"grpc_endpoint": "https://grpc.beezee.chaintools.tech"
}
]
}Workflow
1. Import chain configurations
chain_sight --config import --config-path /path/to/chains.json2. Display stored configurations
chain_sight --config display3. Fetch validator data
chain_sight --fetch validators --chain beezee-14. Fetch governance proposals
chain_sight --fetch governance --chain beezee-1Options
| Option | Description |
|---|---|
--config import|display | Import chain configurations from JSON, or display those stored in the database |
--config-path | JSON file to import (with --config import) |
--fetch validators|governance | Fetch validator or governance proposal data |
--chain | Chain ID to fetch for; must match an imported configuration |
--log-file | Log file path (default chain_sight.log) |
--log-level | DEBUG, INFO (default), WARNING, ERROR or CRITICAL |
Related Resources
- Full documentation — Requirements, installation and usage on docs.chaintools.tech
- PostgreSQL documentation — The database Chain Sight writes to
- Cosmos SDK documentation — Validator and governance modules
Need something custom?
We build tooling and automation for node operators and chain teams, and can help you deploy or adapt this tool to your setup.
