Skip to main content
Version: mainnet (v0.76)

Set up a block explorer

A Vega block explorer is a powerful tool for navigating and understanding the blockchain. It is an essential component for anyone looking to interact with a blockchain network, especially if you want to explore transaction history, monitor network activity, or verify the integrity of the blockchain's data.

The source code for the block explorer is part of the Vega binary, and is available on the GitHub repo. The application provides users a comprehensive view of the Vega network through REST and gRPC APIs.

The Vega block explorer offers transaction tracking so you can search using transaction IDs, public keys, or other relevant criteria.

Combining the block explorer API with the Tendermint API gives you much more information about the Vega network, and this guide describes how to set that up.

Block explorer design

The Vega block explorer is strictly related to Tendermint, and the block explorer sources all data from the Tendermint database.

Tendermint has two back-ends for indexing transactions, KV and psql but only psql is supported by the Vega block explorer.

The psql indexer lets an operator enable block and transaction event indexing by proxying it to an external PostgreSQL instance, allowing events to be stored in relational models. Since the events are stored in a relational database management system, operators can leverage SQL to perform a series of rich and complex queries that are not supported by the KV indexer.

Since operators can leverage SQL directly, searching is not enabled for the psql indexer type via Tendermint's RPC - any such query will fail.

Tendermint config change

You will need to change the default value in the Tendermint configuration to use psql.


  • A non-validator node that is already set up
  • PostgreSQL database running
  • Optional web server for proxing requests like Nginx or Caddy

This guide does not cover PostgreSQL installation. Please see:


If you want your block explorer to include the full chain history, you must replay the entire chain from block 0. Do not modify the config of any already-running nodes. If you do not need full network history, you can start your non-validator node from the last remote snapshop. Read more detailed instructions below.

PostgreSQL with Docker

You can start PostgreSQL with Docker. To do that, use the following command:

docker volume create block-explorer-postgres-volume

docker run \
--name block-explorer-postgres \
-e PGDATA=/var/lib/postgresql/data/pgdata \
-e POSTGRES_DB=tendermint_db \
-v block-explorer-postgres-volume:/var/lib/postgresql/data \
-p 5432:5432 \
-d postgres

You should be able to use the following credentials in your configs:

  • Host:
  • Post: 5432
  • Username: postgres
  • Password: vega
  • Database name: tendermint_db

Full history vs specific history span

As described in the limitations section, for full chain history your node must replay from block 0. The replay process for entire network history may take a week or longer.

If you don't need full chain history, you can start your node from a specific remote snapshot (block height). Each validator node creates snapshots every few hundred blocks. The exact number is defined by a network parameter, so the exact number may change.

To start your node from a snapshot, you need access to a node that has the specific snapshot you want to use. Example mainnet nodes/endpoints you can use to find snapshots are:

To do this, see the instructions to start a node using snapshots.

Publicly available nodes

You may find more publicly available nodes on the GitHub repository.

Tendermint limitations

Due to limitations of the Tendermint, you can only restart the network from block 0 or the ten last snapshots.

We recommend selecting the latest possible snapshots for restart. If the setup process takes too long and the snapshot is not in the pool of the last ten snapshots, you need to choose a newer snapshot again.

Set up a block explorer

1. Download Vega and Visor binary

Download the Vega binary from the Vega release page.

You have to download the binary for the specific version in which the network has been started from block 0. For mainnet, that binary is v0.71.4.


Unzip it and confirm the version.


./vega version
Vega CLI v0.71.4 (61d1f77ee360bf1679d5eb0e0efdb1cce977c9db)

./visor version
Vega Visor CLI v0.71.4 (61d1f77ee360bf1679d5eb0e0efdb1cce977c9db)

2. Initiate non-validator node

Because you're using a non-valdiator node, you do not need to initiate the Vega Wallet software, nor do you need an Ethereum node.

mkdir vega_home tendermint_home blockexplorer_home

./visor init --home ./vegavisor_home
./vega init --home ./vega_home full
./vega tm init --home ./tendermint_home
./vega blockexplorer init --home ./blockexplorer_home

3. Download the genesis file

You need to download the genesis.json file and put it in the Tendermint home.

wget --output-document ./tendermint_home/config/genesis.json

4. Update the Visor config file

The config file is located at: YOUR_VEGAVISOR_HOME/config.toml. Update the maximum number of retries to the value below.

maxNumberOfFirstConnectionRetries = 43200

5. Update the Visor run-config for genesis binary

Replace the entire contents of the genesis config file located at: YOUR_VEGAVISOR_HOME/genesis/run-config.toml, with the following:

name = "genesis"

