state

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2023 License: MIT Imports: 10 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PoolRpc     []*BackendState
	PoolApi     []*BackendState
	PoolGrpc    []*BackendState
	PoolEth     []*BackendState
	PoolEthWs   []*BackendState
	ProxyMapRpc = make(map[string]*httputil.ReverseProxy)
	ProxyMapApi = make(map[string]*httputil.ReverseProxy)
	ProxyMapEth = make(map[string]*httputil.ReverseProxy)
)

Functions

func FetchHeightFromStatus

func FetchHeightFromStatus(rpcUrl string) (int64, error)

func Init

func Init()

func InitPool

func InitPool()

func IsNeededToFetchLastBlock

func IsNeededToFetchLastBlock(s *BackendState) bool

func ReadHeightFromStatusJson

func ReadHeightFromStatusJson(jsonText []byte) (int64, error)

func TaskUpdateState

func TaskUpdateState()

Types

type BackendState

type BackendState struct {
	Name      string
	NodeType  config.BackendNodeType
	LastBlock int64

	Backend *config.Backend
}

func GetPool

func GetPool(t config.ProtocolType) []*BackendState

func SelectMatchedBackend

func SelectMatchedBackend(height int64, t config.ProtocolType) (*BackendState, error)

func SelectPrunedNode

func SelectPrunedNode(t config.ProtocolType) *BackendState

Jump to

Keyboard shortcuts

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