Documentation ¶
Index ¶
- Variables
- func CalcAnnounceSignature(nodeID node.ShortNodeID, role member.PrimaryRole, addr endpoints.IPAddress, ...) ([]byte, *cryptography.Signature, error)
- func CreateLocalNodeProfile(nk beat.NodeKeeper, cert nodeinfo.Certificate, address string, ...) (*adapters.StaticProfile, error)
- func EnsureGetPulse(ctx context.Context, report network.Report) pulse.Data
- func NewGatewayer(g network.Gateway) network.Gatewayer
- func SelectWorking(nodes []nodeinfo.NetworkNode) []nodeinfo.NetworkNode
- type Base
- func (g *Base) Auther() network.Auther
- func (g *Base) Bootstrapper() network.Bootstrapper
- func (g *Base) CancelNodeState()
- func (g *Base) EphemeralMode(nodes census.OnlinePopulation) bool
- func (g *Base) FailState(ctx context.Context, reason string)
- func (g *Base) GetCert(ctx context.Context, ref reference.Global) (nodeinfo.Certificate, error)
- func (g *Base) GetLocalNodeStaticProfile() profiles.StaticProfile
- func (g *Base) HandleNodeAuthorizeRequest(ctx context.Context, request network.ReceivedPacket) (network.Packet, error)
- func (g *Base) HandleNodeBootstrapRequest(ctx context.Context, request network.ReceivedPacket) (network.Packet, error)
- func (g *Base) HandleReconnect(ctx context.Context, request network.ReceivedPacket) (network.Packet, error)
- func (g *Base) HandleUpdateSchedule(ctx context.Context, request network.ReceivedPacket) (network.Packet, error)
- func (g *Base) Init(ctx context.Context) error
- func (g *Base) NewGateway(ctx context.Context, state network.State) network.Gateway
- func (g *Base) OnConsensusFinished(ctx context.Context, report network.Report)
- func (g *Base) OnPulseFromConsensus(ctx context.Context, pu beat.Beat)
- func (g *Base) RequestNodeState(fn chorus.NodeStateFunc)
- func (g *Base) StartConsensus(ctx context.Context) error
- func (g *Base) Stop(ctx context.Context) error
- func (g *Base) UpdateState(ctx context.Context, pu beat.Beat)
- func (g *Base) ValidateCert(ctx context.Context, authCert nodeinfo.AuthorizationCertificate) (bool, error)
- type Complete
- func (g *Complete) CancelNodeState()
- func (g *Complete) EphemeralMode(census.OnlinePopulation) bool
- func (g *Complete) GetCert(ctx context.Context, registeredNodeRef reference.Global) (nodeinfo.Certificate, error)
- func (g *Complete) GetState() network.State
- func (g *Complete) OnPulseFromConsensus(ctx context.Context, pulse network.NetworkedPulse)
- func (g *Complete) RequestNodeState(fn chorus.NodeStateFunc)
- func (g *Complete) Run(context.Context, pulse.Data)
- func (g *Complete) UpdateState(ctx context.Context, beat beat.Beat)
- type DiscoveryBootstrap
- type JoinerBootstrap
- type NoNetwork
- type WaitConsensus
- type WaitMajority
- type WaitMinRoles
- type WaitPulsar
- func (g *WaitPulsar) GetState() network.State
- func (g *WaitPulsar) OnConsensusFinished(ctx context.Context, report network.Report)
- func (g *WaitPulsar) OnPulseFromConsensus(ctx context.Context, pulse network.NetworkedPulse)
- func (g *WaitPulsar) Run(ctx context.Context, pulse pulse.Data)
- func (g *WaitPulsar) UpdateState(ctx context.Context, beat beat.Beat)
Constants ¶
This section is empty.
Variables ¶
View Source
var EphemeralPulse = beat.Beat{Data: pulse.Data{ PulseNumber: pulse.MinTimePulse, DataExt: pulse.DataExt{ PulseEpoch: pulse.EphemeralPulseEpoch, Timestamp: pulse.UnixTimeOfMinTimePulse, }}}
Functions ¶
func CalcAnnounceSignature ¶
func CalcAnnounceSignature(nodeID node.ShortNodeID, role member.PrimaryRole, addr endpoints.IPAddress, startPower member.Power, isDiscovery bool, pk []byte, keystore cryptography.KeyStore, scheme cryptography.PlatformCryptographyScheme, ) ([]byte, *cryptography.Signature, error)
func CreateLocalNodeProfile ¶
func CreateLocalNodeProfile(nk beat.NodeKeeper, cert nodeinfo.Certificate, address string, keyProcessor cryptography.KeyProcessor, svc cryptography.Service, scheme cryptography.PlatformCryptographyScheme, ) (*adapters.StaticProfile, error)
func EnsureGetPulse ¶
EnsureGetPulse checks if NodeKeeper got list for pulseNumber
func SelectWorking ¶
func SelectWorking(nodes []nodeinfo.NetworkNode) []nodeinfo.NetworkNode
deprecated // improve
Types ¶
type Base ¶
type Base struct { component.Initer Self network.Gateway Gatewayer network.Gatewayer `inject:""` NodeKeeper beat.NodeKeeper `inject:""` CryptographyService cryptography.Service `inject:""` CryptographyScheme cryptography.PlatformCryptographyScheme `inject:""` CertificateManager nodeinfo.CertificateManager `inject:""` HostNetwork network.HostNetwork `inject:""` PulseAppender beat.Appender `inject:""` PulseManager chorus.Conductor `inject:""` BootstrapRequester bootstrap.Requester `inject:""` KeyProcessor cryptography.KeyProcessor `inject:""` Aborter network.Aborter `inject:""` TransportFactory transport.Factory `inject:""` ConsensusMode consensus.Mode ConsensusController consensus.Controller Options *network.Options // contains filtered or unexported fields }
Base is abstract class for gateways
func (*Base) Bootstrapper ¶
func (g *Base) Bootstrapper() network.Bootstrapper
Bootstrapper casts us to Bootstrapper or obtain it in another way
func (*Base) CancelNodeState ¶
func (g *Base) CancelNodeState()
func (*Base) EphemeralMode ¶
func (g *Base) EphemeralMode(nodes census.OnlinePopulation) bool
func (*Base) GetCert ¶
GetCert method returns node certificate by requesting sign from discovery nodes
func (*Base) GetLocalNodeStaticProfile ¶
func (g *Base) GetLocalNodeStaticProfile() profiles.StaticProfile
func (*Base) HandleNodeAuthorizeRequest ¶
func (*Base) HandleNodeBootstrapRequest ¶
func (*Base) HandleReconnect ¶
func (*Base) HandleUpdateSchedule ¶
func (*Base) NewGateway ¶
NewGateway creates new gateway on top of existing
func (*Base) OnConsensusFinished ¶
func (*Base) OnPulseFromConsensus ¶
func (*Base) RequestNodeState ¶
func (g *Base) RequestNodeState(fn chorus.NodeStateFunc)
func (*Base) UpdateState ¶
UpdateState called then Consensus is done
func (*Base) ValidateCert ¶
func (g *Base) ValidateCert(ctx context.Context, authCert nodeinfo.AuthorizationCertificate) (bool, error)
ValidateCert validates node certificate
type Complete ¶
type Complete struct {
*Base
}
func (*Complete) CancelNodeState ¶
func (g *Complete) CancelNodeState()
func (*Complete) EphemeralMode ¶
func (g *Complete) EphemeralMode(census.OnlinePopulation) bool
func (*Complete) GetCert ¶
func (g *Complete) GetCert(ctx context.Context, registeredNodeRef reference.Global) (nodeinfo.Certificate, error)
GetCert method generates cert by requesting signs from discovery nodes
func (*Complete) OnPulseFromConsensus ¶
func (g *Complete) OnPulseFromConsensus(ctx context.Context, pulse network.NetworkedPulse)
func (*Complete) RequestNodeState ¶
func (g *Complete) RequestNodeState(fn chorus.NodeStateFunc)
type DiscoveryBootstrap ¶
type DiscoveryBootstrap struct {
*Base
}
DiscoveryBootstrap void network state
func (*DiscoveryBootstrap) GetState ¶
func (g *DiscoveryBootstrap) GetState() network.State
type JoinerBootstrap ¶
type JoinerBootstrap struct {
*Base
}
JoinerBootstrap void network state
func (*JoinerBootstrap) GetState ¶
func (g *JoinerBootstrap) GetState() network.State
type WaitConsensus ¶
type WaitConsensus struct { *Base // contains filtered or unexported fields }
func (*WaitConsensus) GetState ¶
func (g *WaitConsensus) GetState() network.State
func (*WaitConsensus) OnConsensusFinished ¶
func (g *WaitConsensus) OnConsensusFinished(ctx context.Context, report network.Report)
type WaitMajority ¶
type WaitMajority struct { *Base // contains filtered or unexported fields }
func (*WaitMajority) GetState ¶
func (g *WaitMajority) GetState() network.State
func (*WaitMajority) OnConsensusFinished ¶
func (g *WaitMajority) OnConsensusFinished(ctx context.Context, report network.Report)
type WaitMinRoles ¶
type WaitMinRoles struct { *Base // contains filtered or unexported fields }
func (*WaitMinRoles) GetState ¶
func (g *WaitMinRoles) GetState() network.State
func (*WaitMinRoles) OnConsensusFinished ¶
func (g *WaitMinRoles) OnConsensusFinished(ctx context.Context, report network.Report)
func (*WaitMinRoles) UpdateState ¶
func (g *WaitMinRoles) UpdateState(ctx context.Context, beat beat.Beat)
type WaitPulsar ¶
type WaitPulsar struct { *Base // contains filtered or unexported fields }
func (*WaitPulsar) GetState ¶
func (g *WaitPulsar) GetState() network.State
func (*WaitPulsar) OnConsensusFinished ¶
func (g *WaitPulsar) OnConsensusFinished(ctx context.Context, report network.Report)
func (*WaitPulsar) OnPulseFromConsensus ¶
func (g *WaitPulsar) OnPulseFromConsensus(ctx context.Context, pulse network.NetworkedPulse)
func (*WaitPulsar) UpdateState ¶
func (g *WaitPulsar) UpdateState(ctx context.Context, beat beat.Beat)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.