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

Add rpc method to retrieve indexing/chain status #119

Closed
fracek opened this issue May 2, 2023 · 2 comments
Closed

Add rpc method to retrieve indexing/chain status #119

fracek opened this issue May 2, 2023 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@fracek
Copy link
Contributor

fracek commented May 2, 2023

Is your feature request related to a problem? Please describe.
Sometimes we need to know what's the latest available block number/hash. We can use the JSON-RPC provider to do that, but there is always the possibility that the Apibara DNA node and the provider node are not exactly at the same block.

Describe the solution you'd like
We should add a Status method to the rpc that returns the block syncing status, together with the cursors of the current finalized and accepted blocks.

service Stream {
  rpc Status(StatusRequest) returns (StatusResponse);
}

message StatusRequest {
}

message StatusResponse {
  // Optional because the chain may be so new that no block has been finalized. For example, devnets.
  optional Cursor finalized = 1;
  Cursor latest = 2;
  IngestionStatus status = 3;
}

enum IngestionStatus {
  INGESTION_STATUS_UNKNOWN = 0;
  INGESTION_STATUS_SYNCING = 1;
  INGESTION_STATUS_SYNCED = 2;
}
@fracek fracek added enhancement New feature or request good first issue Good for newcomers help wanted labels May 2, 2023
@ametel01
Copy link
Contributor

Happy to take this

ametel01 added a commit to ametel01/dna that referenced this issue Jun 18, 2023
…h 'origin/indexing/chainstatus#119' into indexing/chainstatus#119"
@fracek
Copy link
Contributor Author

fracek commented Sep 5, 2023

Done in #237

@fracek fracek closed this as completed Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants