channelconfig

package
v0.0.0-...-95b87ed Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2019 License: Apache-2.0 Imports: 26 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	ApplicationGroupKey = "Application"

	ACLsKey = "ACLs"
)
View Source
const (
	ConsortiumKey = "Consortium"

	HashingAlgorithmKey = "HashingAlgorithm"

	BlockDataHashingStructureKey = "BlockDataHashingStructure"

	OrdererAddressesKey = "OrdererAddresses"

	ChannelGroupKey = "Channel"

	CapabilitiesKey = "Capabilities"
)
View Source
const (
	ConsensusTypeKey = "ConsensusType"

	BatchSizeKey = "BatchSize"

	BatchTimeoutKey = "BatchTimeout"

	ChannelRestrictionsKey = "ChannelRestrictions"

	KafkaBrokersKey = "KafkaBrokers"

	EndpointsKey = "Endpoints"
)
View Source
const (
	ReadersPolicyKey = "Readers"

	WritersPolicyKey = "Writers"

	AdminsPolicyKey = "Admins"
)
View Source
const (
	AnchorPeersKey = "AnchorPeers"
)
View Source
const (
	ChannelCreationPolicyKey = "ChannelCreationPolicy"
)
View Source
const (
	ConsortiumsGroupKey = "Consortiums"
)
View Source
const (
	MSPKey = "MSP"
)
View Source
const (
	OrdererGroupKey = "Orderer"
)
View Source
const RootGroupKey = "Channel"

Variables

This section is empty.

Functions

func DeserializeProtoValuesFromGroup

func DeserializeProtoValuesFromGroup(group *cb.ConfigGroup, protosStructs ...interface{}) error

func LogSanityChecks

func LogSanityChecks(res Resources)

func MarshalEtcdRaftMetadata

func MarshalEtcdRaftMetadata(md *etcdraft.ConfigMetadata) ([]byte, error)

func ValidateCapabilities

func ValidateCapabilities(block *cb.Block, bccsp bccsp.BCCSP) error

Types

type Application

type Application interface {
	Organizations() map[string]ApplicationOrg

	APIPolicyMapper() PolicyMapper

	Capabilities() ApplicationCapabilities
}

type ApplicationCapabilities

type ApplicationCapabilities interface {
	Supported() error

	ForbidDuplicateTXIdInBlock() bool

	ACLs() bool

	PrivateChannelData() bool

	CollectionUpgrade() bool

	V1_1Validation() bool

	V1_2Validation() bool

	V1_3Validation() bool

	StorePvtDataOfInvalidTx() bool

	V2_0Validation() bool

	LifecycleV20() bool

	MetadataLifecycle() bool

	KeyLevelEndorsement() bool
}

type ApplicationConfig

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

func NewApplicationConfig

func NewApplicationConfig(appGroup *cb.ConfigGroup, mspConfig *MSPConfigHandler) (*ApplicationConfig, error)

func (*ApplicationConfig) APIPolicyMapper

func (ac *ApplicationConfig) APIPolicyMapper() PolicyMapper

func (*ApplicationConfig) Capabilities

func (ac *ApplicationConfig) Capabilities() ApplicationCapabilities

func (*ApplicationConfig) Organizations

func (ac *ApplicationConfig) Organizations() map[string]ApplicationOrg

type ApplicationOrg

type ApplicationOrg interface {
	Org

	AnchorPeers() []*pb.AnchorPeer
}

type ApplicationOrgConfig

type ApplicationOrgConfig struct {
	*OrganizationConfig
	// contains filtered or unexported fields
}

func NewApplicationOrgConfig

func NewApplicationOrgConfig(id string, orgGroup *cb.ConfigGroup, mspConfig *MSPConfigHandler) (*ApplicationOrgConfig, error)

func (*ApplicationOrgConfig) AnchorPeers

func (aog *ApplicationOrgConfig) AnchorPeers() []*pb.AnchorPeer

func (*ApplicationOrgConfig) Validate

func (aoc *ApplicationOrgConfig) Validate() error

type ApplicationOrgProtos

type ApplicationOrgProtos struct {
	AnchorPeers *pb.AnchorPeers
}

type ApplicationProtos

type ApplicationProtos struct {
	ACLs         *pb.ACLs
	Capabilities *cb.Capabilities
}

type Bundle

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

func NewBundle

