Documentation
¶
Index ¶
- Constants
- Variables
- func GetInitiaGraphQLFromType(chainType ChainType) (string, error)
- func GetOPInitBotsSpecVersion(chainId string) (int, error)
- func GetRegistryEndpoint(chainType ChainType) string
- type Apis
- type ChainRegistry
- func (cr *ChainRegistry) GetActiveGrpc() (string, error)
- func (cr *ChainRegistry) GetActiveLcds() ([]string, error)
- func (cr *ChainRegistry) GetActiveRpcs() ([]string, error)
- func (cr *ChainRegistry) GetActiveWebSocket() (string, error)
- func (cr *ChainRegistry) GetBech32Prefix() string
- func (cr *ChainRegistry) GetChainId() string
- func (cr *ChainRegistry) GetCounterpartyClientId(portID, channelID string) (Connection, error)
- func (cr *ChainRegistry) GetDefaultFeeToken() (FeeTokens, error)
- func (cr *ChainRegistry) GetDefaultMinGasPrices() (string, error)
- func (cr *ChainRegistry) GetFirstActiveLcd() (string, error)
- func (cr *ChainRegistry) GetFirstActiveRpc() (string, error)
- func (cr *ChainRegistry) GetFixedMinGasPriceByDenom(denom string) (string, error)
- func (cr *ChainRegistry) GetGenesisUrl() string
- func (cr *ChainRegistry) GetIBCChannelInfo(port, channel string) (types.ChannelResponse, error)
- func (cr *ChainRegistry) GetMinGasPriceByDenom(denom string) (string, error)
- func (cr *ChainRegistry) GetOpinitBridgeInfo(id string) (types.Bridge, error)
- func (cr *ChainRegistry) GetPersistentPeers() string
- func (cr *ChainRegistry) GetSeeds() string
- type ChainRegistryWithChainType
- type ChainType
- type Channel
- type Codebase
- type Connection
- type Endpoint
- type FeeTokens
- type Fees
- type Genesis
- type L2AvailableNetwork
- type Peer
- type Peers
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 ( ChainTypeToEndpoint = map[ChainType]string{ CelestiaTestnet: CelestiaRegistryEndpoint, CelestiaMainnet: CelestiaRegistryEndpoint, InitiaL1Testnet: InitiaRegistryEndpoint, InitiaL1Mainnet: InitiaRegistryEndpoint, } ChainTypeToEndpointSlug = map[ChainType]string{ CelestiaTestnet: "testnets/celestiatestnet3", CelestiaMainnet: "celestia", InitiaL1Testnet: "testnets/initia", InitiaL1Mainnet: "mainnets/initia", } ChainTypeToInitiaRegistryAPI = map[ChainType]string{ InitiaL1Testnet: InitiaTestnetRegistryAPI, InitiaL1Mainnet: InitiaMainnetRegistryAPI, } ChainTypeToInitiaGraphQLAPI = map[ChainType]string{ InitiaL1Testnet: InitiaTestnetGraphQLAPI, InitiaL1Mainnet: InitiaMainnetGraphQLAPI, } )
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 GetRegistryEndpoint ¶
Types ¶
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 Connection ¶
type Connection struct {
Connection struct {
Counterparty struct {
ClientID string `json:"client_id"`
} `json:"counterparty"`
} `json:"connection"`
}
type L2AvailableNetwork ¶
func GetAllL2AvailableNetwork ¶
func GetAllL2AvailableNetwork(chainType ChainType) ([]L2AvailableNetwork, error)
Click to show internal directories.
Click to hide internal directories.