Documentation ¶
Overview ¶
Package isaac is the core library for mitum.
Index ¶
- Variables
- func CheckBallotSigningNode(fs base.BallotFactSign, nodepool *network.Nodepool) error
- func CheckNodeIsProposer(n base.Address, suffrage base.Suffrage, height base.Height, round base.Round) error
- func NewACCEPTBallot(n base.Address, newBlock block.Block, voteproof base.Voteproof, ...) (base.ACCEPTBallot, error)
- func NewDefaultProcessorNewFunc(db storage.Database, bd blockdata.Blockdata, nodepool *network.Nodepool, ...) prprocessor.ProcessorNewFunc
- func NewINITBallotRound0(n base.Address, db storage.Database, pk key.Privatekey, ...) (base.INITBallot, error)
- func NewINITBallotWithVoteproof(n base.Address, db storage.Database, voteproof base.Voteproof, ...) (base.INITBallot, error)
- type BallotChecker
- func (bc *BallotChecker) CheckProposalInACCEPTBallot() (bool, error)
- func (bc *BallotChecker) CheckSigning() (bool, error)
- func (bc *BallotChecker) CheckVoteproof() (bool, error)
- func (bc *BallotChecker) CheckWithLastVoteproof() (bool, error)
- func (bc *BallotChecker) InSuffrage() (bool, error)
- func (bc *BallotChecker) InTimespan() (bool, error)
- func (bc *BallotChecker) IsFromAliveNode() (bool, error)
- func (bc *BallotChecker) IsFromLocal() (bool, error)
- type Ballotbox
- type BlockIntegrityError
- type DefaultProcessor
- func (pp *DefaultProcessor) BaseManifest() block.Manifest
- func (pp *DefaultProcessor) Block() block.Block
- func (pp *DefaultProcessor) Cancel() error
- func (pp *DefaultProcessor) Fact() base.ProposalFact
- func (pp *DefaultProcessor) Prepare(ctx context.Context) (block.Block, error)
- func (pp *DefaultProcessor) Save(ctx context.Context) error
- func (pp *DefaultProcessor) SetACCEPTVoteproof(acceptVoteproof base.Voteproof) error
- func (pp *DefaultProcessor) SignedFact() base.SignedBallotFact
- func (pp *DefaultProcessor) State() prprocessor.State
- func (pp *DefaultProcessor) Statics() map[string]interface{}
- func (pp *DefaultProcessor) SuffrageInfo() block.SuffrageInfoV0
- type GeneralSyncer
- func (cs *GeneralSyncer) Close() error
- func (cs *GeneralSyncer) HeightFrom() base.Height
- func (cs *GeneralSyncer) HeightTo() base.Height
- func (cs *GeneralSyncer) ID() string
- func (cs *GeneralSyncer) Prepare() error
- func (cs *GeneralSyncer) SetLogging(l *logging.Logging) *logging.Logging
- func (cs *GeneralSyncer) SetStateChan(stateChan chan<- SyncerStateChangedContext) *GeneralSyncer
- func (cs *GeneralSyncer) State() SyncerState
- func (cs *GeneralSyncer) TailManifest() block.Manifest
- type GenesisBlockV0Generator
- type LocalPolicy
- func (lp *LocalPolicy) Config() map[string]interface{}
- func (lp *LocalPolicy) IntervalBroadcastingACCEPTBallot() time.Duration
- func (lp *LocalPolicy) IntervalBroadcastingINITBallot() time.Duration
- func (lp *LocalPolicy) IntervalBroadcastingProposal() time.Duration
- func (lp *LocalPolicy) MarshalJSON() ([]byte, error)
- func (lp *LocalPolicy) MaxOperationsInProposal() uint
- func (lp *LocalPolicy) MaxOperationsInSeal() uint
- func (lp *LocalPolicy) NetworkConnectionTimeout() time.Duration
- func (lp *LocalPolicy) NetworkID() base.NetworkID
- func (lp *LocalPolicy) SetIntervalBroadcastingACCEPTBallot(d time.Duration) (*LocalPolicy, error)
- func (lp *LocalPolicy) SetIntervalBroadcastingINITBallot(d time.Duration) (*LocalPolicy, error)
- func (lp *LocalPolicy) SetIntervalBroadcastingProposal(d time.Duration) (*LocalPolicy, error)
- func (lp *LocalPolicy) SetMaxOperationsInProposal(m uint) (*LocalPolicy, error)
- func (lp *LocalPolicy) SetMaxOperationsInSeal(m uint) (*LocalPolicy, error)
- func (lp *LocalPolicy) SetNetworkConnectionTimeout(d time.Duration) (*LocalPolicy, error)
- func (lp *LocalPolicy) SetThresholdRatio(ratio base.ThresholdRatio) *LocalPolicy
- func (lp *LocalPolicy) SetTimeoutWaitingProposal(d time.Duration) (*LocalPolicy, error)
- func (lp *LocalPolicy) SetTimespanValidBallot(d time.Duration) (*LocalPolicy, error)
- func (lp *LocalPolicy) SetWaitBroadcastingACCEPTBallot(d time.Duration) (*LocalPolicy, error)
- func (lp *LocalPolicy) ThresholdRatio() base.ThresholdRatio
- func (lp *LocalPolicy) TimeoutWaitingProposal() time.Duration
- func (lp *LocalPolicy) TimespanValidBallot() time.Duration
- func (lp *LocalPolicy) WaitBroadcastingACCEPTBallot() time.Duration
- type ManifestsValidationChecker
- type OperationsExtractor
- type ProposalChecker
- func (pvc *ProposalChecker) CheckSigning() (bool, error)
- func (pvc *ProposalChecker) IsKnown() (bool, error)
- func (pvc *ProposalChecker) IsOlder() (bool, error)
- func (pvc *ProposalChecker) IsProposer() (bool, error)
- func (pvc *ProposalChecker) IsWaiting() (bool, error)
- func (pvc *ProposalChecker) SaveProposal() (bool, error)
- type ProposalMaker
- type SealChecker
- type Syncer
- type SyncerState
- type SyncerStateChangedContext
- type Syncers
- func (sy *Syncers) Add(to base.Height, sourceNodes []base.Node) (bool, error)
- func (sy *Syncers) IsFinished() bool
- func (sy *Syncers) SetLogging(l *logging.Logging) *logging.Logging
- func (sy *Syncers) Stop() error
- func (sy *Syncers) WhenBlockSaved(callback func([]block.Block))
- func (sy *Syncers) WhenFinished(callback func(base.Height))
- type VoteProofChecker
- type VoteRecords
Constants ¶
This section is empty.
Variables ¶
var ( // NOTE default threshold ratio assumes only one node exists, it means the network is just booted. DefaultPolicyThresholdRatio = base.ThresholdRatio(100) DefaultPolicyNumberOfActingSuffrageNodes = uint(1) DefaultPolicyMaxOperationsInSeal uint = 100 DefaultPolicyMaxOperationsInProposal uint = 100 DefaultPolicyTimeoutWaitingProposal = time.Second * 5 DefaultPolicyIntervalBroadcastingINITBallot = time.Second * 1 DefaultPolicyIntervalBroadcastingProposal = time.Second * 1 DefaultPolicyWaitBroadcastingACCEPTBallot = time.Second * 1 DefaultPolicyIntervalBroadcastingACCEPTBallot = time.Second * 1 DefaultPolicyTimespanValidBallot = time.Minute * 1 DefaultPolicyNetworkConnectionTimeout = time.Second * 3 )
var KnownSealError = util.NewError("seal is known")
Functions ¶
func CheckBallotSigningNode ¶
func CheckBallotSigningNode(fs base.BallotFactSign, nodepool *network.Nodepool) error
func CheckNodeIsProposer ¶
func NewACCEPTBallot ¶
func NewINITBallotRound0 ¶
Types ¶
type BallotChecker ¶
func NewBallotChecker ¶
func (*BallotChecker) CheckProposalInACCEPTBallot ¶
func (bc *BallotChecker) CheckProposalInACCEPTBallot() (bool, error)
CheckProposalInACCEPTBallot checks ACCEPT ballot should have valid proposal.
func (*BallotChecker) CheckSigning ¶
func (bc *BallotChecker) CheckSigning() (bool, error)
CheckSigning checks node signed by it's valid key.
func (*BallotChecker) CheckVoteproof ¶
func (bc *BallotChecker) CheckVoteproof() (bool, error)
func (*BallotChecker) CheckWithLastVoteproof ¶
func (bc *BallotChecker) CheckWithLastVoteproof() (bool, error)
CheckWithLastVoteproof checks Ballot.Height() and Ballot.Round() with last Block. - If Height is same or lower than last, Ballot will be ignored.
func (*BallotChecker) InSuffrage ¶
func (bc *BallotChecker) InSuffrage() (bool, error)
InSuffrage checks BallotFactSign.Node() is inside suffrage
func (*BallotChecker) InTimespan ¶
func (bc *BallotChecker) InTimespan() (bool, error)
InTimespan checks whether ballot is signed at a given interval, policy.TimespanValidBallot().
func (*BallotChecker) IsFromAliveNode ¶
func (bc *BallotChecker) IsFromAliveNode() (bool, error)
func (*BallotChecker) IsFromLocal ¶
func (bc *BallotChecker) IsFromLocal() (bool, error)
IsFromLocal filters ballots from local thru network; whether it is from the other node, which has same node address
type Ballotbox ¶
Ballotbox collects ballots and keeps track of majority.
func NewBallotbox ¶
func (*Ballotbox) LatestBallot ¶
type BlockIntegrityError ¶
func NewBlockIntegrityError ¶
func NewBlockIntegrityError(from block.Manifest, err error) *BlockIntegrityError
type DefaultProcessor ¶
type DefaultProcessor struct { sync.RWMutex *logging.Logging // contains filtered or unexported fields }
func NewDefaultProcessor ¶
func (*DefaultProcessor) BaseManifest ¶
func (pp *DefaultProcessor) BaseManifest() block.Manifest
func (*DefaultProcessor) Block ¶
func (pp *DefaultProcessor) Block() block.Block
func (*DefaultProcessor) Cancel ¶
func (pp *DefaultProcessor) Cancel() error
func (*DefaultProcessor) Fact ¶
func (pp *DefaultProcessor) Fact() base.ProposalFact
func (*DefaultProcessor) SetACCEPTVoteproof ¶
func (pp *DefaultProcessor) SetACCEPTVoteproof(acceptVoteproof base.Voteproof) error
func (*DefaultProcessor) SignedFact ¶
func (pp *DefaultProcessor) SignedFact() base.SignedBallotFact
func (*DefaultProcessor) State ¶
func (pp *DefaultProcessor) State() prprocessor.State
func (*DefaultProcessor) Statics ¶
func (pp *DefaultProcessor) Statics() map[string]interface{}
func (*DefaultProcessor) SuffrageInfo ¶
func (pp *DefaultProcessor) SuffrageInfo() block.SuffrageInfoV0
type GeneralSyncer ¶
type GeneralSyncer struct { sync.RWMutex *logging.Logging // contains filtered or unexported fields }
GeneralSyncer will sync for the closed network.
> The closed network means that the network does not allowed the anonymous node to enter the network.
GeneralSyncer has the managed suffrage members, so there are the specific sources to fetch the blocks.
Before starting GeneralSyncer, these sources should be specified.
1. GeneralSyncer will try to fetch the manifest from all of them. 1. and then will compare the fetched manifests. 1. if some nodes does not respond, that node will be ignored. 1. the fetched data from nodes should be over threshold(2/3).
> 'from' and 'to' is not index number. If from=1 and to=5, GeneralSyncer will sync [1,2,3,4,5].
func NewGeneralSyncer ¶
func (*GeneralSyncer) Close ¶
func (cs *GeneralSyncer) Close() error
func (*GeneralSyncer) HeightFrom ¶
func (cs *GeneralSyncer) HeightFrom() base.Height
func (*GeneralSyncer) HeightTo ¶
func (cs *GeneralSyncer) HeightTo() base.Height
func (*GeneralSyncer) ID ¶
func (cs *GeneralSyncer) ID() string
func (*GeneralSyncer) Prepare ¶
func (cs *GeneralSyncer) Prepare() error
func (*GeneralSyncer) SetLogging ¶
func (cs *GeneralSyncer) SetLogging(l *logging.Logging) *logging.Logging
func (*GeneralSyncer) SetStateChan ¶
func (cs *GeneralSyncer) SetStateChan(stateChan chan<- SyncerStateChangedContext) *GeneralSyncer
func (*GeneralSyncer) State ¶
func (cs *GeneralSyncer) State() SyncerState
func (*GeneralSyncer) TailManifest ¶
func (cs *GeneralSyncer) TailManifest() block.Manifest
type GenesisBlockV0Generator ¶
type LocalPolicy ¶
func NewLocalPolicy ¶
func NewLocalPolicy(networkID base.NetworkID) *LocalPolicy
func (*LocalPolicy) Config ¶
func (lp *LocalPolicy) Config() map[string]interface{}
func (*LocalPolicy) IntervalBroadcastingACCEPTBallot ¶
func (lp *LocalPolicy) IntervalBroadcastingACCEPTBallot() time.Duration
func (*LocalPolicy) IntervalBroadcastingINITBallot ¶
func (lp *LocalPolicy) IntervalBroadcastingINITBallot() time.Duration
func (*LocalPolicy) IntervalBroadcastingProposal ¶
func (lp *LocalPolicy) IntervalBroadcastingProposal() time.Duration
func (*LocalPolicy) MarshalJSON ¶
func (lp *LocalPolicy) MarshalJSON() ([]byte, error)
func (*LocalPolicy) MaxOperationsInProposal ¶
func (lp *LocalPolicy) MaxOperationsInProposal() uint
func (*LocalPolicy) MaxOperationsInSeal ¶
func (lp *LocalPolicy) MaxOperationsInSeal() uint
func (*LocalPolicy) NetworkConnectionTimeout ¶
func (lp *LocalPolicy) NetworkConnectionTimeout() time.Duration
func (*LocalPolicy) NetworkID ¶
func (lp *LocalPolicy) NetworkID() base.NetworkID
func (*LocalPolicy) SetIntervalBroadcastingACCEPTBallot ¶
func (lp *LocalPolicy) SetIntervalBroadcastingACCEPTBallot(d time.Duration) (*LocalPolicy, error)
func (*LocalPolicy) SetIntervalBroadcastingINITBallot ¶
func (lp *LocalPolicy) SetIntervalBroadcastingINITBallot(d time.Duration) (*LocalPolicy, error)
func (*LocalPolicy) SetIntervalBroadcastingProposal ¶
func (lp *LocalPolicy) SetIntervalBroadcastingProposal(d time.Duration) (*LocalPolicy, error)
func (*LocalPolicy) SetMaxOperationsInProposal ¶
func (lp *LocalPolicy) SetMaxOperationsInProposal(m uint) (*LocalPolicy, error)
func (*LocalPolicy) SetMaxOperationsInSeal ¶
func (lp *LocalPolicy) SetMaxOperationsInSeal(m uint) (*LocalPolicy, error)
func (*LocalPolicy) SetNetworkConnectionTimeout ¶
func (lp *LocalPolicy) SetNetworkConnectionTimeout(d time.Duration) (*LocalPolicy, error)
func (*LocalPolicy) SetThresholdRatio ¶
func (lp *LocalPolicy) SetThresholdRatio(ratio base.ThresholdRatio) *LocalPolicy
func (*LocalPolicy) SetTimeoutWaitingProposal ¶
func (lp *LocalPolicy) SetTimeoutWaitingProposal(d time.Duration) (*LocalPolicy, error)
func (*LocalPolicy) SetTimespanValidBallot ¶
func (lp *LocalPolicy) SetTimespanValidBallot(d time.Duration) (*LocalPolicy, error)
func (*LocalPolicy) SetWaitBroadcastingACCEPTBallot ¶
func (lp *LocalPolicy) SetWaitBroadcastingACCEPTBallot(d time.Duration) (*LocalPolicy, error)
func (*LocalPolicy) ThresholdRatio ¶
func (lp *LocalPolicy) ThresholdRatio() base.ThresholdRatio
func (*LocalPolicy) TimeoutWaitingProposal ¶
func (lp *LocalPolicy) TimeoutWaitingProposal() time.Duration
func (*LocalPolicy) TimespanValidBallot ¶
func (lp *LocalPolicy) TimespanValidBallot() time.Duration
func (*LocalPolicy) WaitBroadcastingACCEPTBallot ¶
func (lp *LocalPolicy) WaitBroadcastingACCEPTBallot() time.Duration
type ManifestsValidationChecker ¶
type ManifestsValidationChecker struct {
// contains filtered or unexported fields
}
func NewManifestsValidationChecker ¶
func NewManifestsValidationChecker( networkID base.NetworkID, manifests []block.Manifest, ) *ManifestsValidationChecker
func (*ManifestsValidationChecker) CheckSerialized ¶
func (bc *ManifestsValidationChecker) CheckSerialized() (bool, error)
type OperationsExtractor ¶
func NewOperationsExtractor ¶
type ProposalChecker ¶
func (*ProposalChecker) CheckSigning ¶
func (pvc *ProposalChecker) CheckSigning() (bool, error)
CheckSigning checks node signed by it's valid key.
func (*ProposalChecker) IsKnown ¶
func (pvc *ProposalChecker) IsKnown() (bool, error)
IsKnown checks proposal is already received; if found, no nore checks.
func (*ProposalChecker) IsOlder ¶
func (pvc *ProposalChecker) IsOlder() (bool, error)
func (*ProposalChecker) IsProposer ¶
func (pvc *ProposalChecker) IsProposer() (bool, error)
func (*ProposalChecker) IsWaiting ¶
func (pvc *ProposalChecker) IsWaiting() (bool, error)
func (*ProposalChecker) SaveProposal ¶
func (pvc *ProposalChecker) SaveProposal() (bool, error)
type ProposalMaker ¶
func NewProposalMaker ¶
func NewProposalMaker( local node.Local, db storage.Database, policy *LocalPolicy, ) *ProposalMaker
type SealChecker ¶
type SealChecker struct {
// contains filtered or unexported fields
}
func NewSealChecker ¶
func NewSealChecker( sl seal.Seal, database storage.Database, policy *LocalPolicy, sealCache cache.Cache, ) SealChecker
func (SealChecker) IsKnown ¶
func (svc SealChecker) IsKnown() (bool, error)
func (SealChecker) IsValid ¶
func (svc SealChecker) IsValid() (bool, error)
func (SealChecker) IsValidOperationSeal ¶
func (svc SealChecker) IsValidOperationSeal() (bool, error)
type SyncerState ¶
type SyncerState uint8
const ( SyncerCreated SyncerState SyncerPreparing SyncerPrepared SyncerSaving SyncerSaved )
func (SyncerState) String ¶
func (ss SyncerState) String() string
type SyncerStateChangedContext ¶
type SyncerStateChangedContext struct {
// contains filtered or unexported fields
}
func NewSyncerStateChangedContext ¶
func NewSyncerStateChangedContext(syncer Syncer, state SyncerState, blocks []block.Block) SyncerStateChangedContext
func (SyncerStateChangedContext) Blocks ¶
func (ss SyncerStateChangedContext) Blocks() []block.Block
func (SyncerStateChangedContext) State ¶
func (ss SyncerStateChangedContext) State() SyncerState
func (SyncerStateChangedContext) Syncer ¶
func (ss SyncerStateChangedContext) Syncer() Syncer
type Syncers ¶
type Syncers struct { sync.RWMutex *util.ContextDaemon *logging.Logging // contains filtered or unexported fields }
func NewSyncers ¶
func (*Syncers) Add ¶
Add adds new syncer with target height. If it returns true, it means Syncers not yet finished.
func (*Syncers) IsFinished ¶
func (*Syncers) WhenBlockSaved ¶
func (*Syncers) WhenFinished ¶
type VoteProofChecker ¶
func NewVoteProofChecker ¶
func NewVoteProofChecker(voteproof base.Voteproof, policy *LocalPolicy, suffrage base.Suffrage) *VoteProofChecker
func (*VoteProofChecker) CheckThreshold ¶
func (vc *VoteProofChecker) CheckThreshold() (bool, error)
CheckThreshold checks Threshold only for new incoming Voteproof.
func (*VoteProofChecker) IsValid ¶
func (vc *VoteProofChecker) IsValid() (bool, error)
func (*VoteProofChecker) NodeIsInSuffrage ¶
func (vc *VoteProofChecker) NodeIsInSuffrage() (bool, error)
type VoteRecords ¶
func NewVoteRecords ¶
Source Files ¶
- ballot.go
- ballot_checker.go
- ballotbox.go
- block_checker.go
- doc.go
- genesis_v0.go
- localpolicy.go
- localpolicy_json.go
- operation.go
- proposal_checker.go
- proposal_maker.go
- proposal_processor.go
- proposal_processor_prepare.go
- proposal_processor_save.go
- seal_checker.go
- syncer.go
- syncer_general.go
- syncers.go
- voteproof_checker.go
- voterecords.go