Documentation
¶
Index ¶
- Constants
- Variables
- func GetBestBootNode() (bootNodeAddr string)
- func GetBootNodesNum() int
- func GetCurrentHeightOfChain(logger log.Logger) (height uint64, err error)
- func GetLocalNodeType() types.NodeType
- func GetSeeds(bootSouce string, priv crypto.PrivKey, logger log.Logger) (nodes []*common.Node, localNodeType types.NodeType, err error)
- func GetSeedsFromBootSvr(bootSvr string, priv crypto.PrivKey, logger log.Logger) (nodes []*common.Node, localNodeType types.NodeType, err error)
- func GetXroute(logger log.Logger) (xroute []string, err error)
- func HttpGet(addr string) ([]byte, error)
- func HttpPost(url string, request interface{}) ([]byte, error)
- func HttpPost2(url string, request interface{}) ([]byte, error)
- func HttpPostWithHeader(url string, data []byte, header map[string]string) ([]byte, error)
- func RapNodes(seeds []Rnode, logger log.Logger) (nodes []*common.Node)
- func UpdateBootNode(bootNodes []string, logger log.Logger)
- type Endpoint
- type GetSeedsResp
- type Rnode
Constants ¶
View Source
const ( UDP = "udp" TCP = "tcp" RouteGetSeeds = "api/bootnode" RouteGetHeight = "api/height" RouteGetXroute = "api/xroute" )
View Source
const (
Succ = 0
)
Variables ¶
View Source
var (
LocalNodeType types.NodeType
)
View Source
var (
MainnetBootnodes = []string{
"https://39.97.128.184:443",
"https://39.97.197.181:443",
"https://120.55.156.239:443",
"https://47.110.211.42:443",
"https://47.91.221.28:443",
"https://161.117.157.31:443",
}
)
Functions ¶
func GetBestBootNode ¶
func GetBestBootNode() (bootNodeAddr string)
func GetBootNodesNum ¶
func GetBootNodesNum() int
func GetCurrentHeightOfChain ¶
func GetLocalNodeType ¶
func GetSeedsFromBootSvr ¶
func HttpPostWithHeader ¶
func UpdateBootNode ¶
UpdateBootNode update MainnetBootnodes from bootnodeAddrs,bootnodeAddrs's format are like https://ip1:port1,https://ip2:port2
Types ¶
type Endpoint ¶
type Endpoint struct { IP []string `json:"ip"` Port map[string]int `json:"port"` //key:protocol(udp or tcp or http) }
Endpoint network endpoint
func NewLocalEndpoint ¶
NewLocalEndpoint create network endpoint with local IPv4 address
type GetSeedsResp ¶ added in v0.1.2
Click to show internal directories.
Click to hide internal directories.