Documentation
¶
Index ¶
- func NewPulse(numberDelta uint32, previousPulseNumber core.PulseNumber, ...) *core.Pulse
- type EntropyGenerator
- type EntropyPayload
- type EntropySignaturePayload
- type GetLastPulsePayload
- type Handler
- func (handler *Handler) GetLastPulseNumber(request *Payload, response *Payload) error
- func (handler *Handler) HealthCheck(request *Payload, response *Payload) error
- func (handler *Handler) MakeHandshake(request *Payload, response *Payload) error
- func (handler *Handler) ReceiveChosenSignature(request *Payload, response *Payload) error
- func (handler *Handler) ReceiveEntropy(request *Payload, response *Payload) error
- func (handler *Handler) ReceiveSignatureForEntropy(request *Payload, response *Payload) error
- func (handler *Handler) ReceiveVector(request *Payload, response *Payload) error
- type HandshakePayload
- type Neighbour
- type Payload
- type Pulsar
- type RPCClientWrapper
- type RPCClientWrapperFactory
- type RPCClientWrapperFactoryImpl
- type RPCClientWrapperImpl
- func (impl *RPCClientWrapperImpl) Close() error
- func (impl *RPCClientWrapperImpl) CreateConnection(connectionType configuration.ConnectionType, connectionAddress string) error
- func (impl *RPCClientWrapperImpl) Go(serviceMethod string, args interface{}, reply interface{}, done chan *rpc.Call) *rpc.Call
- func (impl *RPCClientWrapperImpl) IsInitialised() bool
- func (impl *RPCClientWrapperImpl) Lock()
- func (impl *RPCClientWrapperImpl) ResetClient()
- func (impl *RPCClientWrapperImpl) Unlock()
- type RequestType
- type SenderConfirmationPayload
- type StandardEntropyGenerator
- type State
- type StateSwitcher
- type StateSwitcherImpl
- type VectorPayload
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewPulse ¶
func NewPulse(numberDelta uint32, previousPulseNumber core.PulseNumber, entropyGenerator EntropyGenerator) *core.Pulse
NewPulse creates a new pulse with using of custom GeneratedEntropy Generator
Types ¶
type EntropyGenerator ¶
EntropyGenerator is the base interface for generation of entropy for pulses
type EntropyPayload ¶ added in v0.4.0
type EntropyPayload struct { PulseNumber core.PulseNumber Entropy core.Entropy }
type EntropySignaturePayload ¶ added in v0.4.0
type EntropySignaturePayload struct { PulseNumber core.PulseNumber Signature []byte }
type GetLastPulsePayload ¶ added in v0.4.0
type Handler ¶ added in v0.3.0
type Handler struct {
// contains filtered or unexported fields
}
func (*Handler) GetLastPulseNumber ¶ added in v0.4.0
func (*Handler) HealthCheck ¶ added in v0.4.0
func (*Handler) MakeHandshake ¶ added in v0.3.0
func (*Handler) ReceiveChosenSignature ¶ added in v0.4.0
func (*Handler) ReceiveEntropy ¶ added in v0.4.0
func (*Handler) ReceiveSignatureForEntropy ¶ added in v0.4.0
type HandshakePayload ¶ added in v0.3.0
type Neighbour ¶ added in v0.3.0
type Neighbour struct { ConnectionType configuration.ConnectionType ConnectionAddress string OutgoingClient RPCClientWrapper PublicKey *ecdsa.PublicKey PublicKeyRaw string }
Neighbour is a helper struct, which contains info about pulsar-neighbour
type Pulsar ¶
type Pulsar struct { Sock net.Listener SockConnectionType configuration.ConnectionType RPCServer *rpc.Server Neighbours map[string]*Neighbour PrivateKey *ecdsa.PrivateKey PublicKeyRaw string Config configuration.Pulsar Storage pulsarstorage.PulsarStorage EntropyGenerator EntropyGenerator StartProcessLock sync.Mutex GeneratedEntropy core.Entropy GeneratedEntropySign []byte EntropyForNodes core.Entropy PulseSenderToNodes string SignsConfirmedSending map[string]core.PulseSenderConfirmation ProcessingPulseNumber core.PulseNumber LastPulse *core.Pulse OwnedBftRow map[string]*bftCell BftGrid map[string]map[string]*bftCell // contains filtered or unexported fields }
Pulsar is a base struct for pulsar's node It contains all the stuff, which is needed for working of a pulsar
func NewPulsar ¶
func NewPulsar( configuration configuration.Pulsar, storage pulsarstorage.PulsarStorage, rpcWrapperFactory RPCClientWrapperFactory, entropyGenerator EntropyGenerator, stateSwitcher StateSwitcher, listener func(string, string) (net.Listener, error)) (*Pulsar, error)
NewPulsar creates a new pulse with using of custom GeneratedEntropy Generator
func (*Pulsar) CheckConnectionsToPulsars ¶ added in v0.5.0
func (pulsar *Pulsar) CheckConnectionsToPulsars()
CheckConnectionsToPulsars is a method refreshing connections between pulsars
func (*Pulsar) EstablishConnectionToPulsar ¶ added in v0.5.0
EstablishConnectionToPulsar is a method for creating connection to another pulsar
func (*Pulsar) StartConsensusProcess ¶ added in v0.4.0
func (pulsar *Pulsar) StartConsensusProcess(pulseNumber core.PulseNumber) error
StartConsensusProcess starts process of calculating consensus between pulsars
func (*Pulsar) StartServer ¶ added in v0.4.0
func (pulsar *Pulsar) StartServer()
StartServer starts listening of the rpc-server
func (*Pulsar) StopServer ¶ added in v0.4.0
func (pulsar *Pulsar) StopServer()
StopServer stops listening of the rpc-server
type RPCClientWrapper ¶ added in v0.4.0
type RPCClientWrapper interface { // Lock takes current neighbour's lock Lock() // Unlock releases current neighbour's lock Unlock() // IsInitialised compares underhood rpc-client with nil IsInitialised() bool // CreateConnection creates connection to an another pulsar CreateConnection(connectionType configuration.ConnectionType, connectionAddress string) error // Close closes connection Close() error // Go makes rpc-call to an another pulsar Go(serviceMethod string, args interface{}, reply interface{}, done chan *rpc.Call) *rpc.Call // ResetClient clears rpc-client ResetClient() }
RPCClientWrapper describes interface of the wrapper around rpc-client
type RPCClientWrapperFactory ¶ added in v0.4.0
type RPCClientWrapperFactory interface {
CreateWrapper() RPCClientWrapper
}
RPCClientWrapperFactory describes interface for the wrappers factory
type RPCClientWrapperFactoryImpl ¶ added in v0.4.0
type RPCClientWrapperFactoryImpl struct { }
RPCClientWrapperFactoryImpl is a base impl of the RPCClientWrapperFactory
func (RPCClientWrapperFactoryImpl) CreateWrapper ¶ added in v0.4.0
func (RPCClientWrapperFactoryImpl) CreateWrapper() RPCClientWrapper
CreateWrapper return new RPCClientWrapper
type RPCClientWrapperImpl ¶ added in v0.4.0
RPCClientWrapperImpl is a standard impl of RPCClientWrapper
func (*RPCClientWrapperImpl) Close ¶ added in v0.4.0
func (impl *RPCClientWrapperImpl) Close() error
Close closes connection
func (*RPCClientWrapperImpl) CreateConnection ¶ added in v0.4.0
func (impl *RPCClientWrapperImpl) CreateConnection(connectionType configuration.ConnectionType, connectionAddress string) error
CreateConnection creates connection to an another pulsar
func (*RPCClientWrapperImpl) Go ¶ added in v0.4.0
func (impl *RPCClientWrapperImpl) Go(serviceMethod string, args interface{}, reply interface{}, done chan *rpc.Call) *rpc.Call
Go makes rpc-call to an another pulsar
func (*RPCClientWrapperImpl) IsInitialised ¶ added in v0.4.0
func (impl *RPCClientWrapperImpl) IsInitialised() bool
IsInitialised compares underhood rpc-client with nil
func (*RPCClientWrapperImpl) Lock ¶ added in v0.4.0
func (impl *RPCClientWrapperImpl) Lock()
Lock takes current neighbour's lock
func (*RPCClientWrapperImpl) ResetClient ¶ added in v0.5.0
func (impl *RPCClientWrapperImpl) ResetClient()
ResetClient clears rpc-client
func (*RPCClientWrapperImpl) Unlock ¶ added in v0.4.0
func (impl *RPCClientWrapperImpl) Unlock()
Unlock releases current neighbour's lock
type RequestType ¶ added in v0.3.0
type RequestType string
const ( HealthCheck RequestType = "Pulsar.HealthCheck" Handshake RequestType = "Pulsar.MakeHandshake" GetLastPulseNumber RequestType = "Pulsar.SyncLastPulseWithNeighbour" ReceiveSignatureForEntropy RequestType = "Pulsar.ReceiveSignatureForEntropy" ReceiveEntropy RequestType = "Pulsar.ReceiveEntropy" ReceiveVector RequestType = "Pulsar.ReceiveVector" ReceiveChosenSignature RequestType = "Pulsar.ReceiveChosenSignature" )
func (RequestType) String ¶ added in v0.3.0
func (state RequestType) String() string
type SenderConfirmationPayload ¶ added in v0.4.0
type SenderConfirmationPayload struct { PulseNumber core.PulseNumber Signature []byte ChosenPublicKey string }
type StandardEntropyGenerator ¶
type StandardEntropyGenerator struct { }
StandardEntropyGenerator is the base impl of EntropyGenerator with using of crypto/rand
func (*StandardEntropyGenerator) GenerateEntropy ¶
func (generator *StandardEntropyGenerator) GenerateEntropy() core.Entropy
GenerateEntropy generate entropy with using of EntropyGenerator
type StateSwitcher ¶ added in v0.5.0
type StateSwitcher interface { SetPulsar(pulsar *Pulsar) // contains filtered or unexported methods }
StateSwitcher is a base for pulsar's state machine
type StateSwitcherImpl ¶ added in v0.5.0
type StateSwitcherImpl struct {
// contains filtered or unexported fields
}
StateSwitcherImpl is a base implementation of the pulsar's state machine
func (*StateSwitcherImpl) SetPulsar ¶ added in v0.5.0
func (switcher *StateSwitcherImpl) SetPulsar(pulsar *Pulsar)
type VectorPayload ¶ added in v0.4.0
type VectorPayload struct { PulseNumber core.PulseNumber Vector map[string]*bftCell }