indexer icon indicating copy to clipboard operation
indexer copied to clipboard

Box storage search API: Box by App + Box name and All boxes by App

Open algoanne opened this issue 3 years ago • 6 comments

Problem

To help off-chain consumers introspect Boxes, we want to build out a Box search API like:

  • Find Box by App ID and Box name.
  • Find all Boxes by App ID.

Here's info applying to all APIs with API-specific callouts in subsequent sections:

  • Response codes mirror https://developer.algorand.org/docs/rest-apis/indexer/#get-v2applicationsapplication-id.
  • Response type is application/json.
  • Box value is base64 encoded.

Find Box by App ID and Box name

Suggest following Algod specification: https://github.com/algorand/go-algorand/issues/3973.

Find all Boxes by App ID

Suggest starting with Algod specification (https://github.com/algorand/go-algorand/issues/4021) and enriching with token-based pagination.

Solution

The story presumes ingestion happens in #1006.

Dependencies

Urgency

algoanne avatar Apr 26 '22 18:04 algoanne

What is a box?

winder avatar Apr 27 '22 13:04 winder

@winder it's described in the epic this story is assigned to! Basically: new storage paradigm for applications.

algoanne avatar Apr 27 '22 13:04 algoanne

Thanks @algoanne depending on how boxes are stored this may need a new table as well. Maybe thats been omitted because there is some "clever stuff" done in the implementation to make boxes a special type of application?

winder avatar Apr 27 '22 14:04 winder

@winder yes definitely (I think) will need a new table as well. I can update the title & description so that's more explicitly understood.

algoanne avatar Apr 27 '22 15:04 algoanne

Closing in favor of https://github.com/algorand/go-algorand/issues/3973 because we agreed it's sufficient to start with an algod-only approach.

Rationale:

  • Indexer does not support rewind capabilities for existing Application state (local + global storage). Its APIs support retrieving Application state as of query time.
  • Since the initial objective is to provide parity with existing facilities, and because it's conceivable to provide as of query time APIs in algod, we're opting to start in algod. The intent is to reduce duplicative efforts between algod and indexer.

michaeldiamant avatar May 10 '22 21:05 michaeldiamant

Re-opening - For parity with other offered APIs, we're opting to expose indexer APIs. Updating the description with proposed APIs.

michaeldiamant avatar May 16 '22 13:05 michaeldiamant