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.

Current architecture Dec 2022 (will change soon)

indexer_simple

Steps to run locally

Prerequisites

Steps

  1. DB setup
# DB setup, run the following commands from the /sui-indexer folder
# .env file under /sui-indexer is required for diesel cmds
# in .env file, DATABASE_URL should point to your local PG server
# an example is:
# DATABASE_URL="postgres://postgres:postgres@localhost/gegao"
diesel setup

# and then run 
diesel migration run
  1. checkout the latest devnet commit by running commands below, otherwise API version mismatch could cause errors
git fetch upstream devnet
git reset --hard upstream/devnet
  1. Go to sui/crates/sui-indexer and run the following command:
# DATABASE_URL should be the same value as above
cargo run --bin sui-indexer -- --db-url "<DATABASE_URL>" --rpc-client-url "https://fullnode.devnet.sui.io:443"

Clean up and re-run

  • Run diesel migration revert under /sui-indexer until no more tables are deleted;
  • Also delete __diesel_schema_migrations, you can do this via Postico client