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

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