Documentation ¶
Index ¶
- Variables
- func NewAccusation(epoch uint64, accused, accuser string, ringNum uint32, priv *ecdsa.PrivateKey) *pb.Accusation
- func NewNote(id string, epoch uint64, mask uint32, priv *ecdsa.PrivateKey) *pb.Note
- func NewUnsignedAccusation(epoch uint64, accused, accuser string, ringNum uint32) *pb.Accusation
- func NewUnsignedNote(id string, epoch uint64, mask uint32) *pb.Note
- type Accusation
- type Note
- type Peer
- func (p *Peer) AddAccusation(accused, accuser string, epoch uint64, ringNum uint32, r, s []byte) error
- func (p *Peer) AddNote(mask uint32, epoch uint64, r, s []byte)
- func (p *Peer) AddTestAccusation(a *pb.Accusation)
- func (p *Peer) AllAccusations() []*Accusation
- func (p *Peer) AnyAccusation() *Accusation
- func (p *Peer) Certificate() []byte
- func (p *Peer) ClearAccusations()
- func (p *Peer) ClearNote()
- func (p *Peer) CreateAccusation(accused *Note, self *Peer, ringNum uint32, sign signer) error
- func (p *Peer) IncrementPing()
- func (p *Peer) Info() (*pb.Certificate, *pb.Note, []*pb.Accusation)
- func (p *Peer) IsAccused() bool
- func (p *Peer) NewNote(priv *ecdsa.PrivateKey, epoch uint64)
- func (p *Peer) Note() *Note
- func (p *Peer) NumPing() uint32
- func (p *Peer) PublicKey() *ecdsa.PublicKey
- func (p *Peer) RemoveAccusation(a *Accusation)
- func (p *Peer) RemoveRingAccusation(ringNum uint32)
- func (p *Peer) ResetPing()
- func (p *Peer) RingAccusation(ringNum uint32) *Accusation
- type View
- func (v *View) AddFull(id string, cert *x509.Certificate) error
- func (v *View) AddLive(p *Peer)
- func (v *View) Compare(other *View) error
- func (v *View) DeleteTimeout(id string)
- func (v *View) Exists(id string) bool
- func (v *View) FindNeighbours(id string) []*Peer
- func (v *View) Full() []*Peer
- func (v *View) GossipPartners() []*Peer
- func (v *View) HasTimer(id string) bool
- func (v *View) IsAlive(id string) bool
- func (v *View) Live() []*Peer
- func (v *View) LivePeer(id string) *Peer
- func (v *View) MonitorTarget() (*Peer, uint32)
- func (v *View) MyNeighbours() []*Peer
- func (v *View) MyRingNeighbours(ringNum uint32) (*Peer, *Peer)
- func (v *View) NumRings() uint32
- func (v *View) Peer(id string) *Peer
- func (v *View) RemoveLive(id string)
- func (v *View) RemoveTestFull(id string)
- func (v *View) Self() *Peer
- func (v *View) ShouldBeNeighbour(id string) bool
- func (v *View) ShouldRebuttal(epoch uint64, ringNum uint32) bool
- func (v *View) Start()
- func (v *View) StartTimer(accused *Peer, n *Note, observer *Peer) error
- func (v *View) State() *proto.State
- func (v *View) Stop()
- func (v *View) ValidAccuser(accused, accuser *Peer, ringNum uint32) bool
- func (v *View) ValidMask(mask uint32) bool
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrAccAlreadyExists = errors.New("Accusation already exists")
)
Functions ¶
func NewAccusation ¶
func NewAccusation(epoch uint64, accused, accuser string, ringNum uint32, priv *ecdsa.PrivateKey) *pb.Accusation
ONLY for testing
func NewUnsignedAccusation ¶
func NewUnsignedAccusation(epoch uint64, accused, accuser string, ringNum uint32) *pb.Accusation
ONLY for testing
Types ¶
type Accusation ¶
type Accusation struct {
// contains filtered or unexported fields
}
func (Accusation) Equal ¶
func (a Accusation) Equal(accused, accuser string, ringNum uint32, epoch uint64) bool
func (Accusation) IsAccuser ¶
func (a Accusation) IsAccuser(id string) bool
func (Accusation) IsMoreRecent ¶
func (a Accusation) IsMoreRecent(other uint64) bool
func (Accusation) ToPbMsg ¶
func (a Accusation) ToPbMsg() *pb.Accusation
type Note ¶
type Note struct {
// contains filtered or unexported fields
}
func (*Note) IsMoreRecent ¶
func (Note) IsRingDisabled ¶
type Peer ¶
type Peer struct { Addr string PingAddr string // Debuging and experiments only. HttpAddr string Id string // contains filtered or unexported fields }
func (*Peer) AddAccusation ¶
func (*Peer) AddTestAccusation ¶
func (p *Peer) AddTestAccusation(a *pb.Accusation)
ONLY for testing
func (*Peer) AllAccusations ¶
func (p *Peer) AllAccusations() []*Accusation
func (*Peer) AnyAccusation ¶
func (p *Peer) AnyAccusation() *Accusation
func (*Peer) Certificate ¶
func (*Peer) ClearAccusations ¶
func (p *Peer) ClearAccusations()
func (*Peer) CreateAccusation ¶
func (*Peer) IncrementPing ¶
func (p *Peer) IncrementPing()
func (*Peer) Info ¶
func (p *Peer) Info() (*pb.Certificate, *pb.Note, []*pb.Accusation)
func (*Peer) NewNote ¶
func (p *Peer) NewNote(priv *ecdsa.PrivateKey, epoch uint64)
ONLY for testing
func (*Peer) RemoveAccusation ¶
func (p *Peer) RemoveAccusation(a *Accusation)
func (*Peer) RemoveRingAccusation ¶
func (*Peer) RingAccusation ¶
func (p *Peer) RingAccusation(ringNum uint32) *Accusation
type View ¶
type View struct {
// contains filtered or unexported fields
}
func NewView ¶
func NewView(numRings uint32, cert *x509.Certificate, cm connectionManager, s signer) (*View, error)
func (*View) DeleteTimeout ¶
func (*View) FindNeighbours ¶
func (*View) GossipPartners ¶
func (*View) MonitorTarget ¶
func (*View) MyNeighbours ¶
func (*View) RemoveLive ¶
func (*View) ShouldBeNeighbour ¶
func (*View) ValidAccuser ¶
Click to show internal directories.
Click to hide internal directories.