{"id":20060650,"url":"https://github.com/oasisprotocol/nexus","last_synced_at":"2025-05-05T15:33:21.066Z","repository":{"id":37612716,"uuid":"459692084","full_name":"oasisprotocol/nexus","owner":"oasisprotocol","description":"Official indexer for the Oasis Network.","archived":false,"fork":false,"pushed_at":"2025-04-30T11:21:36.000Z","size":122750,"stargazers_count":16,"open_issues_count":70,"forks_count":4,"subscribers_count":17,"default_branch":"main","last_synced_at":"2025-04-30T12:56:17.536Z","etag":null,"topics":["blockchain","crypto","database","db","indexer","network","oasis","official","postgres","postgresql"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oasisprotocol.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-02-15T18:00:33.000Z","updated_at":"2025-04-24T06:21:27.000Z","dependencies_parsed_at":"2023-09-22T07:28:10.488Z","dependency_job_id":"47e59c0a-a933-44f5-a30c-083e8668ebb0","html_url":"https://github.com/oasisprotocol/nexus","commit_stats":{"total_commits":1486,"total_committers":18,"mean_commits":82.55555555555556,"dds":0.5767160161507403,"last_synced_commit":"98c1587185c93a705015eb1b1bc74088dce53cbc"},"previous_names":["oasisprotocol/nexus","oasisprotocol/oasis-indexer","oasislabs/oasis-indexer"],"tags_count":81,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oasisprotocol%2Fnexus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oasisprotocol%2Fnexus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oasisprotocol%2Fnexus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oasisprotocol%2Fnexus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oasisprotocol","download_url":"https://codeload.github.com/oasisprotocol/nexus/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252524294,"owners_count":21762071,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blockchain","crypto","database","db","indexer","network","oasis","official","postgres","postgresql"],"created_at":"2024-11-13T13:16:10.873Z","updated_at":"2025-05-05T15:33:16.057Z","avatar_url":"https://github.com/oasisprotocol.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Oasis Nexus\n\n[![ci-lint](https://github.com/oasisprotocol/nexus/actions/workflows/ci-lint.yaml/badge.svg)](https://github.com/oasisprotocol/nexus/actions/workflows/ci-lint.yaml)\n[![ci-test](https://github.com/oasisprotocol/nexus/actions/workflows/ci-test.yaml/badge.svg)](https://github.com/oasisprotocol/nexus/actions/workflows/ci-test.yaml)\n\nThe official indexer for the Oasis Network. Nexus continuously fetches\nblockchain data from one or more oasis nodes and related sources\n([Sourcify](sourcify.dev),\n[Oasis Metadata Registry](https://github.com/oasisprotocol/metadata-registry),\n...), parses the data and stores it into a heavily indexed SQL database, and\nprovides a JSON-based web API to access the data.\n\nNexus aims to serve as the backend for explorers and wallets, notably the\nofficial [Oasis Explorer](https://github.com/oasisprotocol/explorer/) and\n[Oasis Wallet](https://github.com/oasisprotocol/oasis-wallet-web).\n\n## Docker Development\n\nYou can build and run Oasis Nexus with\n[`docker compose`](https://docs.docker.com/compose/). Keep reading to get\nstarted, or take a look at our [Docker docs](docker/README.md) for more detail.\n\n### Configuration\n\nDownload the current network's\n[genesis document](https://docs.oasis.dev/oasis-core/consensus/genesis) to the\n`docker/node/etc` directory. You will need this to run the Oasis Node container.\n\n### Build\n\nFrom the repository root, you can run:\n\n```sh\nmake docker\n```\n\n### Run\n\nFrom the repository root, you can run:\n\n```sh\nmake start-docker\n```\n\nThe analyzer will run DB migrations on start (i.e. create empty tables) based on\nfiles in `storage/migrations`.\n\n### Query\n\nNow you can query the Oasis Nexus API\n\n```sh\ncurl -X GET http://0.0.0.0:8008/v1\n```\n\nFor a full list of endpoints see our\n[API docs](https://github.com/oasisprotocol/nexus/blob/main/api/README.md).\n\n## Local Development\n\nBelow are instructions for running Oasis Nexus locally, without Docker.\n\n### Oasis Node\n\nYou will need to run a local\n[node](https://docs.oasis.io/node/run-your-node/non-validator-node/) for\ndevelopment purposes. You will need to set the Unix socket in the\n`config/local-dev.yaml` file while running an instance of Oasis Nexus. For\nexample, this will be `unix:/node/data/internal.sock` in Docker.\n\n**Note:** A newly created node takes a while to fully sync with the network. The\nOasis team has a node that is ready for internal use; if you are a member of the\nteam, ask around to use it and save time.\n\n### Database\n\nYou will need to run a local [PostgreSQL DB](https://www.postgresql.org/).\n\nFor example, you can start a local [Docker](https://hub.docker.com/_/postgres)\ninstance of Postgres with:\n\n```\nmake postgres\n```\n\nand later browse the DB with\n\n```\nmake psql\n```\n\n### Nexus\n\nYou should be able to `make nexus` and run\n`./nexus --config config/local-dev.yml` from the repository root. This will\nstart the analyzers and the HTTP server, but you can start each of the\nconstituent services independently as well. See `./nexus --help` for more\ndetails.\n\nOnce Nexus has started, you can query the Oasis Nexus API\n\n```sh\ncurl -X GET http://localhost:8008/v1\n```\n\n**Debugging note**: A lot of indexing happens when parsing the genesis data. To\nsee what SQL statements genesis is converted into, run `nexus` with\n`NEXUS_DUMP_GENESIS_SQL=/tmp/genesis.sql`. The SQL will be written to the\nindicated file, provided that genesis hasn't been parsed into the DB yet. The\neasiest way to achieve the latter is to wipe the DB.\n\n### Code Quality Tools / Dependencies\n\nHere are our recommendations for getting the tools that `make lint` and\n`make fmt` use. None of these are strictly needed to compile Nexus or even to\ncreate a PR, but without them, you're at the mercy of CI.\n\n- **golangci-lint**:\n  [use their `curl | sh` installer](https://golangci-lint.run/usage/install/).\n  They explain that the tool is in dependency hell and any more structured\n  distribution of it might not work.\n\n  ```sh\n  curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh \\\n  | sh -s -- -b $(go env GOPATH)/bin v1.55.1\n  ```\n\n  - **gofumpt**: `go install mvdan.cc/gofumpt@latest`\n\n    Note: CI uses gofumpt through golangci-lint, so if there's any discrepancy,\n    look up what gofumpt version golangci-lint uses. Beware that we might not be\n    on the latest golangci-lint either.\n\n  - **goimports**: `go install golang.org/x/tools/cmd/goimports@latest`\n\n    Note: CI uses goimports through golangci-lint, so if there's any\n    discrepancy, look up what `golang.org/x/tools` version golangci-lint uses.\n    Beware that we might not be on the latest golangci-lint either.\n\n- **gitlint**: `pip install gitlint`\n\n  For linting commit messages. Used by [git hooks](scripts/git-hooks) and\n  `make lint-git`.\n\n- **gh**: `brew install gh` or\n  [see official instructions](https://github.com/cli/cli?tab=readme-ov-file#installation)\n  for Linux. After installation, `gh auth login`.\n\n  GitHub CLI. Used by [git hooks](scripts/git-hooks).\n\n- **punch.py**: `pip install punch.py`\n\n  Keeps track of the most recently released version.\n\n- **prettier**: `npm install --save-dev --save-exact -g prettier`\n\n  For rewrapping (and some other normalization?) of Markdown files (including\n  changelogs) and commit messages. Used by [git hooks](scripts/git-hooks) and\n  recommended as autoformatter in your text editor (setup not covered here).\n\n## Name Origin\n\n\"Nexus\" is a Latin word, meaning \"connection or series of connections linking\ntwo or more things\". Similarly, Oasis Nexus connects off-chain products with the\nOasis blockchain.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foasisprotocol%2Fnexus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foasisprotocol%2Fnexus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foasisprotocol%2Fnexus/lists"}