Documentation ¶
Index ¶
- Constants
- Variables
- type MemberStatus
- type Offline
- type SubNet
- func (self *SubNet) Broadcast(net p2p.P2P, msg types.Message)
- func (self *SubNet) GetMaskAddrFilter() p2p.AddressFilter
- func (self *SubNet) GetMembersInfo() []common.SubnetMemberInfo
- func (self *SubNet) GetOfflineVotes() []*types.OfflineWitnessMsg
- func (self *SubNet) GetReservedAddrFilter(staticFilterEnabled bool) p2p.AddressFilter
- func (self *SubNet) IpInMembers(ip string) bool
- func (self *SubNet) IsSeedNode() bool
- func (self *SubNet) OnAddPeer(net p2p.P2P, info *peer.PeerInfo)
- func (self *SubNet) OnDelPeer(info *peer.PeerInfo)
- func (self *SubNet) OnHostAddrDetected(listenAddr string)
- func (self *SubNet) OnMembersRequest(ctx *p2p.Context, msg *types.SubnetMembersRequest)
- func (self *SubNet) OnMembersResponse(ctx *p2p.Context, msg *types.SubnetMembers)
- func (self *SubNet) OnOfflineWitnessMsg(ctx *p2p.Context, msg *types.OfflineWitnessMsg)
- func (self *SubNet) ProposeOffline(nodes []string) error
- func (self *SubNet) Start(net p2p.P2P)
- func (self *SubNet) Stop()
- type SubNetMaskAddrFilter
- type SubNetReservedAddrFilter
- type WitnessStatus
Constants ¶
View Source
const DelayUpdateMsgTime = 5 * time.Second
View Source
const MIN_VERSION_FOR_SUBNET = "2.0.0-0"
View Source
const MaxInactiveTime = 10 * time.Minute
View Source
const MaxMemberRequests = 3
Variables ¶
View Source
var RefreshDuration = 1 * time.Minute
Functions ¶
This section is empty.
Types ¶
type MemberStatus ¶
type Offline ¶ added in v1.14.1
type Offline struct { Status WitnessStatus Msg *types.OfflineWitnessMsg }
type SubNet ¶
type SubNet struct {
// contains filtered or unexported fields
}
func NewSubNet ¶
func NewSubNet(acc *account.Account, seeds *utils.HostsResolver, gov utils.GovNodeResolver, logger common.Logger) *SubNet
func (*SubNet) GetMaskAddrFilter ¶
func (self *SubNet) GetMaskAddrFilter() p2p.AddressFilter
func (*SubNet) GetMembersInfo ¶
func (self *SubNet) GetMembersInfo() []common.SubnetMemberInfo
restful api
func (*SubNet) GetOfflineVotes ¶ added in v1.14.1
func (self *SubNet) GetOfflineVotes() []*types.OfflineWitnessMsg
func (*SubNet) GetReservedAddrFilter ¶
func (self *SubNet) GetReservedAddrFilter(staticFilterEnabled bool) p2p.AddressFilter
func (*SubNet) IpInMembers ¶
func (*SubNet) IsSeedNode ¶
func (*SubNet) OnHostAddrDetected ¶
func (*SubNet) OnMembersRequest ¶
func (self *SubNet) OnMembersRequest(ctx *p2p.Context, msg *types.SubnetMembersRequest)
func (*SubNet) OnMembersResponse ¶
func (self *SubNet) OnMembersResponse(ctx *p2p.Context, msg *types.SubnetMembers)
func (*SubNet) OnOfflineWitnessMsg ¶ added in v1.14.1
func (self *SubNet) OnOfflineWitnessMsg(ctx *p2p.Context, msg *types.OfflineWitnessMsg)
func (*SubNet) ProposeOffline ¶ added in v1.14.1
type SubNetMaskAddrFilter ¶
type SubNetMaskAddrFilter struct {
// contains filtered or unexported fields
}
func (*SubNetMaskAddrFilter) Contains ¶
func (self *SubNetMaskAddrFilter) Contains(addr string) bool
type SubNetReservedAddrFilter ¶
type SubNetReservedAddrFilter struct {
// contains filtered or unexported fields
}
func (*SubNetReservedAddrFilter) Contains ¶
func (self *SubNetReservedAddrFilter) Contains(addr string) bool
type WitnessStatus ¶ added in v1.14.1
type WitnessStatus = byte
const NewStatus WitnessStatus = 0
const UnchangedStatus WitnessStatus = 2
const UpdatedStatus WitnessStatus = 1
Click to show internal directories.
Click to hide internal directories.