Documentation ¶
Index ¶
- Constants
- Variables
- type Client
- type Config
- type Container
- type FormattedContainer
- type GetContainerByIDArgs
- type GetContainerByIndexArgs
- type GetContainerRangeArgs
- type GetContainerRangeResponse
- type GetIndexArgs
- type GetIndexResponse
- type GetLastAcceptedArgs
- type Indexer
- type IsAcceptedArgs
- type IsAcceptedResponse
Constants ¶
View Source
const CodecVersion = 0
View Source
const MaxFetchedByRange = 1024
Maximum number of containers IDs that can be fetched at a time in a call to GetContainerRange
Variables ¶
View Source
var Codec codec.Manager
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { // GetContainerRange returns the transactions at index [startIndex], [startIndex+1], ... , [startIndex+n-1] // If [n] == 0, returns an empty response (i.e. null). // If [startIndex] > the last accepted index, returns an error (unless the above apply.) // If we run out of transactions, returns the ones fetched before running out. GetContainerRange(ctx context.Context, startIndex uint64, numToFetch int, options ...rpc.Option) ([]Container, error) // Get a container by its index GetContainerByIndex(ctx context.Context, index uint64, options ...rpc.Option) (Container, error) // Get the most recently accepted container and its index GetLastAccepted(context.Context, ...rpc.Option) (Container, uint64, error) // Returns 1 less than the number of containers accepted on this chain GetIndex(ctx context.Context, containerID ids.ID, options ...rpc.Option) (uint64, error) // Returns true if the given container is accepted IsAccepted(ctx context.Context, containerID ids.ID, options ...rpc.Option) (bool, error) // Get a container and its index by its ID GetContainerByID(ctx context.Context, containerID ids.ID, options ...rpc.Option) (Container, uint64, error) }
Client interface for Avalanche Indexer API Endpoint
type Config ¶
type Config struct { DB database.Database Log logging.Logger IndexingEnabled bool AllowIncompleteIndex bool BlockAcceptorGroup snow.AcceptorGroup TxAcceptorGroup snow.AcceptorGroup VertexAcceptorGroup snow.AcceptorGroup APIServer server.PathAdder ShutdownF func() }
Config for an indexer
type Container ¶
type Container struct { // ID of this container ID ids.ID `serialize:"true"` // Byte representation of this container Bytes []byte `serialize:"true"` // Unix time, in nanoseconds, at which this container was accepted by this node Timestamp int64 `serialize:"true"` }
Container is something that gets accepted (a block, transaction or vertex)
type FormattedContainer ¶
type GetContainerByIDArgs ¶ added in v1.7.11
type GetContainerByIDArgs struct { ID ids.ID `json:"id"` Encoding formatting.Encoding `json:"encoding"` }
type GetContainerByIndexArgs ¶ added in v1.7.11
type GetContainerByIndexArgs struct { Index json.Uint64 `json:"index"` Encoding formatting.Encoding `json:"encoding"` }
type GetContainerRangeArgs ¶
type GetContainerRangeResponse ¶
type GetContainerRangeResponse struct {
Containers []FormattedContainer `json:"containers"`
}
type GetIndexArgs ¶
type GetIndexResponse ¶
type GetLastAcceptedArgs ¶
type GetLastAcceptedArgs struct {
Encoding formatting.Encoding `json:"encoding"`
}
type Indexer ¶
type Indexer interface { chains.Registrant // Close will do nothing and return nil after the first call io.Closer }
Indexer causes accepted containers for a given chain to be indexed by their ID and by the order in which they were accepted by this node. Indexer is threadsafe.
func NewIndexer ¶
NewIndexer returns a new Indexer and registers a new endpoint on the given API server.
type IsAcceptedArgs ¶ added in v1.7.11
type IsAcceptedResponse ¶
type IsAcceptedResponse struct {
IsAccepted bool `json:"isAccepted"`
}
Click to show internal directories.
Click to hide internal directories.