registry

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2026 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InitiaRegistryEndpoint   string = "https://raw.githubusercontent.com/initia-labs/initia-registry/refs/heads/main/%s/chain.json"
	CelestiaRegistryEndpoint string = "https://raw.githubusercontent.com/cosmos/chain-registry/refs/heads/master/%s/chain.json"
	OPInitBotsSpecEndpoint   string = "https://raw.githubusercontent.com/initia-labs/opinit-bots/refs/heads/main/spec_version.json"

	InitiaTestnetRegistryAPI string = "https://registry.testnet.initia.xyz/chains.json"
	InitiaMainnetRegistryAPI string = "https://registry.initia.xyz/chains.json"
	InitiaL1PrettyName       string = "Initia"

	InitiaTestnetGraphQLAPI string = "https://graphql.testnet.initia.xyz/v1/graphql"
	InitiaMainnetGraphQLAPI string = "https://graphql.initia.xyz/v1/graphql"
)
View Source
const (
	MAX_FALLBACK_RPCS = 3
	MAX_FALLBACK_LCDS = 3
)

Variables

View Source
var (
	CELESTIA_MAINNET_RPCS = []Endpoint{
		{
			Address: "https://rpc.lunaroasis.net",
		},
		{
			Address: "https://rpc.celestia.nodestake.org",
		},
		{
			Address: "https://rpc.lavenderfive.com:443/celestia",
		},
	}
	CELESTIA_TESTNET_RPCS = []Endpoint{
		{
			Address: "https://rpc-mocha.pops.one",
		},
		{
			Address: "https://celestia-testnet-rpc.itrocket.net",
		},
		{
			Address: "https://rpc.celestia.testnet.dteam.tech:443",
		},
	}
	INITIA_MAINNET_RPCS = []Endpoint{
		{
			Address: "https://rpc.initia.xyz",
		},
		{
			Address: "https://initia-rpc.cosmosspaces.zone",
		},
		{
			Address: "https://initia-archive.cosmosspaces.zone",
		},
	}
	INITIA_TESTNET_RPCS = []Endpoint{
		{
			Address: "https://rpc.testnet.initia.xyz",
		},
	}

	CELESTIA_MAINNET_LCDS = []Endpoint{
		{
			Address: "https://api.lunaroasis.net",
		},
		{
			Address: "https://api.celestia.nodestake.org",
		},
		{
			Address: "https://rest.lavenderfive.com:443/celestia",
		},
	}
	CELESTIA_TESTNET_LCDS = []Endpoint{
		{
			Address: "https://celestia-testnet-api.polkachu.com",
		},
		{
			Address: "https://celestia-testnet-api.itrocket.net",
		},
		{
			Address: "https://api.celestia.testnet.dteam.tech",
		},
	}
	INITIA_MAINNET_LCDS = []Endpoint{
		{
			Address: "https://rest.initia.xyz",
		},
		{
			Address: "https://initia-api.polkachu.com",
		},
	}
	INITIA_TESTNET_LCDS = []Endpoint{
		{
			Address: "https://rest.testnet.initia.xyz",
		},
	}
)

TODO: HOTFIX for un-stable RPCs and LCDs

View Source
var LoadedChainRegistry = make(map[ChainType]*ChainRegistry)

LoadedChainRegistry contains a map of chain id to the chain.json

View Source
var LoadedL2Registry = make(map[string]*ChainRegistryWithChainType)

LoadedL2Registry contains a map of l2 chain id to the chain.json with [testnet|mainnet] specified

View Source
var OPInitBotsSpecVersion map[string]int

Functions

func GetInitiaGraphQLFromType

func GetInitiaGraphQLFromType(chainType ChainType) (string, error)

func GetOPInitBotsSpecVersion

func GetOPInitBotsSpecVersion(chainId string) (int, error)

func GetRegistryEndpoint

func GetRegistryEndpoint(chainType ChainType) string

Types

type Apis

type Apis struct {
	Rpc  []Endpoint `json:"rpc"`
	Rest []Endpoint `json:"rest"`
	Grpc []Endpoint `json:"grpc"`
}

type ChainRegistry

type ChainRegistry struct {
	ChainId      string   `json:"chain_id"`
	PrettyName   string   `json:"pretty_name"`
	Bech32Prefix string   `json:"bech32_prefix"`
	Fees         Fees     `json:"fees"`
	Codebase     Codebase `json:"codebase"`
	Apis         Apis     `json:"apis"`
	Peers        Peers    `json:"peers"`

	ActiveRpcs []string
	ActiveLcds []string
}

func GetChainRegistry

func GetChainRegistry(chainType ChainType) (*ChainRegistry, error)

func GetL2Registry

func GetL2Registry(chainType ChainType, chainId string) (*ChainRegistry, error)

