# Functions
CalcLatencyStatistics calculates average and deviation from a slice of latencies.
CloneDKGComplaint clones a tpyesDKG.Complaint instance.
CloneDKGFinalize clones a typesDKG.Finalize instance.
CloneDKGMasterPublicKey clones a typesDKG.MasterPublicKey instance.
CloneDKGMPKReady clones a typesDKG.MPKReady instance.
CloneDKGPrivateShare clones a typesDKG.PrivateShare instance.
CloneDKGSuccess clones a typesDKG.Success instance.
FindMyIP returns local IP address.
GenerateRandomNodeIDs generates randomly a slices of types.NodeID.
GenerateRandomPrivateKeys generate a set of private keys.
NewApp constructs a TestApp instance.
NewBlockRevealerByPosition constructs a block revealer in the order of compaction chain.
NewDefaultMarshaller constructs an DefaultMarshaller instance.
NewFakeTransportClient constructs FakeTransport instance for peer.
NewFakeTransportServer constructs FakeTransport instance for peer server.
NewGovernance constructs a Governance instance.
NewKeys creates private keys and corresponding public keys as slice.
NewNetwork setup network stuffs for nodes, which provides an implementation of core.Network based on TransportClient.
NewState constructs an State instance with genesis information, including: - node set - crs.
NewStateChangeRequest constructs an StateChangeRequest instance.
NewTCPTransport constructs an TCPTransport instance.
NewTCPTransportClient constructs a TCPTransportClient instance.
NewTCPTransportServer constructs TCPTransportServer instance.
VerifyDB check if a database is valid after test.
# Constants
NetworkType enums.
NetworkType enums.
NetworkType enums.
DKG & CRS.
Types of state change.
Types of state change.
Types of state change.
Types of state change.
Types of state change.
Node set related.
Configuration related.
Types of state change.
Types of state change.
Types of state change.
Types of state change.
Types of state change.
Types of state change.
TransportPeer is the type of peer.
TransportPeerServer is the type of peer server.
# Variables
ErrAckingBlockNotDelivered means the delivered sequence not forming a DAG.
ErrApplicationIntegrityFailed means the internal datum in a App instance is not integrated.
ErrChangeWontApply means the state change won't be applied for some reason.
ErrCompactionChainTipBlockNotExists raised when the hash of compaction chain tip doesn't match a block in database.
ErrConfirmedHeightNotIncreasing raise when the height of the confirmed block doesn't follow previous confirmed block on the same chain.
ErrConnectToUnexpectedPeer is reported if connect to unexpected peer.
ErrDeliveredBlockNotConfirmed means some block delivered (confirmed) but not confirmed.
ErrDuplicatedChange means the change request is already applied.
ErrEmptyCompactionChainTipInfo raised when a compaction chain tip info is empty.
ErrEmptyDeliverSequence means there is no delivery event in this App instance.
ErrEmptyRandomness raised when the block contains empty randomness.
ErrForkedCRS means a different CRS for one round is proposed.
ErrHeightOutOfOrder means the later delivered block has height not equal to height of previous block plus one.
ErrInvalidHeight refers to invalid value for block height.
ErrLowerPendingHeight raised when lastPendingHeight is lower than the height to be prepared.
ErrMessageOverflow is reported if the message is too long.
ErrMismatchBlockHash raise when the hash for that block mismatched.
ErrMismatchBlockHashSequence means the delivering sequence between two App instances are different.
ErrMismatchDeliverPosition raised when the block hash and position are mismatched when calling BlockDelivered.
ErrMismatchRandomness means the randomness between two blocks with the same hash from two App instances are different.
ErrMissingPreviousCRS means previous CRS not found when proposing a specific round of CRS.
ErrNotInRemoteMode means callers attempts to call functions for remote mode when the State instance is still in local mode.
Errors returns from block-revealer.
ErrParentBlockNotDelivered raised when the parent block is not seen by this app.
ErrProposerIsFinal means a proposer of one complaint is finalized.
ErrProposerMPKIsReady means a proposer of one mpk is ready.
ErrStateConfigNotEqual means configuration part of two states is not equal.
ErrStateCRSsNotEqual means CRSs of two states are not equal.
ErrStateDKGComplaintsNotEqual means DKG complaints for two states are not equal.
ErrStateDKGFinalsNotEqual means DKG finalizations of two states are not equal.
ErrStateDKGMasterPublicKeysNotEqual means DKG master public keys of two states are not equal.
ErrStateDKGMPKReadysNotEqual means DKG readys of two states are not equal.
ErrStateDKGResetCountNotEqual means dkgResetCount of two states are not equal.
ErrStateDKGSuccessesNotEqual means DKG successes of two states are not equal.
ErrStateLocalFlagNotEqual means local flag of two states is not equal.
ErrStateNodeSetNotEqual means node sets of two states are not equal.
ErrStatePendingChangesNotEqual means pending change requests of two states are not equal.
ErrTCPHandShakeFail is reported if the tcp handshake fails.
ErrTimestampOutOfOrder means the later delivered block has timestamp older than previous block.
ErrUnknownStateChangeType means a StateChangeType is not recognized.
# Structs
App implements Application interface for testing purpose.
AppDeliveredRecord caches information when this application received a block delivered notification.
BlockEventMessage is for monitoring block events' time.
BlockRevealerByPosition implements BlockRevealer interface, which would load all blocks from db, reveal them in the order of compaction chain, from the genesis block to the latest one.
DefaultMarshaller is the default marshaller for testing core.Consensus.
FakeTransport implement TransportServer and TransportClient interface by using golang channel.
FixedLatencyModel return fixed latencies.
Governance is an implementation of Goverance for testing purpose.
Network implements core.Network interface based on TransportClient.
NetworkConfig is the configuration for Network module.
NormalLatencyModel would return latencies in normal distribution.
PullRequest is a generic request to pull everything (ex.
State emulates what the global state in governace contract on a fullnode.
StateChangeRequest carries information of state change request.
TCPTransport implements Transport interface via TCP connection.
TCPTransportClient implement TransportClient base on TCP connection.
TCPTransportServer implements TransportServer via TCP connections.
ThroughputRecord records the network throughput data.
TransportEnvelope define the payload format of a message when transporting.
# Interfaces
BlockRevealer defines the interface to reveal a group of pre-generated blocks.
LatencyModel defines an interface to randomly decide latency for one operation.
Marshaller defines an interface to convert between interface{} and []byte.
NetworkCensor is a interface to determine if a message should be censored.
Transport defines the interface for basic transportation capabilities.
TransportClient defines those peers in the network.
TransportServer defines the peer server in the network.
# Type aliases
NetworkType is the simulation network type.
StateChangeType is the type of state change request.
TransportPeerType defines the type of peer, either 'peer' or 'server'.