collector

package
v0.0.0-...-d614328 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 6, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package collector implements the fetching of all possible addresses and accounts that exist within a Mars deployment

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collector

type Collector struct {
	// contains filtered or unexported fields
}

Collector implements the collection of accounts by querying the contract's underlying storage directly

func New

func New(
	queue interfaces.Queuer,
	metricsCache interfaces.Cacher,
	collectorQueueName string,
	healthCheckQueueName string,
	logger *logrus.Entry,
) (*Collector, error)

New creates a new instance of the collector and returns it and an error when applicable

func (*Collector) Run

func (service *Collector) Run() error

Run the service forever

func (*Collector) Stop

func (service *Collector) Stop() error

Stop the service gracefully

type DebtCollateralMapValue

type DebtCollateralMapValue struct {
	AmountScaled string `json:"amount_scaled"`
}

DebtCollateralMapValue contains the format of the value of a key in the DEBTS and COLLATERAL maps in the Red Bank contract We only parse amount_scaled as we're not interested in the other values

type Model

type Model struct {
	// hex-encode key to read it better (this is often ascii)
	Key github_com_tendermint_tendermint_libs_bytes.HexBytes `protobuf:"bytes,1,opt,name=key,proto3,casttype=github.com/tendermint/tendermint/libs/bytes.HexBytes" json:"key,omitempty"`
	// base64-encode raw value
	Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
}

func (*Model) ProtoMessage

func (*Model) ProtoMessage()

func (*Model) Reset

func (m *Model) Reset()

func (*Model) String

func (m *Model) String() string

type PageRequest

type PageRequest struct {
	// key is a value returned in PageResponse.next_key to begin
	// querying the next page most efficiently. Only one of offset or key
	// should be set.
	Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	// offset is a numeric offset that can be used when key is unavailable.
	// It is less efficient than using key. Only one of offset or key should
	// be set.
	Offset uint64 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"`
	// limit is the total number of results to be returned in the result page.
	// If left empty it will default to a value to be set by each app.
	Limit uint64 `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"`
	// count_total is set to true  to indicate that the result set should include
	// a count of the total number of items available for pagination in UIs.
	// count_total is only respected when offset is used. It is ignored when key
	// is set.
	CountTotal bool `protobuf:"varint,4,opt,name=count_total,json=countTotal,proto3" json:"count_total,omitempty"`
	// reverse is set to true if results are to be returned in the descending order.
	//
	// Since: cosmos-sdk 0.43
	Reverse bool `protobuf:"varint,5,opt,name=reverse,proto3" json:"reverse,omitempty"`
}

PageRequest is to be embedded in gRPC request messages for efficient pagination. Ex:

message SomeRequest {
        Foo some_parameter = 1;
        PageRequest pagination = 2;
}

func (*PageRequest) GetCountTotal

func (m *PageRequest) GetCountTotal() bool

func (*PageRequest) GetKey

func (m *PageRequest) GetKey() []byte

func (*PageRequest) GetLimit

func (m *PageRequest) GetLimit() uint64

func (*PageRequest) GetOffset

func (m *PageRequest) GetOffset() uint64

func (*PageRequest) GetReverse

func (m *PageRequest) GetReverse() bool

func (*PageRequest) ProtoMessage

func (*PageRequest) ProtoMessage()

func (*PageRequest) Reset

func (m *PageRequest) Reset()

func (*PageRequest) String

func (m *PageRequest) String() string

type PageResponse

type PageResponse struct {
	// next_key is the key to be passed to PageRequest.key to
	// query the next page most efficiently
	NextKey []byte `protobuf:"bytes,1,opt,name=next_key,json=nextKey,proto3" json:"next_key,omitempty"`
	// total is total number of results available if PageRequest.count_total
	// was set, its value is undefined otherwise
	Total uint64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"`
}

PageResponse is to be embedded in gRPC response messages where the corresponding request message has used PageRequest.

message SomeResponse {
        repeated Bar results = 1;
        PageResponse page = 2;
}

func (*PageResponse) GetNextKey

func (m *PageResponse) GetNextKey() []byte

func (*PageResponse) GetTotal

func (m *PageResponse) GetTotal() uint64

func (*PageResponse) ProtoMessage

func (*PageResponse) ProtoMessage()

func (*PageResponse) Reset

func (m *PageResponse) Reset()

func (*PageResponse) String

func (m *PageResponse) String() string

type QueryAllContractStateRequest

type QueryAllContractStateRequest struct {
	// address is the address of the contract
	Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
	// pagination defines an optional pagination for the request.
	Pagination *PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"`
}

QueryAllContractStateRequest is the request type for the Query/AllContractState RPC method

func (*QueryAllContractStateRequest) ProtoMessage

func (*QueryAllContractStateRequest) ProtoMessage()

func (*QueryAllContractStateRequest) Reset

func (m *QueryAllContractStateRequest) Reset()

func (*QueryAllContractStateRequest) String

type QueryAllContractStateResponse

type QueryAllContractStateResponse struct {
	Models []Model `protobuf:"bytes,1,rep,name=models,proto3" json:"models"`
	// pagination defines the pagination in the response.
	Pagination *PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"`
}

QueryAllContractStateResponse is the response type for the Query/AllContractState RPC method

func (*QueryAllContractStateResponse) ProtoMessage

func (*QueryAllContractStateResponse) ProtoMessage()

func (*QueryAllContractStateResponse) Reset

func (m *QueryAllContractStateResponse) Reset()

func (*QueryAllContractStateResponse) String

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL