Documentation ¶
Overview ¶
Package config allows you to pass in a custom config for which rpcs to hit
Index ¶
Constants ¶
View Source
const PublicRPCMapURL = "https://raw.githubusercontent.com/DefiLlama/chainlist/master/constants/extraRpcs.json"
PublicRPCMapURL is the url we pull the rpc list from. TODO: this has some rate-limits, they're relatively aggressive but something like gitcdn.xyz would be good here.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChainConfig ¶
type ChainConfig struct { // RPCS is a list of rpcs to use RPCs []string `yaml:"rpcs"` // Checks is how many rpcs must return the same result for it to be used. This does not apply to height/status based methods Checks uint16 `yaml:"confirmations,omitempty"` }
ChainConfig is the config for a single chain.
type Config ¶
type Config struct { // chainID -> chainConfig Chains map[uint32]ChainConfig `yaml:"chains"` // Port is the port Port uint16 `yaml:"port,omitempty"` // RefreshInterval is the refresh interval of rpc latency // expressed in seconds RefreshInterval int `yaml:"refresh_interval,omitempty"` // ClientType is the client type to use ClientType string `yaml:"client_type,omitempty"` }
Config holds the config for the chain.
func GetPublicRPCConfig ¶
GetPublicRPCConfig gets the rpc map from defillama. This should be done at startup time. this will retry on a backoffHelper until context cancellation.
func UnmarshallConfig ¶
UnmarshallConfig unmarshalls a config.
Click to show internal directories.
Click to hide internal directories.