path = "vega"
args = [
socketPath = "/tmp/vega.sock"
httpPath = "/rpc"

Link the genesis folder YOUR_VEGAVISOR_HOME/current


6. Copy Vega binary to config directory for Visor

The following command will copy the whole Vega binary to the current config directory so your node can use Visor for upgrades.

cp ./vega YOUR_VEGAVISOR_HOME/current/vega

Make sure the version is correct:

./vegavisor_home/current/vega version
Vega CLI v0.71.4 (61d1f77ee360bf1679d5eb0e0efdb1cce977c9db)

7. Update block explorer config

Update the following parameters in the block explorer config file located at: PATH_TO_YOUR_BLOCK_EXPLORER_HOME/config/blockexplorer/config.toml. Leave all other parameters with their default values.

Port = 5432
SocketDir = ""

8. Update the Tendermint config

Update the following parameters in the Tendermint config file located at PATH_TO_YOUR_TENDERMINT_HOME/config/config.toml:

cors_allowed_origins = ["*"]

max_incoming_connection_attempts = 100
seeds = "b0db58f5651c85385f588bd5238b42bedbe57073@,da2c4771f2aec1749cbc8db545b2af89099cdcb7@,13ce7373381072bc575566e702fabef0db64ffdb@,5d02699874ea6a1e14df948b2e9f1198d23b95a7@,abe207dae9367995526812d42207aeab73fd6418@,198ecd046ebb9da0fc5a3270ee9a1aeef57a76ff@,80fda55eeaa6036e5b61c11b423b073681a2b6b4@,211e435c2162aedb6d687409d5d7f67399d198a9@,c5b11e1d819115c4f3974d14f76269e802f3417b@,e2379bca600a528de55e845b77de5ff480c9631c@,0a972d61a57532ea8b521b01238bdf125fcd52b1@,9bcebff7664a3310bf4b31a76e5547f44ffb94cc@,61051c21f083ee30c835a34a0c17c5d1ceef3c62@"
persistent_peers = ""
unconditional_peer_ids = ""
max_packet_msg_payload_size = 16384
send_rate = 20000000
recv_rate = 20000000
pex = true
private_peer_ids = ""
allow_duplicate_ip = false

version = "v1"
size = 10000
cache_size = 20000
max_batch_bytes = 10485760

rpc_servers = ",,,"
trust_period = "744h0m0s"
discovery_time = "30s"
chunk_request_timeout = "30s"

timeout_prevote = "1s"
timeout_precommit = "1s"
timeout_commit = "0s"
skip_timeout_commit = true
create_empty_blocks = true
create_empty_blocks_interval = "1s"

discard_abci_responses = true

indexer = "psql"
index_all_keys = false

Snapshot restart

When you restart from the remote snapshot at specific block, also include the following values:

enable = true

In step 1 of this tutorial, we selected the following sample values:

enable = true
trust_hash = "11a12f24de801d8c21dae5372e3914a05d15fe15a1316276d7af27896127d246"
trust_height = 18591101

9. Update Vega config

You do not need to modify this config file if you start from block 0.

10. Init the block explorer database

The vega blockexplorer init-db command creates a database schema and prepares all indexes to optimise the database for the block explorer API.

./vega blockexplorer init-db --home ./blockexplorer_home 

11. Start Vega node with Visor command

./visor run --home ./vegavisor_home

Wait a few minutes until your node starts processing blocks before going on to the next step.

See the code snippets below to set up systemd for your Vega node.

Replay time

It will take at least several hours to replay entire network.

12. Start the block explorer service

./vega blockexplorer start --home ./blockexplorer_home

13. Verify the block explorer works

curl -s localhost:1515/rest/transactions | jq

You should get a non-empty response to the above command.

14. Restore config changes to default value

You do not need to execute this step for replaying from block 0.

Useful code snippets

Systemd for Visor

The config file is usually located at: /lib/systemd/system/vegavisor.service. You can change the details of the config sections below for your setup.




Systemd for block explorer

The config file is usually located at: /lib/systemd/system/blockexplorer.service. You can change the details of the config sections below for your setup.




Caddy config

The Caddy file provides TLS termination for the Tendermint and block explorer APIs.

order replace after encode

servers {
} {
# (gRPC is direct to 3002)

# REST core
route / {
reverse_proxy http://localhost:3003
route /* {
reverse_proxy http://localhost:3003

# Block Explorer
route /grpc* {
reverse_proxy http://localhost:1515

route /rest* {
reverse_proxy http://localhost:1515

# Tendermint
route /status {
reverse_proxy http://localhost:26657

route /genesis {
reverse_proxy http://localhost:26657

route /blockchain {
reverse_proxy http://localhost:26657

route /validators {
reverse_proxy http://localhost:26657

route /block {
reverse_proxy http://localhost:26657

route /tx_search {
reverse_proxy http://localhost:26657

route /unconfirmed_txs {
reverse_proxy http://localhost:26657

route /websocket {
@websockets {
header Connection *Upgrade*
header Upgrade websocket
reverse_proxy @websockets localhost:26657

route /* {
reverse_proxy http://localhost:3003