Skip to content

Add ability to search for online accounts  #4

@urtho

Description

@urtho

Upstream issue : algorand#1629

Problem

There is no way to quickly fetch all online accounts[^1].

Solution

  • Add is-online boolean filter to account search endpoint
  • Add is-reward-eligible boolean filter to account search endpoint
  • Add expires-in-hours filter that returns only accounts that will expire no later than expires-in-hours
  • Add appropriate optional partial index (for is-online only)

Response model should include:

  • total online stake
  • total eligible online stake
  • avg block time for the last 100 rounds in milliseconds

Notes:

  • is-reward-eligible assumes is-online
  • expires-in-hours should calculate avg block time over last 100 blocks using a query to block_header
  • return only accounts with non-expired keys (as online flag persists past key expiry)
  • expires-in-hours might need a better name like expires-in-hours-or-less but shorter ;)

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions