proxy

package
v0.0.0-...-b0c29ef Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2022 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Chains []*chain
)

Functions

func ConfigRetryHandler

func ConfigRetryHandler() error

func CooldownEndpoint

func CooldownEndpoint(chain string, e string) error

func CreateChainClients

func CreateChainClients() error

func GetEndpoint

func GetEndpoint(chainName string, readOnly bool) (string, error)

func Handler

func Handler(w http.ResponseWriter, r *http.Request)

func HealthProber

func HealthProber()

func HotLoadConfigFile

func HotLoadConfigFile(filename string) error

func LoadConfigFile

func LoadConfigFile(filename string) error

func UnmarshalJSON

func UnmarshalJSON(data []byte) error

func UpdateChainBlockHeads

func UpdateChainBlockHeads(ctx context.Context) error

Types

type Chain

type Chain interface {
	EnabledEndpoints() []*ChainEndpoint
	NextEndpoint() (string, error)
}

type ChainEndpoint

type ChainEndpoint struct {
	Endpoint      string            `json:"endpoint"`
	Enabled       bool              `json:"enabled"`
	Failover      bool              `json:"failover"`
	ReadOnly      bool              `json:"readOnly"`
	CooldownUntil time.Time         `json:"cooldownUntil"`
	BlockHead     uint64            `json:"blockHead"`
	Client        *ethclient.Client `json:"-"`
}

type JSONRPCContainer

type JSONRPCContainer struct {
	Single *JSONRPCResponse
	Batch  []JSONRPCResponse
}

func (*JSONRPCContainer) Unmarshal

func (c *JSONRPCContainer) Unmarshal(b []byte) error

type JSONRPCResponse

type JSONRPCResponse struct {
	Jsonrpc string      `json:"jsonrpc"`
	ID      int         `json:"id"`
	Result  interface{} `json:"result"`
}

Jump to

Keyboard shortcuts

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