func NewBundle(channelID string, config *cb.Config, bccsp bccsp.BCCSP) (*Bundle, error)

func NewBundleFromEnvelope

func NewBundleFromEnvelope(env *cb.Envelope, bccsp bccsp.BCCSP) (*Bundle, error)

func (*Bundle) ApplicationConfig

func (b *Bundle) ApplicationConfig() (Application, bool)

func (*Bundle) ChannelConfig

func (b *Bundle) ChannelConfig() Channel

func (*Bundle) ConfigtxValidator

func (b *Bundle) ConfigtxValidator() configtx.Validator

func (*Bundle) ConsortiumsConfig

func (b *Bundle) ConsortiumsConfig() (Consortiums, bool)

func (*Bundle) MSPManager

func (b *Bundle) MSPManager() msp.MSPManager

func (*Bundle) OrdererConfig

func (b *Bundle) OrdererConfig() (Orderer, bool)

func (*Bundle) PolicyManager

func (b *Bundle) PolicyManager() policies.Manager

func (*Bundle) ValidateNew

func (b *Bundle) ValidateNew(nb Resources) error

type BundleActor

type BundleActor func(bundle *Bundle)

type BundleSource

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

func NewBundleSource

func NewBundleSource(bundle *Bundle, callbacks ...BundleActor) *BundleSource

func (*BundleSource) ApplicationConfig

func (bs *BundleSource) ApplicationConfig() (Application, bool)

func (*BundleSource) ChannelConfig

func (bs *BundleSource) ChannelConfig() Channel

func (*BundleSource) ConfigtxValidator

func (bs *BundleSource) ConfigtxValidator() configtx.Validator

func (*BundleSource) ConsortiumsConfig

func (bs *BundleSource) ConsortiumsConfig() (Consortiums, bool)

func (*BundleSource) MSPManager

func (bs *BundleSource) MSPManager() msp.MSPManager

func (*BundleSource) OrdererConfig

func (bs *BundleSource) OrdererConfig() (Orderer, bool)

func (*BundleSource) PolicyManager

func (bs *BundleSource) PolicyManager() policies.Manager

func (*BundleSource) StableBundle

func (bs *BundleSource) StableBundle() *Bundle

func (*BundleSource) Update

func (bs *BundleSource) Update(newBundle *Bundle)

func (*BundleSource) ValidateNew

func (bs *BundleSource) ValidateNew(resources Resources) error

type Channel

type Channel interface {
	HashingAlgorithm() func(input []byte) []byte

	BlockDataHashingStructureWidth() uint32

	OrdererAddresses() []string

	Capabilities() ChannelCapabilities
}

type ChannelCapabilities

type ChannelCapabilities interface {
	Supported() error

	MSPVersion() msp.MSPVersion

	ConsensusTypeMigration() bool

	OrgSpecificOrdererEndpoints() bool
}

type ChannelConfig

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

func NewChannelConfig

func NewChannelConfig(channelGroup *cb.ConfigGroup, bccsp bccsp.BCCSP) (*ChannelConfig, error)

func (*ChannelConfig) ApplicationConfig

func (cc *ChannelConfig) ApplicationConfig() *ApplicationConfig

func (*ChannelConfig) BlockDataHashingStructureWidth

func (cc *ChannelConfig) BlockDataHashingStructureWidth() uint32

func (*ChannelConfig) Capabilities

func (cc *ChannelConfig) Capabilities() ChannelCapabilities

func (*ChannelConfig) ConsortiumName

func (cc *ChannelConfig) ConsortiumName() string

func (*ChannelConfig) ConsortiumsConfig

func (cc *ChannelConfig) ConsortiumsConfig() *ConsortiumsConfig

func (*ChannelConfig) HashingAlgorithm

func (cc *ChannelConfig) HashingAlgorithm() func(input []byte) []byte

func (*ChannelConfig) MSPManager

func (cc *ChannelConfig) MSPManager() msp.MSPManager

func (*ChannelConfig) OrdererAddresses

func (cc *ChannelConfig) OrdererAddresses() []string

func (*ChannelConfig) OrdererConfig

func (cc *ChannelConfig) OrdererConfig() *OrdererConfig

func (*ChannelConfig) Validate

func (cc *ChannelConfig) Validate(channelCapabilities ChannelCapabilities) error

type ChannelProtos

