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: 0

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