node

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: May 21, 2021 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Client

func Client(rpcAddress string) (*rpchttp.HTTP, error)

Client returns a tendermint client to work against the configured chain

func DumpInfo

func DumpInfo(basePath, chainID, rpcAddress string, logger log.Logger) (err error)

DumpInfo connect to ad node and dumps the info about that chain into a folder

func FetchChainID

func FetchChainID(rpcAddress string) (chainID string, err error)

FetchChainID - retrieve the chain ID from a rpc endpoint

func LoadGenesisSum

func LoadGenesisSum(basePath, chainID string) (sum string, err error)

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

func RefreshPeers(peers map[string]*Peer, genesisSum string, logger log.Logger) (err error)

func SavePeers

func SavePeers(basePath, chainID string, peers map[string]*Peer, logger log.Logger) (err error)

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

Jump to

Keyboard shortcuts

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