Skip to content

oasisprotocol/nexus

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

9b2fe79 · Dec 15, 2022
Dec 7, 2022
Dec 14, 2022
Dec 15, 2022
Dec 9, 2022
Dec 14, 2022
Dec 7, 2022
Jun 3, 2022
Oct 6, 2022
Oct 6, 2022
Sep 1, 2022
Dec 14, 2022
Dec 14, 2022
Dec 7, 2022
Oct 6, 2022
Jun 3, 2022
Oct 19, 2022
Oct 6, 2022
Jun 3, 2022
Jun 14, 2022
Dec 7, 2022
Oct 19, 2022
Jun 3, 2022
Dec 6, 2022
Nov 24, 2022
Nov 24, 2022
Aug 18, 2022

Repository files navigation

Oasis Indexer

ci-lint ci-test

The official indexer for the Oasis Network.

Docker Development

You can create and run the Oasis Indexer with docker compose. Keep reading to get started, or take a look at our Docker docs for more detail.

Configuration

Download the current network's genesis document to the docker/node/etc directory. You will need this to run the Oasis Node container.

Build

From the repository root, you can run:

$ make docker

Run

From the repository root, you can run:

$ make start-docker

The analyzer will run DB migrations on start (i.e. create empty tables) based on files in storage/migrations.

Query

Now you can query the Oasis Indexer API

$ curl -X GET http://0.0.0.0:8008/v1

For a full list of endpoints see our API docs.

Local Development

Below are instructions for running the Oasis Indexer locally, without Docker.

Oasis Node

You will need to run a local node for development purposes. You will need to set the Unix socket in the config/local-dev.yaml file while running an instance of the Oasis Indexer. For example, this will be unix:/node/data/internal.sock in Docker.

Note: A newly created node takes a while to fully sync with the network. The Oasis team has a node that is ready for internal use; if you are a member of the team, ask around to use it and save time.

Database

You will need to run a local PostgreSQL DB.

For example, you can start a local Docker instance of Postgres with:

make postgres

and later browse the DB with

make psql

Indexer

You should be able to make oasis-indexer and run ./oasis-indexer --config config/local-dev.yml from the repository root. This will start the analyzers and the HTTP server, but you can start each of the constituent services independently as well. See ./oasis-indexer --help for more details.

Once the indexer has started, you can query the Oasis Indexer API

$ curl -X GET http://localhost:8008/v1

Debugging note: A lot of indexing happens when parsing the genesis data. To see what SQL statements genesis is converted into, run oasis-indexer with CONSENSUS_DAMASK_GENESIS_DUMP=/tmp/genesis.sql. The SQL will be written to the indicated file, provided that genesis hasn't been parsed into the DB yet. The easiest way to achieve the latter is to wipe the DB.