Documentation ¶
Index ¶
- func Client(rpcAddress string) (*rpchttp.HTTP, error)
- func DumpInfo(basePath, chainID, rpcAddress string, logger log.Logger) (err error)
- func FetchChainID(rpcAddress string) (chainID string, err error)
- func LoadGenesisSum(basePath, chainID string) (sum string, err error)
- func LoadPeers(basePath, chainID, rpcAddress string, logger log.Logger) (peers map[string]*Peer, err error)
- func NewLightRoot(sh tmtypes.SignedHeader) []byte
- func RefreshPeers(peers map[string]*Peer, genesisSum string, logger log.Logger) (err error)
- func SavePeers(basePath, chainID string, peers map[string]*Peer, logger log.Logger) (err error)
- type LightRoot
- type Peer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FetchChainID ¶
FetchChainID - retrieve the chain ID from a rpc endpoint
func LoadGenesisSum ¶
LoadGenesisSum load the genesis checksum file
func LoadPeers ¶
func LoadPeers(basePath, chainID, rpcAddress string, logger log.Logger) (peers map[string]*Peer, err error)
LoadPeers load the information about the chain nodes
func NewLightRoot ¶
func NewLightRoot(sh tmtypes.SignedHeader) []byte
NewLightRoot returns a new light root
func RefreshPeers ¶
Types ¶
type LightRoot ¶
type LightRoot struct { TrustHeight int64 `json:"trust-height"` TrustHash string `json:"trust-hash"` }
LightRoot is the format for a light client root file which will be used for state sync
type Peer ¶
type Peer struct { ID string `json:"id,omitempty"` Address string `json:"address,omitempty"` IsSeed bool `json:"is_seed,omitempty"` LastContactHeight int64 `json:"last_contact_height,omitempty"` LastContactDate time.Time `json:"last_contact_date,omitempty"` UpdatedAt time.Time `json:"updated_at,omitempty"` Reachable bool `json:"reachable,omitempty"` }
Peer structure to keep track of the status of a peer
Click to show internal directories.
Click to hide internal directories.