client

package
v0.4.0-rc8 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrIntegrityCheckFailed = errors.New("integrity check failed")
View Source
var ErrNotAvailable = errors.New("call unavailable")
View Source
var SelfCheck = true

SelfCheck Flag describing should manager check anyway the latest version for network it has

Functions

func InitMetrics

func InitMetrics()

Types

type Client

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

func NewClient

func NewClient(logger *zap.Logger, sapi SearchApi) *Client

func (*Client) GetAccountBalance added in v0.1.0

func (hc *Client) GetAccountBalance(ctx context.Context, nv NetworkVersion, start, end time.Time, account string) (balances []shared.BalanceSummary, err error)

GetAccountBalance calculates balance summaries for 24h segments for given time range

func (*Client) GetRewardAPR added in v0.3.1

func (hc *Client) GetRewardAPR(ctx context.Context, nv NetworkVersion, start, end time.Time, account string, validators []string) (aprs []shared.RewardAPRSummary, err error)

GetRewardApr calculates reward annual percentage rate summaries for 24h segments for given time range

func (*Client) GetRewards added in v0.0.9

func (hc *Client) GetRewards(ctx context.Context, nv NetworkVersion, start, end time.Time, account string, validators []string) ([]shared.RewardSummary, error)

GetRewards calculates reward summaries for 24h segments for given time range

func (*Client) LatestData added in v0.4.0

func (hc *Client) LatestData(ctx context.Context, ldr shared.LatestDataRequest) (ldResp shared.LatestDataResponse, er error)

func (*Client) LinkSender

func (hc *Client) LinkSender(sender TaskSender)

func (*Client) SyncData added in v0.4.0

func (hc *Client) SyncData(ctx context.Context, ldr shared.SyncDataRequest) (ldResp shared.SyncDataResponse, er error)

type ClientContractor

type ClientContractor interface {
	//	SchedulerContractor
	ControllContractor

	GetRewards(ctx context.Context, nv NetworkVersion, start, end time.Time, account string, validators []string) ([]shared.RewardSummary, error)
	GetAccountBalance(ctx context.Context, nv NetworkVersion, start, end time.Time, address string) (balances []shared.BalanceSummary, err error)
	GetRewardAPR(ctx context.Context, nv NetworkVersion, start, end time.Time, address string, validators []string) (aprs []shared.RewardAPRSummary, err error)
}

ClientContractor a format agnostic

type ControllContractor

type ControllContractor interface {
	LatestData(ctx context.Context, ldr shared.LatestDataRequest) (ldResp shared.LatestDataResponse, er error)
	SyncData(ctx context.Context, ldr shared.SyncDataRequest) (ldResp shared.SyncDataResponse, er error)
}

type NetworkVersion

type NetworkVersion struct {
	Network string
	ChainID string
	Version string
}

type PSig added in v0.4.0

type PSig struct {
	TaskID  string
	Network string
	ChainID string
	Version string
}

type ProcessLatestData added in v0.4.0

type ProcessLatestData struct {
	Started   time.Time
	Finished  bool
	EndHeight uint64
	Error     error
	Resp      shared.LatestDataResponse
	Retries   uint64
}

type ProcessSyncData added in v0.4.0

type ProcessSyncData struct {
	Started   time.Time
	Finished  bool
	EndHeight uint64
	Error     error
	Resp      shared.SyncDataResponse
	Retries   uint64
}

type Running added in v0.4.0

type Running struct {
	ProcessesSyncData   map[PSig]ProcessSyncData
	ProcessesLatestData map[PSig]ProcessLatestData
	// contains filtered or unexported fields
}

func NewRunning added in v0.4.0

func NewRunning() *Running

type SearchApi

type SearchApi interface {
	GetBlockForTime(ctx context.Context, blx shared.BlockWithMeta, time time.Time) (b shared.Block, ok bool, err error)
	GetTransactions(ctx context.Context, tsearch shared.TransactionSearchInternal) ([]shared.Transaction, error)
}

type TaskSender

type TaskSender interface {
	Send([]structs.TaskRequest) (*structs.Await, error)
}

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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