Skip to content

How to query block detail by block number in P-Chain? #1253

@sylviahuang123

Description

@sylviahuang123

Excuse me, I'm new to avalanche, would like to know something, thanks in advance.
Totally speaking, is there any solution to query block detail by block number at P-Chain, just like the method eth_getBlockByNumber at EVM?
If index API is the workaround, how can I decode the bytes to content human-readable, which from the response of index.getContainerByIndex
BTW, as below, enable indexer may result index incomplete? so I can't get complete data?
If --index-enabled is changed to false from true, AvalancheGo won't start as doing so would cause a previously complete index to become incomplete, unless the user explicitly says to do so with --index-allow-incomplete. This protects you from accidentally running with indexing disabled, after previously running with it enabled, which would result in an incomplete index.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation or examples

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions