Documentation
¶
Overview ¶
Copyright 2018 The MATRIX Authors as well as Copyright 2014-2017 The go-ethereum Authors This file is consisted of the MATRIX library and part of the go-ethereum library.
The MATRIX-ethereum library is free software: you can redistribute it and/or modify it under the terms of the MIT License.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject tothe following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISINGFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Package boot :net search
Copyright 2018 The MATRIX Authors as well as Copyright 2014-2017 The go-ethereum Authors This file is consisted of the MATRIX library and part of the go-ethereum library.
The MATRIX-ethereum library is free software: you can redistribute it and/or modify it under the terms of the MIT License.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject tothe following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISINGFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Index ¶
- Constants
- func GetIPFromID(ID string) string
- func SendData(ReadySend []p2p.Custsend)
- type Boots
- func (TBoot *Boots) CheckIPStatusAndCount(ListID []string) (int, []string)
- func (TBoot *Boots) DeleteIndex(index uint64) int
- func (TBoot *Boots) FindOneBootNode(ListID []string) bool
- func (TBoot *Boots) GetPingPong(ListIDString []string) []LocalPongInfo
- func (TBoot *Boots) HandleGetPingPongReq(AnalyData p2p.Custsend)
- func (TBoot *Boots) HandleGetPingPongRsp(AnalyData p2p.Custsend)
- func (TBoot *Boots) HandleP2PMessage()
- func (TBoot *Boots) IsBootNode(AimID string) (bool, []string)
- func (TBoot *Boots) MakeSendMsg(fromip string, toip string, istcp bool, code uint64, Type uint64) p2p.Custsend
- func (TBoot *Boots) ReadRecvChanfromP2P()
- func (TBoot *Boots) Run()
- type GetHeightReq
- type GetHeightRsp
- type GetMainNodeReq
- type GetMainNodeRsp
- type GetPingReq
- type GetPingRsp
- type LocalHeightInfo
- type LocalMainNodeList
- type LocalPongInfo
- type REboot
Constants ¶
const ( // TimeOutLimit wait data time TimeOutLimit = 2 * time.Second //FindConnStatusInterval sleep time FindConnStatusInterval = 5 // MinLiveBootCount min live boot count MinLiveBootCount = 12 Module = "BOOT" ChanSize = 100 )
const ( //Getheightreq gmaneightreq_code Getheightreq = 0x0001 //Getheightrsp gmaneightrsp_code Getheightrsp = 0x0002 //Getmainnodereq getmainnodersp_code Getmainnodereq = 0x0003 //Getmainnodersp getmainnodersp_code Getmainnodersp = 0x0004 // Getpingreq get ping req_code Getpingreq = 0x0005 // Getpongrsp get ping rsq_code Getpongrsp = 0x0006 //P2PBootCode p2pboot_code P2PBootCode = 1 )
Variables ¶
This section is empty.
Functions ¶
func GetIPFromID ¶
Types ¶
type Boots ¶
type Boots struct {
ChanPing chan LocalPongInfo
BootReturn REboot
PublicSeq uint64
NeedAck []uint64
LocalID string
MyRecvChan chan p2p.Custsend
HandleMessage map[int]func(p2p.Custsend)
// contains filtered or unexported fields
}
Boots HandleMessage and some channal
func (*Boots) CheckIPStatusAndCount ¶
CheckIPStatusAndCount Check IP Status And count
func (*Boots) DeleteIndex ¶
DeleteIndex delete a index in []
func (*Boots) FindOneBootNode ¶
func (*Boots) GetPingPong ¶
func (TBoot *Boots) GetPingPong(ListIDString []string) []LocalPongInfo
GetPingPong get specified ID pingpong
func (*Boots) HandleGetPingPongReq ¶
HandleGetPingPongReq handle get pingpong req
func (*Boots) HandleGetPingPongRsp ¶
HandleGetPingPongRsp handle get pingpong rsp
func (*Boots) HandleP2PMessage ¶
func (TBoot *Boots) HandleP2PMessage()
HandleP2PMessage :read mine recv chan
func (*Boots) IsBootNode ¶
IsBootNode check if it is boot node
func (*Boots) MakeSendMsg ¶
func (TBoot *Boots) MakeSendMsg(fromip string, toip string, istcp bool, code uint64, Type uint64) p2p.Custsend
MakeSendMsg make send msg to p2p
func (*Boots) ReadRecvChanfromP2P ¶
func (TBoot *Boots) ReadRecvChanfromP2P()
ReadRecvChanfromP2P read recv chan from p2p
type LocalHeightInfo ¶
LocalHeightInfo local height info
type LocalMainNodeList ¶
type LocalMainNodeList struct {
IP string
}
LocalMainNodeList local mainnode list
type LocalPongInfo ¶
type LocalPongInfo struct {
IP string
// contains filtered or unexported fields
}
LocalPongInfo local pong info