chain_registry

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsHealthyRPC

func IsHealthyRPC(ctx context.Context, endpoint string) error

Types

type AssetList

type AssetList struct {
	Schema  string `json:"$schema"`
	ChainID string `json:"chain_id"`
	Assets  []struct {
		Description string `json:"description"`
		DenomUnits  []struct {
			Denom    string `json:"denom"`
			Exponent int    `json:"exponent"`
		} `json:"denom_units"`
		Base     string `json:"base"`
		Name     string `json:"name"`
		Display  string `json:"display"`
		Symbol   string `json:"symbol"`
		LogoURIs struct {
			Png string `json:"png"`
			Svg string `json:"svg"`
		} `json:"logo_URIs"`
		CoingeckoID string `json:"coingecko_id"`
	} `json:"assets"`
}

type ChainInfo

type ChainInfo struct {
	Schema       string `json:"$schema"`
	ChainName    string `json:"chain_name"`
	Status       string `json:"status"`
	NetworkType  string `json:"network_type"`
	PrettyName   string `json:"pretty_name"`
	ChainID      string `json:"chain_id"`
	Bech32Prefix string `json:"bech32_prefix"`
	DaemonName   string `json:"daemon_name"`
	NodeHome     string `json:"node_home"`
	Genesis      struct {
		GenesisURL string `json:"genesis_url"`
	} `json:"genesis"`
	Slip44   int `json:"slip44"`
	Codebase struct {
		GitRepo            string   `json:"git_repo"`
		RecommendedVersion string   `json:"recommended_version"`
		CompatibleVersions []string `json:"compatible_versions"`
	} `json:"codebase"`
	Peers struct {
		Seeds []struct {
			ID       string `json:"id"`
			Address  string `json:"address"`
			Provider string `json:"provider,omitempty"`
		} `json:"seeds"`
		PersistentPeers []struct {
			ID      string `json:"id"`
			Address string `json:"address"`
		} `json:"persistent_peers"`
	} `json:"peers"`
	Apis struct {
		RPC []struct {
			Address  string `json:"address"`
			Provider string `json:"provider"`
		} `json:"rpc"`
		Rest []struct {
			Address  string `json:"address"`
			Provider string `json:"provider"`
		} `json:"rest"`
	} `json:"apis"`
	// contains filtered or unexported fields
}

func NewChainInfo

func NewChainInfo(log *zap.Logger) ChainInfo

NewChainInfo returns a ChainInfo that is uninitialized other than the provided zap.Logger. Typically, the caller will unmarshal JSON content into the ChainInfo after initialization.

func (ChainInfo) GetAllRPCEndpoints

func (c ChainInfo) GetAllRPCEndpoints() (out []string, err error)

func (ChainInfo) GetAssetList

func (c ChainInfo) GetAssetList(ctx context.Context) (AssetList, error)

func (ChainInfo) GetChainConfig

func (c ChainInfo) GetChainConfig(ctx context.Context) (*client.ChainClientConfig, error)

func (ChainInfo) GetRPCEndpoints

func (c ChainInfo) GetRPCEndpoints(ctx context.Context) (out []string, err error)

func (ChainInfo) GetRandomRPCEndpoint

func (c ChainInfo) GetRandomRPCEndpoint(ctx context.Context) (string, error)

type ChainRegistry

type ChainRegistry interface {
	GetChain(ctx context.Context, name string) (ChainInfo, error)
	ListChains(ctx context.Context) ([]string, error)
	SourceLink() string
}

func DefaultChainRegistry

func DefaultChainRegistry(log *zap.Logger) ChainRegistry

type CosmosGithubRegistry

type CosmosGithubRegistry struct {
	// contains filtered or unexported fields
}

func NewCosmosGithubRegistry

func NewCosmosGithubRegistry(log *zap.Logger) CosmosGithubRegistry

func (CosmosGithubRegistry) GetChain

func (c CosmosGithubRegistry) GetChain(ctx context.Context, name string) (ChainInfo, error)

func (CosmosGithubRegistry) ListChains

func (c CosmosGithubRegistry) ListChains(ctx context.Context) ([]string, error)
func (c CosmosGithubRegistry) SourceLink() string

Jump to

Keyboard shortcuts

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