config

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: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetConfig

func SetConfig(newcfg *Config)

Types

type Backend

type Backend struct {
	Rpc   string // url to rpc, eg., https://rpc-osmosis-ia.cosmosia.notional.ventures:443
	Api   string // url to api, eg., https://api-osmosis-ia.cosmosia.notional.ventures:443
	Grpc  string // url to grpc, eg., grpc-osmosis-ia.cosmosia.notional.ventures:443
	Eth   string // url to eth-http, eg., https://jsonrpc-evmos-ia.cosmosia.notional.ventures:443
	EthWs string // url to eth-ws, eg., https://jsonrpc-evmos-ia.cosmosia.notional.ventures:443/websocket/

	// examples:
	// 	[1, 100] => from block 1 to block 100 (subnode)
	// 	[10] => last 10 recent blocks
	//	[] => archive node
	Blocks []int64
}

type BackendNodeType

type BackendNodeType uint8
const (
	BackendNodeTypePruned  BackendNodeType = 0
	BackendNodeTypeSubNode BackendNodeType = 1
	BackendNodeTypeArchive BackendNodeType = 2
)

func GetBackendNodeType

func GetBackendNodeType(b *Backend) BackendNodeType

type Config

type Config struct {
	Upstream []Backend `yaml:",flow"`
}

func GetConfig

func GetConfig() *Config

func LoadConfigFromBytes

func LoadConfigFromBytes(buf []byte) (*Config, error)

func LoadConfigFromFile

func LoadConfigFromFile(filename string) (*Config, error)

type ProtocolType

type ProtocolType uint8
const (
	ProtocolTypeRpc   ProtocolType = 0
	ProtocolTypeApi   ProtocolType = 1
	ProtocolTypeGrpc  ProtocolType = 2
	ProtocolTypeEth   ProtocolType = 3
	ProtocolTypeEthWs ProtocolType = 4
)

Jump to

Keyboard shortcuts

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