Documentation ¶
Index ¶
- Constants
- func BatchIDSlicePb(ids []BatchID) [][]byte
- func ClientWMsPb(wms map[ClientID]ClientWM) map[string]uint64
- func ErrorFromPb(ok bool, errStr string) error
- func ErrorPb(err error) (ok bool, errStr string)
- func Membership(membershipPb *commonpb.Membership) map[NodeID]NodeAddress
- func MembershipPb(membership map[NodeID]NodeAddress) *commonpb.Membership
- func MembershipSlice(membershipsPb []*commonpb.Membership) []map[NodeID]NodeAddress
- func NodeIDSlicePb(nids []NodeID) []string
- func SeqNrSlicePb(sns []SeqNr) []uint64
- func TxIDSlicePb(ids []TxID) [][]byte
- func Uint64FromBytes(bytes []byte) uint64
- func Uint64ToBytes(n uint64) []byte
- type BatchID
- type BatchIDString
- type ClientID
- type ClientWM
- type EpochNr
- type ModuleID
- type NodeAddress
- type NodeID
- type NumRequests
- type PBFTViewNr
- type ReqNo
- type RequestID
- type RetentionIndex
- type SBInstanceNr
- type SeqNr
- type TimeDuration
- type TxID
Constants ¶
const NodeIDSeparator = Separator
const Separator = "/"
Variables ¶
This section is empty.
Functions ¶
func BatchIDSlicePb ¶
BatchIDSlicePb converts a slice of BatchIDs to a slice of the native type underlying BatchID. This is required for serialization using Protocol Buffers.
func ErrorFromPb ¶
func Membership ¶
func Membership(membershipPb *commonpb.Membership) map[NodeID]NodeAddress
func MembershipPb ¶
func MembershipPb(membership map[NodeID]NodeAddress) *commonpb.Membership
func MembershipSlice ¶
func MembershipSlice(membershipsPb []*commonpb.Membership) []map[NodeID]NodeAddress
func NodeIDSlicePb ¶
NodeIDSlicePb converts a slice of NodeIDs to a slice of the native type underlying NodeID. This is required for serialization using Protocol Buffers.
func SeqNrSlicePb ¶
SeqNrSlicePb converts a slice of SeqNrs to a slice of the native type underlying SeqNr. This is required for serialization using Protocol Buffers.
func TxIDSlicePb ¶
TxIDSlicePb converts a slice of TxIDs to a slice of the native type underlying TxID. This is required for serialization using Protocol Buffers.
func Uint64FromBytes ¶ added in v0.2.0
Types ¶
type BatchID ¶
type BatchID = []byte
BatchID is a unique identifier of a batch.
func BatchIDSlice ¶
BatchIDSlice converts a slice of BatchIDs represented directly as their underlying native type to a slice of abstractly typed batch IDs.
type BatchIDString ¶ added in v0.3.0
type BatchIDString string
type ClientID ¶
type ClientID string
ClientID represents the ID of a client.
func NewClientIDFromInt ¶
type ModuleID ¶
type ModuleID string
ModuleID represents an identifier of a module. The intention is for it to correspond to a path in the module hierarchy. However, technically, the Mir Node only cares for the ID's prefix up to the first separator and ignores the rest. The rest of the ID can be used for any module-specific purposes.
func (ModuleID) Sub ¶
Sub returns the identifier of a submodule within the top-level module, stripped of the top-level module identifier.
type NodeAddress ¶
type NodeAddress multiaddr.Multiaddr
NodeAddress represents the address of a node.
type NodeID ¶
type NodeID string
NodeID represents the ID of a node.
func NewNodeIDFromInt ¶
func NodeIDSlice ¶
NodeIDSlice converts a slice of NodeIDs represented directly as their underlying native type to a slice of abstractly typed node IDs.
type NumRequests ¶
type NumRequests uint64
NumRequests represents the number of requests (e.g. pending in some buffer)
func (NumRequests) Bytes ¶
func (nr NumRequests) Bytes() []byte
func (NumRequests) Pb ¶
func (nr NumRequests) Pb() uint64
Pb converts an EpochNr number to its underlying native type.
type PBFTViewNr ¶
type PBFTViewNr uint64
PBFTViewNr represents the view number in the PBFT protocol (used as a sub-protocol of ISS)
func (PBFTViewNr) Bytes ¶
func (v PBFTViewNr) Bytes() []byte
Bytes converts a PBFTViewNr to a slice of bytes (useful for serialization).
func (PBFTViewNr) Pb ¶
func (v PBFTViewNr) Pb() uint64
Pb converts a PBFTViewNr to its underlying native type
type ReqNo ¶
type ReqNo uint64
ReqNo represents a request number a client assigns to its requests.
type RequestID ¶ added in v0.3.0
type RequestID = uint64
================================================================================ RequestID is used to uniquely identify an outgoing request.
type RetentionIndex ¶
type RetentionIndex uint64
RetentionIndex represents an abstract notion of system progress used in garbage collection. The basic idea is to associate various parts of the system (parts of the state, even whole modules) that are subject to eventual garbage collection with a retention index. As the system progresses, the retention index monotonically increases and parts of the system associated with a lower retention index can be garbage-collected.
func (RetentionIndex) Bytes ¶
func (ri RetentionIndex) Bytes() []byte
Bytes converts a RetentionIndex to a slice of bytes (useful for serialization).
func (RetentionIndex) Pb ¶
func (ri RetentionIndex) Pb() uint64
Pb converts a RetentionIndex to its underlying native type.
type SBInstanceNr ¶
type SBInstanceNr uint64
SBInstanceNr identifies the instance of Sequenced Broadcast (SB) within an epoch.
func (SBInstanceNr) Bytes ¶
func (i SBInstanceNr) Bytes() []byte
func (SBInstanceNr) Pb ¶
func (i SBInstanceNr) Pb() uint64
Pb converts a SBInstanceNr to its underlying native type.
type SeqNr ¶
type SeqNr uint64
SeqNr represents the sequence number of a batch as assigned by the ordering protocol.
func SeqNrSlice ¶
SeqNrSlice converts a slice of SeqNrs represented directly as their underlying native type to a slice of abstractly typed sequence numbers.
type TimeDuration ¶
TimeDuration represents an interval of real time
func (TimeDuration) Bytes ¶
func (td TimeDuration) Bytes() []byte
func (TimeDuration) Pb ¶
func (td TimeDuration) Pb() uint64
Pb converts a TimeDuration to a type used in a Protobuf message.