Documentation
¶
Index ¶
- Variables
- func Init(ctx context.Context, s *setting.Setting, b broadcaster)
- func IsSynced() bool
- func IsValid(s *setting.Setting, tr *tx.Transaction, typ tx.Type) error
- func NewProposal(ctx context.Context, s *setting.Setting, hs ...tx.Hash) error
- func RegisterTxNotifier(n chan []tx.Hash)
- func RetryConsensus(ctx context.Context, s *setting.Setting) error
- func SetSynced(s bool)
- type Message
- func (*Message) Descriptor() ([]byte, []int)
- func (this *Message) Equal(that interface{}) bool
- func (m *Message) Marshal() (dAtA []byte, err error)
- func (m *Message) MarshalTo(dAtA []byte) (int, error)
- func (*Message) ProtoMessage()
- func (m *Message) Reset()
- func (m *Message) Size() (n int)
- func (m *Message) String() string
- func (m *Message) Unmarshal(dAtA []byte) error
- func (m *Message) XXX_DiscardUnknown()
- func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Message) XXX_Merge(src proto.Message)
- func (m *Message) XXX_Size() int
- func (m *Message) XXX_Unmarshal(b []byte) error
- type Proposal
- func (*Proposal) Descriptor() ([]byte, []int)
- func (this *Proposal) Equal(that interface{}) bool
- func (m *Proposal) Marshal() (dAtA []byte, err error)
- func (m *Proposal) MarshalTo(dAtA []byte) (int, error)
- func (*Proposal) ProtoMessage()
- func (m *Proposal) Reset()
- func (m *Proposal) Size() (n int)
- func (m *Proposal) String() string
- func (m *Proposal) Unmarshal(dAtA []byte) error
- func (m *Proposal) XXX_DiscardUnknown()
- func (m *Proposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Proposal) XXX_Merge(src proto.Message)
- func (m *Proposal) XXX_Size() int
- func (m *Proposal) XXX_Unmarshal(b []byte) error
- type Validation
- func (*Validation) Descriptor() ([]byte, []int)
- func (this *Validation) Equal(that interface{}) bool
- func (m *Validation) Marshal() (dAtA []byte, err error)
- func (m *Validation) MarshalTo(dAtA []byte) (int, error)
- func (*Validation) ProtoMessage()
- func (m *Validation) Reset()
- func (m *Validation) Size() (n int)
- func (m *Validation) String() string
- func (m *Validation) Unmarshal(dAtA []byte) error
- func (m *Validation) XXX_DiscardUnknown()
- func (m *Validation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Validation) XXX_Merge(src proto.Message)
- func (m *Validation) XXX_Size() int
- func (m *Validation) XXX_Unmarshal(b []byte) error
- type ValidationT
- type Vote
- func (*Vote) Descriptor() ([]byte, []int)
- func (this *Vote) Equal(that interface{}) bool
- func (m *Vote) Marshal() (dAtA []byte, err error)
- func (m *Vote) MarshalTo(dAtA []byte) (int, error)
- func (*Vote) ProtoMessage()
- func (m *Vote) Reset()
- func (m *Vote) Size() (n int)
- func (m *Vote) String() string
- func (m *Vote) Unmarshal(dAtA []byte) error
- func (m *Vote) XXX_DiscardUnknown()
- func (m *Vote) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Vote) XXX_Merge(src proto.Message)
- func (m *Vote) XXX_Size() int
- func (m *Vote) XXX_Unmarshal(b []byte) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidLengthAkconsensus = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowAkconsensus = fmt.Errorf("proto: integer overflow") )
View Source
var ( //Msgch is the channel for sending a message. Msgch = make(chan Message, 100) )
Functions ¶
func NewProposal ¶
NewProposal propse a new confirmation for tx h.
func RegisterTxNotifier ¶
RegisterTxNotifier registers a notifier for resolved txs.
func RetryConsensus ¶
RetryConsensus retries to do consensus for pending txs(mainly due to double spend)
Types ¶
type Message ¶
type Message struct { Proposal []Proposal `protobuf:"bytes,1,rep,name=proposal,proto3" json:"proposal"` Validation []Validation `protobuf:"bytes,2,rep,name=validation,proto3" json:"validation"` Vote []Vote `protobuf:"bytes,3,rep,name=vote,proto3" json:"vote"` Signature *address.Signature `protobuf:"bytes,4,opt,name=signature,proto3" json:"signature,omitempty"` }
func NewPopulatedMessage ¶
func ParseMessage ¶
ParseMessage parses Message and excute an agreement step if needed.
func (*Message) Descriptor ¶
func (*Message) ProtoMessage ¶
func (*Message) ProtoMessage()
func (*Message) XXX_DiscardUnknown ¶
func (m *Message) XXX_DiscardUnknown()
func (*Message) XXX_Marshal ¶
func (*Message) XXX_Unmarshal ¶
type Proposal ¶
type Proposal struct { Value github_com_AidosKuneen_aknode_imesh.Status `protobuf:"varint,1,opt,name=value,proto3,casttype=github.com/AidosKuneen/aknode/imesh.Status" json:"value,omitempty"` Hash github_com_AidosKuneen_aklib_tx.Hash `protobuf:"bytes,2,opt,name=hash,proto3,casttype=github.com/AidosKuneen/aklib/tx.Hash" json:"hash,omitempty"` ValidatorsHash []byte `protobuf:"bytes,3,opt,name=validators_hash,json=validatorsHash,proto3" json:"validators_hash,omitempty"` }
Proposal ia for the first proposal of tx status(VoteValue).
func NewPopulatedProposal ¶
func (*Proposal) Descriptor ¶
func (*Proposal) ProtoMessage ¶
func (*Proposal) ProtoMessage()
func (*Proposal) XXX_DiscardUnknown ¶
func (m *Proposal) XXX_DiscardUnknown()
func (*Proposal) XXX_Marshal ¶
func (*Proposal) XXX_Unmarshal ¶
type Validation ¶
type Validation struct { Accepted []github_com_AidosKuneen_aklib_tx.Hash `protobuf:"bytes,1,rep,name=accepted,proto3,casttype=github.com/AidosKuneen/aklib/tx.Hash" json:"accepted,omitempty"` Rejected []github_com_AidosKuneen_aklib_tx.Hash `protobuf:"bytes,2,rep,name=rejected,proto3,casttype=github.com/AidosKuneen/aklib/tx.Hash" json:"rejected,omitempty"` ForSync bool `protobuf:"varint,3,opt,name=for_sync,json=forSync,proto3" json:"for_sync,omitempty"` }
Validation is for infoming the validated tx hash.
func NewPopulatedValidation ¶
func NewPopulatedValidation(r randyAkconsensus, easy bool) *Validation
func NewValidation ¶
func NewValidation(s *setting.Setting, accepted, rejected []tx.Hash, forSync bool) (*Validation, error)
NewValidation return a new validation struct
func (*Validation) Descriptor ¶
func (*Validation) Descriptor() ([]byte, []int)
func (*Validation) Equal ¶
func (this *Validation) Equal(that interface{}) bool
func (*Validation) Marshal ¶
func (m *Validation) Marshal() (dAtA []byte, err error)
func (*Validation) ProtoMessage ¶
func (*Validation) ProtoMessage()
func (*Validation) Reset ¶
func (m *Validation) Reset()
func (*Validation) Size ¶
func (m *Validation) Size() (n int)
func (*Validation) String ¶
func (m *Validation) String() string
func (*Validation) Unmarshal ¶
func (m *Validation) Unmarshal(dAtA []byte) error
func (*Validation) XXX_DiscardUnknown ¶
func (m *Validation) XXX_DiscardUnknown()
func (*Validation) XXX_Marshal ¶
func (m *Validation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*Validation) XXX_Merge ¶
func (dst *Validation) XXX_Merge(src proto.Message)
func (*Validation) XXX_Size ¶
func (m *Validation) XXX_Size() int
func (*Validation) XXX_Unmarshal ¶
func (m *Validation) XXX_Unmarshal(b []byte) error
type ValidationT ¶
type ValidationT struct { Validation // contains filtered or unexported fields }
ValidationT is for infoming the validated tx hash with updated time.
type Vote ¶
type Vote struct { MBARound byte `protobuf:"varint,1,opt,name=mbaround,proto3,casttype=byte" json:"mbaround,omitempty"` BBARound byte `protobuf:"varint,2,opt,name=bbaround,proto3,casttype=byte" json:"bbaround,omitempty"` BBAStep byte `protobuf:"varint,3,opt,name=bbastep,proto3,casttype=byte" json:"bbastep,omitempty"` Alert bool `protobuf:"varint,4,opt,name=alert,proto3" json:"alert,omitempty"` Halted bool `protobuf:"varint,5,opt,name=halted,proto3" json:"halted,omitempty"` ValidatorsHash []byte `protobuf:"bytes,6,opt,name=validators_hash,json=validatorsHash,proto3" json:"validators_hash,omitempty"` Hash github_com_AidosKuneen_aklib_tx.Hash `protobuf:"bytes,7,opt,name=hash,proto3,casttype=github.com/AidosKuneen/aklib/tx.Hash" json:"hash,omitempty"` SigJ *address.Signature `protobuf:"bytes,8,opt,name=sig_j,json=sigJ,proto3" json:"sig_j,omitempty"` }
Vote is for voting alert flag.
func NewPopulatedVote ¶
func (*Vote) Descriptor ¶
func (*Vote) ProtoMessage ¶
func (*Vote) ProtoMessage()
func (*Vote) XXX_DiscardUnknown ¶
func (m *Vote) XXX_DiscardUnknown()
func (*Vote) XXX_Unmarshal ¶
Click to show internal directories.
Click to hide internal directories.