Skip to content

Latest commit

 

History

History

sui-indexer

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Sui indexer is an off-fullnode service to serve data from Sui protocol, including both data directly generated from chain and derivative data.

Architecture

enhanced_FN

Steps to run locally

Prerequisites

Steps

  1. DB setup, under sui/crates/sui-indexer run:
# an example DATABASE_URL is "postgres://postgres:postgres@localhost/gegao"
diesel setup --database-url="<DATABASE_URL>"
diesel migration run --database-url="<DATABASE_URL>"
  1. Checkout devnet
git fetch upstream devnet && git reset --hard upstream/devnet
  1. Start indexer binary, under sui/crates/sui-indexer run:
# Change the RPC_CLIENT_URL to http://0.0.0.0:9000 to run indexer against local validator & fullnode
cargo run --bin sui-indexer -- --db-url "<DATABASE_URL>" --rpc-client-url "https://fullnode.devnet.sui.io:443"

DB reset in case of restarting indexer

diesel database reset --database-url="<DATABASE_URL>"

Integration test

Integration tests in the integration_tests.rs will be run by GitHub action as part of the CI checks to run the test locally, start a Postgresql DB and run the test using following command:

POSTGRES_PORT=5432 cargo test --package sui-indexer --test integration_tests --features pg_integration

Note: all existing data will be wiped during the test.