This repository contains Ansible roles and playbooks to deploy saga chainlet services. E.g.: Blockscout, RPC nodes, etc.
Blockscout is an open-source blockchain explorer platform that provides an intuitive web interface for viewing and analyzing blockchain data such as transactions, blocks, token balances, validator activity, and contract details. It supports EVM-compatible networks—including Saga chainlets—enabling both developers and users to monitor activity, interact with smart contracts, and gain insights into chain health. This repository automates the deployment and customization of Blockscout services for your chain using Ansible and Kubernetes.
What you get
- Kubernetes manifests rendered from Jinja2 templates
- One-command deploy via Ansible
- Customizable resources and frontend settings via role defaults or per-chain overrides
Requirements
- Ansible 2.15+ and Python 3.9+
- kubectl access to your target Kubernetes cluster
- Ansible Kubernetes + Helm collections
Install collections
ansible-galaxy collection install -r ansible/collections/requirements.ymlQuick start (sagaevm example)
- Copy and adjust the sample variables:
cp ansible/samples/sagaevm-5464-1.yml ./my-explorer.ymlEdit ./my-explorer.yml to match your environment (kubeconfig path, namespaces, hosts, RPC URLs).
- Deploy:
ansible-playbook -i localhost, -e @./my-explorer.yml ansible/playbooks/deploy-explorer.ymlThat playbook will:
- Install/upgrade CloudNativePG operator and a Postgres cluster (by default single-node)
- Apply Blockscout common resources, indexer, backend, frontend and stats
Per-component deploy Use tags to deploy a subset:
# Only database operator/cluster
ansible-playbook -i localhost, -e @./my-explorer.yml ansible/playbooks/deploy-explorer.yml -t postgres
# Only Blockscout frontend
ansible-playbook -i localhost, -e @./my-explorer.yml ansible/playbooks/deploy-explorer.yml -t blockscout_frontend
# Backend + indexer only
ansible-playbook -i localhost, -e @./my-explorer.yml ansible/playbooks/deploy-explorer.yml -t blockscout_backend,blockscout_indexerVariables you likely want to set
- kubeconfig_file: Path to your kubeconfig
- blockscout_chain_id: Identifier for your chainlet (e.g. sagaevm_ssc-1)
- blockscout_namespace: Namespace for explorer components
- pg_namespace: Namespace for Postgres
- blockscout_host: Base host for the explorer frontend
- blockscout_backend_host: API host for backend (defaults to
api-{{ blockscout_host }}) - blockscout_json_rpc: Public RPC URL used by the frontend
- blockscout_ethereum_jsonrpc_http_url / _ws_url / _trace_url: RPC endpoints used by backend/indexer
Sample for Saga EVM
See ansible/samples/sagaevm-5464-1.yml for a ready-to-use example. It sets sensible defaults for namespaces, hosts, and RPC.
Notes
- The defaults in
ansible/roles/blockscout/defaults/main.ymlare tuned for a modest deployment. Override in your vars file as needed. - If your chainlet RPC runs inside the same cluster, you can keep the internal defaults; otherwise, point the RPC variables to public endpoints.
- Postgress deployment is controlled by the variable
pg_type. Default isnone, so you will have to provide a working postgres db. Alternatively, it can be deployed assingleorha.