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

clients/stellarcore: Add support for Core's new HTTP endpoints #5426

Open
Tracked by #5433
Shaptic opened this issue Aug 13, 2024 · 0 comments · Fixed by #5428
Open
Tracked by #5433

clients/stellarcore: Add support for Core's new HTTP endpoints #5426

Shaptic opened this issue Aug 13, 2024 · 0 comments · Fixed by #5428
Assignees
Labels
blocked blocked by another issue breaking-change Breaking change tag Protocol 23 rpc-sdk-scrum

Comments

@Shaptic
Copy link
Contributor

Shaptic commented Aug 13, 2024

Protocol 23: Core Endpoints

Epics: #5433, stellar/soroban-rpc#267


Stellar Core will have one new high-performance HTTP endpoint as part of their v22 in stellar/stellar-core#4350 which is supported as part of #5428. It will have three more in v23. We need to support them. The endpoint schemas are defined in this document and are replicated here (please check the document to ensure the following schemas are not outdated).

Request format

Each endpoint needs to be implemented into the stellarcore client as its described here. The format for every endpoint is the same POST request:

ledgerSeq=N&key=base64&key=base64...

Here, ledgerSeq is an optional uint32 number and each key is a base64-encoded xdr.LedgerKey. If the ledgerSeq is not available on the given instance, a 404 will be returned.

Response formats

Protocol 23: /getledgerentry

JSON response (as a TypeScript interface):

interface Response {
  ledger: number; // uint32
  entries: {
    e: string; // base64-encoded xdr.LedgerEntry
    state: "live" | "new_entry_no_proof" | "new_entry_proof" | "archived_no_proof" | "archived_proof"
  }[]

Note that this is REPLACING the existing endpoint, meaning we need to ensure that all code paths that use the current variant of the endpoint are updated correctly. The best way to do this, in my opinion, is to remove the stellarcore.Client.GetLedgerEntry entirely and add support into a new GetLedgerEntries, so any code referencing the old method will break.


Protocol 23: /getinvocationproof

JSON response (as a TypeScript interface):

interface Response {
  ledger: number; // uint32
  proof?: string; // base64-encoded xdr.ArchivalProof
}

Note that if a proof is not required for any of the given entries, proof will be omitted.

Protocol 23: /getrestorationproof

JSON response (as a TypeScript interface):

interface Response {
  ledger: number; // uint32
  proof?: string; // base64-encoded xdr.ArchivalProof
}

Note that if a proof is not required for any of the given entries, proof will be omitted.

Notes

Core does not have a build ready with these endpoints so they cannot be tested end-to-end (hence the Blocked label). However, we can still implement the schemas in anticipation of these interfaces.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked blocked by another issue breaking-change Breaking change tag Protocol 23 rpc-sdk-scrum
Projects
Status: Blocked
Development

Successfully merging a pull request may close this issue.

3 participants