Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Indexer API] Self hosted indexer api #201

Open
DaraDoyoung opened this issue Dec 4, 2023 · 5 comments
Open

[Indexer API] Self hosted indexer api #201

DaraDoyoung opened this issue Dec 4, 2023 · 5 comments
Labels
indexer-api Issues relating to the Indexer API

Comments

@DaraDoyoung
Copy link

Description

Is there any updates on self hosted indexer api?
https://aptos.dev/indexer/api/self-hosted

I'm running processors which are saving data to Postgres DB, and I would like to open an endpoint to this.
It seems no guide on this is provided yet.

@DaraDoyoung DaraDoyoung added the indexer-api Issues relating to the Indexer API label Dec 4, 2023
@larry-aptos
Copy link
Collaborator

you can use hasura self-hosted solution(hasura docker image) and https://github.com/aptos-labs/aptos-indexer-processors/tree/main/hasura-api/metadata-json this file as the metadata to use.

@olivbau
Copy link

olivbau commented Apr 9, 2024

I'm trying to import the unified.json file to Hasura.
For people struggling, don't forget to add INDEXER_V2_POSTGRES_URL env var to your docker compose file

Something like this:

  graphqlengine:
    image: hasura/graphql-engine:latest
    ports:
      - 8080:8080
    restart: always
    environment:
      HASURA_GRAPHQL_METADATA_DATABASE_URL: postgres://postgres_user:postgres_password@dbhasura:5432/hasura
      HASURA_GRAPHQL_ENABLE_CONSOLE: "true"
      HASURA_GRAPHQL_ADMIN_SECRET: myadminsecretkey
      HASURA_GRAPHQL_DEV_MODE: "false"
      INDEXER_V2_POSTGRES_URL: postgres://postgres_user:postgres_password@localhost:5432/indexer

@olivbau
Copy link

olivbau commented Apr 9, 2024

While import unified.json file I have an error:

[
    {
        "definition": {
            "name": "current_nft_marketplace_listings",
            "schema": "nft_marketplace_v2"
        },
        "name": "table nft_marketplace_v2.current_nft_marketplace_listings in source indexer-v2",
        "reason": "Inconsistent object: no such table/view exists in source: \"nft_marketplace_v2.current_nft_marketplace_listings\"",
        "type": "table"
    },
    {
        "definition": {
            "name": "current_nft_marketplace_collection_offers",
            "schema": "nft_marketplace_v2"
        },
        "name": "table nft_marketplace_v2.current_nft_marketplace_collection_offers in source indexer-v2",
        "reason": "Inconsistent object: no such table/view exists in source: \"nft_marketplace_v2.current_nft_marketplace_collection_offers\"",
        "type": "table"
    },
    {
        "definition": {
            "name": "current_nft_marketplace_auctions",
            "schema": "nft_marketplace_v2"
        },
        "name": "table nft_marketplace_v2.current_nft_marketplace_auctions in source indexer-v2",
        "reason": "Inconsistent object: no such table/view exists in source: \"nft_marketplace_v2.current_nft_marketplace_auctions\"",
        "type": "table"
    },
    {
        "definition": {
            "name": "current_nft_marketplace_token_offers",
            "schema": "nft_marketplace_v2"
        },
        "name": "table nft_marketplace_v2.current_nft_marketplace_token_offers in source indexer-v2",
        "reason": "Inconsistent object: no such table/view exists in source: \"nft_marketplace_v2.current_nft_marketplace_token_offers\"",
        "type": "table"
    },
    {
        "definition": {
            "name": "nft_marketplace_activities",
            "schema": "nft_marketplace_v2"
        },
        "name": "table nft_marketplace_v2.nft_marketplace_activities in source indexer-v2",
        "reason": "Inconsistent object: no such table/view exists in source: \"nft_marketplace_v2.nft_marketplace_activities\"",
        "type": "table"
    }
]

image

@olivbau
Copy link

olivbau commented Apr 9, 2024

I did manage to import the file by removing some parts of it
Modified version of the unified.json file I used: modified_unified.json

@banool
Copy link
Collaborator

banool commented Apr 9, 2024

@olivbau thanks for reporting this. Some of the tables are missing in the DB because they come from a different processor outside of the normal Rust stack.

cc @yuunlimm we should consider publishing a copy of the metadata with the changes that @olivbau made. This would be helpful for the local testnet too since I actually manually edit the metadata in exactly the same way myself every single time I update the metadata that it uses.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
indexer-api Issues relating to the Indexer API
Projects
None yet
Development

No branches or pull requests

4 participants