type ChannelProtos struct {
	HashingAlgorithm          *cb.HashingAlgorithm
	BlockDataHashingStructure *cb.BlockDataHashingStructure
	OrdererAddresses          *cb.OrdererAddresses
	Consortium                *cb.Consortium
	Capabilities              *cb.Capabilities
}

type ChannelValues

type ChannelValues interface {
	HashingAlgorithm() func(input []byte) []byte

	BlockDataHashingStructureWidth() uint32

	OrdererAddresses() []string
}

type ConfigValue

type ConfigValue interface {
	Key() string

	Value() proto.Message
}

type Consortium

type Consortium interface {
	ChannelCreationPolicy() *cb.Policy

	Organizations() map[string]Org
}

type ConsortiumConfig

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

func NewConsortiumConfig

func NewConsortiumConfig(consortiumGroup *cb.ConfigGroup, mspConfig *MSPConfigHandler) (*ConsortiumConfig, error)

func (*ConsortiumConfig) ChannelCreationPolicy

func (cc *ConsortiumConfig) ChannelCreationPolicy() *cb.Policy

func (*ConsortiumConfig) Organizations

func (cc *ConsortiumConfig) Organizations() map[string]Org

type ConsortiumProtos

type ConsortiumProtos struct {
	ChannelCreationPolicy *cb.Policy
}

type Consortiums

type Consortiums interface {
	Consortiums() map[string]Consortium
}

type ConsortiumsConfig

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

func NewConsortiumsConfig

func NewConsortiumsConfig(consortiumsGroup *cb.ConfigGroup, mspConfig *MSPConfigHandler) (*ConsortiumsConfig, error)

func (*ConsortiumsConfig) Consortiums

func (cc *ConsortiumsConfig) Consortiums() map[string]Consortium

type MSPConfigHandler

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

func NewMSPConfigHandler

func NewMSPConfigHandler(mspVersion msp.MSPVersion, bccsp bccsp.BCCSP) *MSPConfigHandler

func (*MSPConfigHandler) CreateMSPManager

func (bh *MSPConfigHandler) CreateMSPManager() (msp.MSPManager, error)

func (*MSPConfigHandler) ProposeMSP

func (bh *MSPConfigHandler) ProposeMSP(mspConfig *mspprotos.MSPConfig) (msp.MSP, error)

type Orderer

type Orderer interface {
	ConsensusType() string

	ConsensusMetadata() []byte

	ConsensusState() ab.ConsensusType_State

	BatchSize() *ab.BatchSize

	BatchTimeout() time.Duration

	MaxChannelsCount() uint64

	KafkaBrokers() []string

	Organizations() map[string]OrdererOrg

	Capabilities() OrdererCapabilities
}

type OrdererCapabilities

type OrdererCapabilities interface {
	PredictableChannelTemplate() bool

	Resubmission() bool

	Supported() error

	ExpirationCheck() bool

	ConsensusTypeMigration() bool

	UseChannelCreationPolicyAsAdmins() bool
}

type OrdererConfig

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

func NewOrdererConfig

func NewOrdererConfig(ordererGroup *cb.ConfigGroup, mspConfig *MSPConfigHandler, channelCapabilities ChannelCapabilities) (*OrdererConfig, error)

func (*OrdererConfig) BatchSize

func (oc *OrdererConfig) BatchSize() *ab.BatchSize

func (*OrdererConfig) BatchTimeout

func (oc *OrdererConfig) BatchTimeout() time.Duration

func (*OrdererConfig) Capabilities

func (oc *OrdererConfig) Capabilities() OrdererCapabilities

func (*OrdererConfig) ConsensusMetadata

func (oc *OrdererConfig) ConsensusMetadata() []byte

func (*OrdererConfig) ConsensusState

func (oc *OrdererConfig) ConsensusState() ab.ConsensusType_State

func (*OrdererConfig) ConsensusType

func (oc *OrdererConfig) ConsensusType() string

func (*OrdererConfig) KafkaBrokers

func (oc *OrdererConfig) KafkaBrokers() []string

func (*OrdererConfig) MaxChannelsCount

func (oc *OrdererConfig) MaxChannelsCount() uint64

func (*OrdererConfig) Organizations

func (oc *OrdererConfig) Organizations() map[string]OrdererOrg

func (*OrdererConfig) Validate

func (oc *OrdererConfig) Validate() error

type OrdererOrg

type OrdererOrg interface {
	Org

	Endpoints() []string
}

