validationpolicy

package
v0.1.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TxFilterAcceptAll = func(int) bool {
	return true
}

TxFilterAcceptAll accepts all transactions

Functions

func GetDataToSign

func GetDataToSign(blockNum uint64, txFlags, identity []byte) []byte

GetDataToSign appends the block number, Tx Flags, and the serialized identity into a byte buffer to be signed by the validator.

Types

type PolicyEvaluator

type PolicyEvaluator struct {
	*discovery.Discovery
	// contains filtered or unexported fields
}

PolicyEvaluator evaluates the validation policy

func New

func New(channelID string, disc *discovery.Discovery, pp policies.Provider) *PolicyEvaluator

New returns a new Validation PolicyEvaluator

func (*PolicyEvaluator) GetTxFilter

func (p *PolicyEvaluator) GetTxFilter(block *cb.Block) TxFilter

GetTxFilter returns the transaction filter that determines whether or not the local peer should validate the transaction at a given index.

func (*PolicyEvaluator) GetValidatingPeers

func (p *PolicyEvaluator) GetValidatingPeers(block *cb.Block) (discovery.PeerGroup, error)

GetValidatingPeers returns the set of peers that are involved in validating the given block

func (*PolicyEvaluator) ValidateResults

func (p *PolicyEvaluator) ValidateResults(results []*validationresults.Results) error

ValidateResults validates that the given results have come from a reliable source and that the validation policy has been satisfied.

type TxFilter

type TxFilter func(txIdx int) bool

TxFilter determines which transactions are to be validated

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL