Documentation
¶
Index ¶
- func CreateConfigCommonBlock(blockNum uint64, prevHash []byte, txCount uint64, ...) (*common.Block, error)
- func CreateConsensusRulesVerifier(config *config.ConsenterNodeConfig) *requestfilter.RulesVerifier
- func CreateDataCommonBlock(blockNum uint64, prevHash []byte, batchID arma_types.BatchID, txCount uint64, ...) (*common.Block, error)
- func VerifyConfigCommonBlock(configBlock *common.Block, blockNum uint64, prevHash []byte, dataHash []byte, ...) error
- func VerifyDataCommonBlock(block *common.Block, blockNum uint64, prevHash []byte, ...) error
- type Arma
- type BFT
- type BatchAttestationDB
- type ConfigApplier
- type Consensus
- func (c *Consensus) AssembleProposal(metadata []byte, requests [][]byte) smartbft_types.Proposal
- func (c *Consensus) AuxiliaryData(i []byte) []byte
- func (c *Consensus) Deliver(proposal smartbft_types.Proposal, signatures []smartbft_types.Signature) smartbft_types.Reconfig
- func (c *Consensus) NotifyEvent(stream protos.Consensus_NotifyEventServer) error
- func (c *Consensus) OnConsensus(channel string, sender uint64, request *orderer.ConsensusRequest) error
- func (c *Consensus) OnSubmit(channel string, sender uint64, req *orderer.SubmitRequest) error
- func (c *Consensus) RequestID(req []byte) smartbft_types.RequestInfo
- func (c *Consensus) RequestsFromProposal(proposal smartbft_types.Proposal) []smartbft_types.RequestInfo
- func (c *Consensus) Sign(msg []byte) []byte
- func (c *Consensus) SignProposal(proposal smartbft_types.Proposal, _ []byte) *smartbft_types.Signature
- func (c *Consensus) SoftStop()
- func (c *Consensus) Start() error
- func (c *Consensus) Stop()
- func (c *Consensus) SubmitConfig(ctx context.Context, request *protos.Request) (*protos.SubmitResponse, error)
- func (c *Consensus) SubmitRequest(req []byte) error
- func (c *Consensus) VerificationSequence() uint64
- func (c *Consensus) VerifyConsenterSig(signature smartbft_types.Signature, prop smartbft_types.Proposal) ([]byte, error)
- func (c *Consensus) VerifyProposal(proposal smartbft_types.Proposal) ([]smartbft_types.RequestInfo, error)
- func (c *Consensus) VerifyRequest(req []byte) (smartbft_types.RequestInfo, error)
- func (c *Consensus) VerifySignature(signature smartbft_types.Signature) error
- type ConsensusMetrics
- type Consenter
- type DefaultConfigApplier
- type NetStopper
- type SigVerifier
- type Signer
- type Storage
- type SynchronizerStopper
- type TotalOrder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateConfigCommonBlock ¶ added in v0.0.20
func CreateConfigCommonBlock(blockNum uint64, prevHash []byte, txCount uint64, decisionNum arma_types.DecisionNum, batchCount, batchIndex int, configReq []byte) (*common.Block, error)
func CreateConsensusRulesVerifier ¶ added in v0.0.20
func CreateConsensusRulesVerifier(config *config.ConsenterNodeConfig) *requestfilter.RulesVerifier
func CreateDataCommonBlock ¶ added in v0.0.20
func CreateDataCommonBlock(blockNum uint64, prevHash []byte, batchID arma_types.BatchID, txCount uint64, decisionNum arma_types.DecisionNum, batchCount, batchIndex int, lastConfigBlockNum uint64) (*common.Block, error)
func VerifyConfigCommonBlock ¶ added in v0.0.20
func VerifyConfigCommonBlock(configBlock *common.Block, blockNum uint64, prevHash []byte, dataHash []byte, txCount uint64, decisionNum arma_types.DecisionNum, batchCount, batchIndex int) error
func VerifyDataCommonBlock ¶ added in v0.0.20
func VerifyDataCommonBlock(block *common.Block, blockNum uint64, prevHash []byte, batchID arma_types.BatchID, txCount uint64, decisionNum arma_types.DecisionNum, batchCount, batchIndex int, lastConfigBlockNum uint64) error
Types ¶
type Arma ¶
type Arma interface {
SimulateStateTransition(prevState *state.State, configSeq arma_types.ConfigSequence, events [][]byte) (*state.State, [][]arma_types.BatchAttestationFragment, []*state.ConfigRequest)
Index([][]byte)
}
type BatchAttestationDB ¶ added in v0.0.18
type ConfigApplier ¶ added in v0.0.21
type ConfigApplier interface {
// ApplyConfigToState update the current state based on the config request
ApplyConfigToState(state *state.State, configRequest *state.ConfigRequest) (*state.State, error)
// ExtractSmartBFTConfigFromBlock extracts the smartBFT config from a config block
ExtractSmartBFTConfigFromBlock(configBlock *common.Block, selfID arma_types.PartyID) ([]uint64, smartbft_types.Configuration, error)
}
type Consensus ¶
type Consensus struct {
delivery.DeliverService
*comm.ClusterService
Net NetStopper
Config *config.ConsenterNodeConfig
SigVerifier SigVerifier
Signer Signer
CurrentNodes []uint64
BFTConfig smartbft_types.Configuration
BFT *consensus.Consensus
Storage Storage
BADB *badb.BatchAttestationDB
Arma Arma
State *state.State
Logger *flogging.FabricLogger
Synchronizer SynchronizerStopper
Metrics *ConsensusMetrics
RequestVerifier *requestfilter.RulesVerifier
ConfigUpdateProposer policy.ConfigUpdateProposer
ConfigApplier ConfigApplier
ConfigRequestValidator configrequest.ConfigRequestValidator
ConfigRulesVerifier verify.OrdererRules
// contains filtered or unexported fields
}
func CreateConsensus ¶
func CreateConsensus(conf *config.ConsenterNodeConfig, net NetStopper, lastConfigBlock *common.Block, logger *flogging.FabricLogger, signer Signer, configUpdateProposer policy.ConfigUpdateProposer) *Consensus
func (*Consensus) AssembleProposal ¶
func (c *Consensus) AssembleProposal(metadata []byte, requests [][]byte) smartbft_types.Proposal
AssembleProposal creates a proposal which includes the given requests (when permitting) and metadata (from SmartBFT API)
func (*Consensus) AuxiliaryData ¶
AuxiliaryData extracts the auxiliary data from a signature's message (from SmartBFT API)
func (*Consensus) Deliver ¶
func (c *Consensus) Deliver(proposal smartbft_types.Proposal, signatures []smartbft_types.Signature) smartbft_types.Reconfig
Deliver delivers the given proposal and signatures. After the call returns we assume that this proposal is stored in persistent memory. It returns whether this proposal was a reconfiguration and the current config. (from SmartBFT API)
func (*Consensus) NotifyEvent ¶
func (c *Consensus) NotifyEvent(stream protos.Consensus_NotifyEventServer) error
func (*Consensus) OnConsensus ¶
func (*Consensus) RequestID ¶
func (c *Consensus) RequestID(req []byte) smartbft_types.RequestInfo
RequestID returns info about the given request (from SmartBFT API)
func (*Consensus) RequestsFromProposal ¶
func (c *Consensus) RequestsFromProposal(proposal smartbft_types.Proposal) []smartbft_types.RequestInfo
RequestsFromProposal returns from the given proposal the included requests' info (from SmartBFT API)
func (*Consensus) SignProposal ¶
func (c *Consensus) SignProposal(proposal smartbft_types.Proposal, _ []byte) *smartbft_types.Signature
SignProposal signs on the given proposal and returns a composite Signature (from SmartBFT API)
func (*Consensus) SubmitConfig ¶ added in v0.0.20
func (c *Consensus) SubmitConfig(ctx context.Context, request *protos.Request) (*protos.SubmitResponse, error)
SubmitConfig is used to submit a config request from the router in the consenter's party.
func (*Consensus) SubmitRequest ¶
func (*Consensus) VerificationSequence ¶
VerificationSequence returns the current verification sequence (from SmartBFT API)
func (*Consensus) VerifyConsenterSig ¶
func (c *Consensus) VerifyConsenterSig(signature smartbft_types.Signature, prop smartbft_types.Proposal) ([]byte, error)
VerifyConsenterSig verifies the signature for the given proposal It returns the auxiliary data in the signature (from SmartBFT API)
func (*Consensus) VerifyProposal ¶
func (c *Consensus) VerifyProposal(proposal smartbft_types.Proposal) ([]smartbft_types.RequestInfo, error)
VerifyProposal verifies the given proposal and returns the included requests' info (from SmartBFT API)
func (*Consensus) VerifyRequest ¶
func (c *Consensus) VerifyRequest(req []byte) (smartbft_types.RequestInfo, error)
VerifyRequest verifies the given request and returns its info (from SmartBFT API)
func (*Consensus) VerifySignature ¶
func (c *Consensus) VerifySignature(signature smartbft_types.Signature) error
VerifySignature verifies the signature (from SmartBFT API)
type ConsensusMetrics ¶ added in v0.0.20
type ConsensusMetrics struct {
// contains filtered or unexported fields
}
func NewConsensusMetrics ¶ added in v0.0.20
func NewConsensusMetrics(consenterNodeConfig *config.ConsenterNodeConfig, decisions uint64, txCount uint64, logger *flogging.FabricLogger) *ConsensusMetrics
func (*ConsensusMetrics) Start ¶ added in v0.0.20
func (m *ConsensusMetrics) Start()
func (*ConsensusMetrics) Stop ¶ added in v0.0.20
func (m *ConsensusMetrics) Stop()
type Consenter ¶ added in v0.0.18
type Consenter struct {
Logger *flogging.FabricLogger
DB BatchAttestationDB
BAFDeserializer state.BAFDeserializer
}
func (*Consenter) Index ¶ added in v0.0.22
Index indexes BAs (digests). Note that this must hold: Index(digests) with the same digests is idempotent. TODO revise the recovery from failure or shutdown, specifically the order of Index and Append.
func (*Consenter) SimulateStateTransition ¶ added in v0.0.18
func (c *Consenter) SimulateStateTransition(prevState *state.State, configSeq types.ConfigSequence, requests [][]byte) (*state.State, [][]types.BatchAttestationFragment, []*state.ConfigRequest)
type DefaultConfigApplier ¶ added in v0.0.21
type DefaultConfigApplier struct{}
func (*DefaultConfigApplier) ApplyConfigToState ¶ added in v0.0.21
func (ca *DefaultConfigApplier) ApplyConfigToState(state *state.State, configRequest *state.ConfigRequest) (*state.State, error)
func (*DefaultConfigApplier) ExtractSmartBFTConfigFromBlock ¶ added in v0.0.22
func (ca *DefaultConfigApplier) ExtractSmartBFTConfigFromBlock(configBlock *common.Block, selfID arma_types.PartyID) ([]uint64, smartbft_types.Configuration, error)
type NetStopper ¶ added in v0.0.20
type NetStopper interface {
Stop()
}
type SigVerifier ¶
type SigVerifier interface {
VerifySignature(id arma_types.PartyID, shardID arma_types.ShardID, msg, sig []byte) error
}
type SynchronizerStopper ¶ added in v0.0.20
type SynchronizerStopper interface {
Stop()
}