type OrdererOrgConfig

type OrdererOrgConfig struct {
	*OrganizationConfig
	// contains filtered or unexported fields
}

func NewOrdererOrgConfig

func NewOrdererOrgConfig(orgName string, orgGroup *cb.ConfigGroup, mspConfigHandler *MSPConfigHandler, channelCapabilities ChannelCapabilities) (*OrdererOrgConfig, error)

func (*OrdererOrgConfig) Endpoints

func (oc *OrdererOrgConfig) Endpoints() []string

func (*OrdererOrgConfig) Validate

func (ooc *OrdererOrgConfig) Validate() error

type OrdererOrgProtos

type OrdererOrgProtos struct {
	Endpoints *cb.OrdererAddresses
}

type OrdererProtos

type OrdererProtos struct {
	ConsensusType       *ab.ConsensusType
	BatchSize           *ab.BatchSize
	BatchTimeout        *ab.BatchTimeout
	KafkaBrokers        *ab.KafkaBrokers
	ChannelRestrictions *ab.ChannelRestrictions
	Capabilities        *cb.Capabilities
}

type Org

type Org interface {
	Name() string

	MSPID() string
}

type OrganizationConfig

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

func NewOrganizationConfig

func NewOrganizationConfig(name string, orgGroup *cb.ConfigGroup, mspConfigHandler *MSPConfigHandler) (*OrganizationConfig, error)

func (*OrganizationConfig) MSPID

func (oc *OrganizationConfig) MSPID() string

func (*OrganizationConfig) Name

func (oc *OrganizationConfig) Name() string

func (*OrganizationConfig) Validate

func (oc *OrganizationConfig) Validate() error

type OrganizationProtos

type OrganizationProtos struct {
	MSP *mspprotos.MSPConfig
}

type PolicyMapper

type PolicyMapper interface {
	PolicyRefForAPI(apiName string) string
}

type Resources

type Resources interface {
	ConfigtxValidator() configtx.Validator

	PolicyManager() policies.Manager

	ChannelConfig() Channel

	OrdererConfig() (Orderer, bool)

	ConsortiumsConfig() (Consortiums, bool)

	ApplicationConfig() (Application, bool)

	MSPManager() msp.MSPManager

	ValidateNew(resources Resources) error
}

type StandardConfigValue

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

func ACLValues

func ACLValues(acls map[string]string) *StandardConfigValue

func AnchorPeersValue

func AnchorPeersValue(anchorPeers []*pb.AnchorPeer) *StandardConfigValue

func BatchSizeValue

func BatchSizeValue(maxMessages, absoluteMaxBytes, preferredMaxBytes uint32) *StandardConfigValue

func BatchTimeoutValue

func BatchTimeoutValue(timeout string) *StandardConfigValue

func BlockDataHashingStructureValue

func BlockDataHashingStructureValue() *StandardConfigValue

func CapabilitiesValue

func CapabilitiesValue(capabilities map[string]bool) *StandardConfigValue

func ChannelCreationPolicyValue

func ChannelCreationPolicyValue(policy *cb.Policy) *StandardConfigValue

func ChannelRestrictionsValue

func ChannelRestrictionsValue(maxChannelCount uint64) *StandardConfigValue

func ConsensusTypeValue

func ConsensusTypeValue(consensusType string, consensusMetadata []byte) *StandardConfigValue

func ConsortiumValue

func ConsortiumValue(name string) *StandardConfigValue

func EndpointsValue

func EndpointsValue(addresses []string) *StandardConfigValue

func HashingAlgorithmValue

func HashingAlgorithmValue() *StandardConfigValue

func KafkaBrokersValue

func KafkaBrokersValue(brokers []string) *StandardConfigValue

func MSPValue

func MSPValue(mspDef *mspprotos.MSPConfig) *StandardConfigValue

func OrdererAddressesValue

func OrdererAddressesValue(addresses []string) *StandardConfigValue

func (*StandardConfigValue) Key

func (scv *StandardConfigValue) Key() string

func (*StandardConfigValue) Value

func (scv *StandardConfigValue) Value() proto.Message

type StandardValues

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

func NewStandardValues

func NewStandardValues(protosStructs ...interface{}) (*StandardValues, error)

func (*StandardValues) Deserialize

func (sv *StandardValues) Deserialize(key string, value []byte) (proto.Message, error)

Jump to

Keyboard shortcuts

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