chainconfig

package
v1.0.0-preview Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2017 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// HashingAlgorithmKey is the cb.ConfigurationItem type key name for the HashingAlgorithm message
	HashingAlgorithmKey = "HashingAlgorithm"

	// BlockDataHashingStructureKey is the cb.ConfigurationItem type key name for the BlockDataHashingStructure message
	BlockDataHashingStructureKey = "BlockDataHashingStructure"

	// OrdererAddressesKey is the cb.ConfigurationItem type key name for the OrdererAddresses message
	OrdererAddressesKey = "OrdererAddresses"
)

Chain config keys

View Source
const (
	// SHAKE256 is the algorithm type for the sha3 shake256 hashing algorithm with 512 bits of output
	SHA3Shake256 = "SHAKE256"
)

Hashing algorithm types

Variables

This section is empty.

Functions

func DefaultBlockDataHashingStructure

func DefaultBlockDataHashingStructure() *cb.ConfigurationItem

DefaultBlockDatahashingStructure creates a headerless configuration item for the default block data hashing structure

func DefaultHashingAlgorithm

func DefaultHashingAlgorithm() *cb.ConfigurationItem

DefaultHashingAlgorithm creates a headerless configuration item for the default hashing algorithm

func DefaultOrdererAddresses

func DefaultOrdererAddresses() *cb.ConfigurationItem

DefaultOrdererAddresses creates a headerless configuration item for the default orderer addresses

func TemplateBlockDataHashingStructure

func TemplateBlockDataHashingStructure(width uint32) *cb.ConfigurationItem

TemplateBlockDataHashingStructure creates a headerless configuration item representing the block data hashing structure

func TemplateHashingAlgorithm

func TemplateHashingAlgorithm(name string) *cb.ConfigurationItem

TemplateHashingAlgorithm creates a headerless configuration item representing the hashing algorithm

func TemplateOrdererAddresses

func TemplateOrdererAddresses(addresses []string) *cb.ConfigurationItem

TemplateOrdererAddressess creates a headerless configuration item representing the orderer addresses

Types

type Descriptor

type Descriptor interface {
	// HashingAlgorithm returns the default algorithm to be used when hashing
	// such as computing block hashes, and CreationPolicy digests
	HashingAlgorithm() func(input []byte) []byte

	// BlockDataHashingStructureWidth returns the width to use when constructing the
	// Merkle tree to compute the BlockData hash
	BlockDataHashingStructureWidth() uint32

	// OrdererAddresses returns the list of valid orderer addresses to connect to to invoke Broadcast/Deliver
	OrdererAddresses() []string
}

Descriptor stores the common chain configuration It is intended to be the primary accessor of DescriptorImpl It is intended to discourage use of the other exported DescriptorImpl methods which are used for updating the chain configuration by the configtx.Manager

type DescriptorImpl

type DescriptorImpl struct {
	// contains filtered or unexported fields
}

DescriptorImpl is an implementation of Manager and configtx.ConfigHandler In general, it should only be referenced as an Impl for the configtx.Manager

func NewDescriptorImpl

func NewDescriptorImpl() *DescriptorImpl

NewDescriptorImpl creates a new DescriptorImpl with the given CryptoHelper

func (*DescriptorImpl) BeginConfig

func (pm *DescriptorImpl) BeginConfig()

BeginConfig is used to start a new configuration proposal

func (*DescriptorImpl) BlockDataHashingStructureWidth

func (pm *DescriptorImpl) BlockDataHashingStructureWidth() uint32

BlockDataHashingStructure returns the width to use when forming the block data hashing structure

func (*DescriptorImpl) CommitConfig

func (pm *DescriptorImpl) CommitConfig()

CommitConfig is used to commit a new configuration proposal

func (*DescriptorImpl) HashingAlgorithm

func (pm *DescriptorImpl) HashingAlgorithm() func(input []byte) []byte

HashingAlgorithm returns a function pointer to the chain hashing algorihtm

func (*DescriptorImpl) OrdererAddresses

func (pm *DescriptorImpl) OrdererAddresses() []string

OrdererAddresses returns the list of valid orderer addresses to connect to to invoke Broadcast/Deliver

func (*DescriptorImpl) ProposeConfig

func (pm *DescriptorImpl) ProposeConfig(configItem *cb.ConfigurationItem) error

ProposeConfig is used to add new configuration to the configuration proposal

func (*DescriptorImpl) RollbackConfig

func (pm *DescriptorImpl) RollbackConfig()

RollbackConfig is used to abandon a new configuration proposal

Jump to

Keyboard shortcuts

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