func (*ChainRegistry) GetActiveGrpc

func (cr *ChainRegistry) GetActiveGrpc() (string, error)

func (*ChainRegistry) GetActiveLcds added in v0.3.0

func (cr *ChainRegistry) GetActiveLcds() ([]string, error)

func (*ChainRegistry) GetActiveRpcs added in v0.3.0

func (cr *ChainRegistry) GetActiveRpcs() ([]string, error)

func (*ChainRegistry) GetActiveWebSocket

func (cr *ChainRegistry) GetActiveWebSocket() (string, error)

func (*ChainRegistry) GetBech32Prefix

func (cr *ChainRegistry) GetBech32Prefix() string

func (*ChainRegistry) GetChainId

func (cr *ChainRegistry) GetChainId() string

func (*ChainRegistry) GetCounterpartyClientId

func (cr *ChainRegistry) GetCounterpartyClientId(portID, channelID string) (Connection, error)

func (*ChainRegistry) GetDefaultFeeToken

func (cr *ChainRegistry) GetDefaultFeeToken() (FeeTokens, error)

func (*ChainRegistry) GetDefaultMinGasPrices

func (cr *ChainRegistry) GetDefaultMinGasPrices() (string, error)

func (*ChainRegistry) GetFirstActiveLcd added in v0.3.0

func (cr *ChainRegistry) GetFirstActiveLcd() (string, error)

func (*ChainRegistry) GetFirstActiveRpc added in v0.3.0

func (cr *ChainRegistry) GetFirstActiveRpc() (string, error)

func (*ChainRegistry) GetFixedMinGasPriceByDenom

func (cr *ChainRegistry) GetFixedMinGasPriceByDenom(denom string) (string, error)

func (*ChainRegistry) GetGenesisUrl

func (cr *ChainRegistry) GetGenesisUrl() string

func (*ChainRegistry) GetIBCChannelInfo added in v0.3.0

func (cr *ChainRegistry) GetIBCChannelInfo(port, channel string) (types.ChannelResponse, error)

func (*ChainRegistry) GetMinGasPriceByDenom

func (cr *ChainRegistry) GetMinGasPriceByDenom(denom string) (string, error)

func (*ChainRegistry) GetOpinitBridgeInfo

func (cr *ChainRegistry) GetOpinitBridgeInfo(id string) (types.Bridge, error)

func (*ChainRegistry) GetPersistentPeers

func (cr *ChainRegistry) GetPersistentPeers() string

func (*ChainRegistry) GetSeeds

func (cr *ChainRegistry) GetSeeds() string

type ChainRegistryWithChainType

type ChainRegistryWithChainType struct {
	ChainRegistry
	ChainType ChainType
}

type ChainType

type ChainType int
const (
	CelestiaTestnet ChainType = iota
	CelestiaMainnet
	InitiaL1Testnet
	InitiaL1Mainnet
)

func (ChainType) String

func (ct ChainType) String() string

type Channel

type Channel struct {
	Channel struct {
		ConnectionHops []string `json:"connection_hops"`
		Counterparty   struct {
			ChannelID string `json:"channel_id"`
			PortID    string `json:"port_id"`
		} `json:"counterparty"`
	} `json:"channel"`
}

type Codebase

type Codebase struct {
	Genesis Genesis `json:"genesis"`
}

type Connection

type Connection struct {
	Connection struct {
		Counterparty struct {
			ClientID string `json:"client_id"`
		} `json:"counterparty"`
	} `json:"connection"`
}

type Endpoint

type Endpoint struct {
	Address        string `json:"address"`
	Provider       string `json:"provider"`
	AuthorizedUser string `json:"authorizedUser,omitempty"`
	IndexForSkip   int    `json:"indexForSkip,omitempty"`
}

type FeeTokens

type FeeTokens struct {
	Denom            string  `json:"denom"`
	FixedMinGasPrice float64 `json:"fixed_min_gas_price"`
}

type Fees

type Fees struct {
	FeeTokens []FeeTokens `json:"fee_tokens"`
}

type Genesis

type Genesis struct {
	GenesisUrl string `json:"genesis_url"`
}

type L2AvailableNetwork

type L2AvailableNetwork struct {
	PrettyName string
	ChainId    string
}

func GetAllL2AvailableNetwork

func GetAllL2AvailableNetwork(chainType ChainType) ([]L2AvailableNetwork, error)

type Peer

type Peer struct {
	Id       string `json:"id"`
	Address  string `json:"address"`
	Provider string `json:"provider,omitempty"`
}

type Peers

type Peers struct {
	Seeds           []Peer `json:"seeds,omitempty"`
	PersistentPeers []Peer `json:"persistent_peers,omitempty"`
}

Jump to

Keyboard shortcuts

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