Documentation ¶
Index ¶
- func GenerateSlotDigest(gatewaySlot *mixmessages.GatewaySlot) []byte
- type Heartbeat
- type Instance
- func (i *Instance) GetAddGatewayChan() chan NodeGateway
- func (i *Instance) GetCmixGroup() *cyclic.Group
- func (i *Instance) GetE2EGroup() *cyclic.Group
- func (i *Instance) GetEllipticPublicKey() string
- func (i *Instance) GetFullNdf() *SecuredNdf
- func (i *Instance) GetHistoricalRound(id id.Round) (*pb.RoundInfo, error)
- func (i *Instance) GetHistoricalRoundRange(first, last id.Round) ([]*pb.RoundInfo, error)
- func (i *Instance) GetHistoricalRounds(rounds []id.Round) ([]*pb.RoundInfo, error)
- func (i *Instance) GetIpOverrideList() *ds.IpOverrideList
- func (i *Instance) GetLastRoundID() id.Round
- func (i *Instance) GetLastUpdateID() int
- func (i *Instance) GetNodeAndGateway(ngid *id.ID) (NodeGateway, error)
- func (i *Instance) GetOldestRoundID() id.Round
- func (i *Instance) GetPartialNdf() *SecuredNdf
- func (i *Instance) GetPermissioningAddress() string
- func (i *Instance) GetPermissioningCert() string
- func (i *Instance) GetPermissioningId() *id.ID
- func (i *Instance) GetRound(id id.Round) (*pb.RoundInfo, error)
- func (i *Instance) GetRoundEvents() *ds.RoundEvents
- func (i *Instance) GetRoundUpdate(updateID int) (*pb.RoundInfo, error)
- func (i *Instance) GetRoundUpdates(id int) []*pb.RoundInfo
- func (i *Instance) GetWaitingRounds() *ds.WaitingRounds
- func (i *Instance) GetWrappedRound(id id.Round) (*ds.Round, error)
- func (i *Instance) RoundUpdate(info *pb.RoundInfo) (*ds.Round, error)
- func (i *Instance) RoundUpdates(rounds []*pb.RoundInfo) error
- func (i *Instance) SetAddGatewayChan(c chan NodeGateway)
- func (i *Instance) SetAddNodeChan(c chan NodeGateway)
- func (i *Instance) SetGatewayAuthentication()
- func (i *Instance) SetNetworkHealthChan(c chan Heartbeat)
- func (i *Instance) SetRemoveGatewayChan(c chan *id.ID)
- func (i *Instance) SetRemoveNodeChan(c chan *id.ID)
- func (i *Instance) UpdateFullNdf(m *pb.NDF) error
- func (i *Instance) UpdateGatewayConnections() error
- func (i *Instance) UpdateNodeConnections() error
- func (i *Instance) UpdatePartialNdf(m *pb.NDF) error
- type NodeGateway
- type SecuredNdf
- type ValidationType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateSlotDigest ¶
func GenerateSlotDigest(gatewaySlot *mixmessages.GatewaySlot) []byte
GenerateSlotDigest serializes the gateway slot message for the client to hash
Types ¶
type Instance ¶
type Instance struct {
// contains filtered or unexported fields
}
The Instance struct stores a combination of comms info and round info for servers
func NewInstance ¶
func NewInstance(c *connect.ProtoComms, partial, full *ndf.NetworkDefinition, ers ds.ExternalRoundStorage, validationLevel ValidationType, useElliptic bool) (*Instance, error)
Initializer for instance structs from base comms and NDF, you can put in nil for ERS if you don't want to use it useElliptic determines whether client will verify signatures using the RSA key or the elliptic curve key.
func NewInstanceTesting ¶
func NewInstanceTesting(c *connect.ProtoComms, partial, full *ndf.NetworkDefinition, e2eGroup, cmixGroup *cyclic.Group, i interface{}) (*Instance, error)
Utility function to create instance FOR TESTING PURPOSES ONLY
func (*Instance) GetAddGatewayChan ¶
func (i *Instance) GetAddGatewayChan() chan NodeGateway
Return AddGateway channel from Instance
func (*Instance) GetCmixGroup ¶
GetE2EGroup gets the cmixGroup from the instance
func (*Instance) GetE2EGroup ¶
GetE2EGroup gets the e2eGroup from the instance
func (*Instance) GetEllipticPublicKey ¶
GetEllipticPublicKey gets the permissioning's elliptic public key from one of the NDFs It first checks the full ndf and returns if that has the key If not it checks the partial ndf and returns if it has it Otherwise it returns an empty string
func (*Instance) GetFullNdf ¶
func (i *Instance) GetFullNdf() *SecuredNdf
Return the full NDF from this instance
func (*Instance) GetHistoricalRound ¶
Calls the underlying interface's function to get a specific round from history
func (*Instance) GetHistoricalRoundRange ¶
Calls the underlying interface's function to get a range of rounds from history
func (*Instance) GetHistoricalRounds ¶
Calls the underlying interface's function to get specific rounds from history
func (*Instance) GetIpOverrideList ¶
func (i *Instance) GetIpOverrideList() *ds.IpOverrideList
overrides an IP address for an ID with one from
func (*Instance) GetLastRoundID ¶
get the most recent round id
func (*Instance) GetLastUpdateID ¶
get the most recent update id
func (*Instance) GetNodeAndGateway ¶
func (i *Instance) GetNodeAndGateway(ngid *id.ID) (NodeGateway, error)
Gets the node and gateway with the given ID
func (*Instance) GetOldestRoundID ¶
Get the oldest round id
func (*Instance) GetPartialNdf ¶
func (i *Instance) GetPartialNdf() *SecuredNdf
Return the partial ndf from this instance
func (*Instance) GetPermissioningAddress ¶
GetPermissioningAddress gets the permissioning address from one of the NDF It first checks the full ndf and returns if that has the address If not it checks the partial ndf and returns if it has it Otherwise it returns an empty string
func (*Instance) GetPermissioningCert ¶
GetPermissioningCert gets the permissioning certificate from one of the NDFs It first checks the full ndf and returns if that has the cert If not it checks the partial ndf and returns if it has it Otherwise it returns an empty string
func (*Instance) GetPermissioningId ¶
GetPermissioningId gets the permissioning ID from primitives
func (*Instance) GetRoundEvents ¶
func (i *Instance) GetRoundEvents() *ds.RoundEvents
Return the Instance RoundEvents object
func (*Instance) GetRoundUpdate ¶
Get an update ID
func (*Instance) GetRoundUpdates ¶
Get updates from a given round
func (*Instance) GetWaitingRounds ¶
func (i *Instance) GetWaitingRounds() *ds.WaitingRounds
Return the Instance WaitingRounds object
func (*Instance) GetWrappedRound ¶
Get the round of a given ID as a ds.Round object
func (*Instance) RoundUpdate ¶
Add a round to the round and update buffer
func (*Instance) RoundUpdates ¶
Pluralized version of RoundUpdate used by Client
func (*Instance) SetAddGatewayChan ¶
func (i *Instance) SetAddGatewayChan(c chan NodeGateway)
Register AddGateway channel with Instance
func (*Instance) SetAddNodeChan ¶
func (i *Instance) SetAddNodeChan(c chan NodeGateway)
Register AddNode channel with Instance
func (*Instance) SetGatewayAuthentication ¶
func (i *Instance) SetGatewayAuthentication()
SetGatewayAuth will force authentication on all communications with gateways intended for use between Gateway <-> Gateway communications
func (*Instance) SetNetworkHealthChan ¶
Register NetworkHealth channel with Instance
func (*Instance) SetRemoveGatewayChan ¶
Register RemoveGateway channel with Instance
func (*Instance) SetRemoveNodeChan ¶
Register RemoveNode channel with Instance
func (*Instance) UpdateFullNdf ¶
update the full ndf
func (*Instance) UpdateGatewayConnections ¶
Update gateway hosts based on most complete ndf
func (*Instance) UpdateNodeConnections ¶
Update node hosts based on most complete ndf
type NodeGateway ¶
Combines a node and gateway together together for return over channels
type SecuredNdf ¶
type SecuredNdf struct {
// contains filtered or unexported fields
}
wraps the ndf data structure, expoting all the functionality expect the ability to change the ndf
func NewSecuredNdf ¶
func NewSecuredNdf(definition *ndf.NetworkDefinition) (*SecuredNdf, error)
Initialize a securedNdf from a primitives NetworkDefinition object
func (*SecuredNdf) CompareHash ¶
func (sndf *SecuredNdf) CompareHash(h []byte) bool
Compare a hash to the stored
func (*SecuredNdf) Get ¶
func (sndf *SecuredNdf) Get() *ndf.NetworkDefinition
Get the primitives object for an ndf
type ValidationType ¶
type ValidationType uint8
Level of validation types for pulling our round structure
Strict: Signatures are checked every time (intended for nodes) Lazy: Only check we're involved, only verifies the first retrieval None: no signature checks are done
const ( Strict ValidationType = iota Lazy None )
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package dataStructures stores callbacks that will be called in the process of running a round.
|
Package dataStructures stores callbacks that will be called in the process of running a round. |