subnet

package
v1.17.0 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2024 License: LGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const DelayUpdateMsgTime = 5 * time.Second
View Source
const ExpireOfflineMsgTime = uint32(2 * time.Hour / 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
View Source
const MinProposeDuration = uint32(1 * time.Hour / time.Second)

Variables

View Source
var RefreshDuration = 1 * time.Minute

Functions

This section is empty.

Types

type MemberStatus

type MemberStatus struct {
	PubKey string
	Alive  time.Time
}

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) Broadcast added in v1.14.1

func (self *SubNet) Broadcast(net p2p.P2P, msg types.Message)

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 (self *SubNet) IpInMembers(ip string) bool

func (*SubNet) IsSeedNode

func (self *SubNet) IsSeedNode() bool

func (*SubNet) OnAddPeer

func (self *SubNet) OnAddPeer(net p2p.P2P, info *peer.PeerInfo)

func (*SubNet) OnDelPeer

func (self *SubNet) OnDelPeer(info *peer.PeerInfo)

func (*SubNet) OnHostAddrDetected

func (self *SubNet) OnHostAddrDetected(listenAddr string)

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

func (self *SubNet) ProposeOffline(nodes []string) error

func (*SubNet) Start

func (self *SubNet) Start(net p2p.P2P)

func (*SubNet) Stop

func (self *SubNet) Stop()

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

Jump to

Keyboard shortcuts

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