fabric-sdk-go: github.com/hyperledger/fabric-sdk-go/internal/github.com/hyperledger/fabric/common/channelconfig Index | Files

package channelconfig

import "github.com/hyperledger/fabric-sdk-go/internal/github.com/hyperledger/fabric/common/channelconfig"

Index

Package Files

acls.go api.go application.go applicationorg.go bundle.go channel.go consortium.go consortiums.go msp.go orderer.go organization.go standardvalues.go util.go

Constants

const (
    // ApplicationGroupKey is the group name for the Application config
    ApplicationGroupKey = "Application"

    // ACLsKey is the name of the ACLs config
    ACLsKey = "ACLs"
)
const (
    // ConsortiumKey is the key for the cb.ConfigValue for the Consortium message
    ConsortiumKey = "Consortium"

    // HashingAlgorithmKey is the cb.ConfigItem type key name for the HashingAlgorithm message
    HashingAlgorithmKey = "HashingAlgorithm"

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

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

    // GroupKey is the name of the channel group
    ChannelGroupKey = "Channel"

    // CapabilitiesKey is the name of the key which refers to capabilities, it appears at the channel,
    // application, and orderer levels and this constant is used for all three.
    CapabilitiesKey = "Capabilities"
)

Channel config keys

const (
    // ConsensusTypeKey is the cb.ConfigItem type key name for the ConsensusType message.
    ConsensusTypeKey = "ConsensusType"

    // BatchSizeKey is the cb.ConfigItem type key name for the BatchSize message.
    BatchSizeKey = "BatchSize"

    // BatchTimeoutKey is the cb.ConfigItem type key name for the BatchTimeout message.
    BatchTimeoutKey = "BatchTimeout"

    // ChannelRestrictionsKey is the key name for the ChannelRestrictions message.
    ChannelRestrictionsKey = "ChannelRestrictions"

    // KafkaBrokersKey is the cb.ConfigItem type key name for the KafkaBrokers message.
    KafkaBrokersKey = "KafkaBrokers"

    // EndpointsKey is the cb.COnfigValue key name for the Endpoints message in the OrdererOrgGroup.
    EndpointsKey = "Endpoints"
)
const (
    // ReadersPolicyKey is the key used for the read policy
    ReadersPolicyKey = "Readers"

    // WritersPolicyKey is the key used for the read policy
    WritersPolicyKey = "Writers"

    // AdminsPolicyKey is the key used for the read policy
    AdminsPolicyKey = "Admins"
)
const (
    // AnchorPeersKey is the key name for the AnchorPeers ConfigValue
    AnchorPeersKey = "AnchorPeers"
)
const (
    // ChannelCreationPolicyKey is the key used in the consortium config to denote the policy
    // to be used in evaluating whether a channel creation request is authorized
    ChannelCreationPolicyKey = "ChannelCreationPolicy"
)
const (
    // ConsortiumsGroupKey is the group name for the consortiums config
    ConsortiumsGroupKey = "Consortiums"
)
const (
    // MSPKey is the key for the MSP definition in orderer groups
    MSPKey = "MSP"
)
const (
    // OrdererGroupKey is the group name for the orderer config.
    OrdererGroupKey = "Orderer"
)
const RootGroupKey = "Channel"

RootGroupKey is the key for namespacing the channel config, especially for policy evaluation.

func DeserializeProtoValuesFromGroup Uses

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

DeserializeGroup deserializes the value for all values in a config group

func MarshalEtcdRaftMetadata Uses

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

MarshalEtcdRaftMetadata serializes etcd RAFT metadata.

func ValidateCapabilities Uses

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

ValidateCapabilities validates whether the peer can meet the capabilities requirement in the given config block

type Application Uses

type Application interface {
    // Organizations returns a map of org ID to ApplicationOrg
    Organizations() map[string]ApplicationOrg

    // APIPolicyMapper returns a PolicyMapper that maps API names to policies
    APIPolicyMapper() PolicyMapper

    // Capabilities defines the capabilities for the application portion of a channel
    Capabilities() ApplicationCapabilities
}

Application stores the common shared application config

type ApplicationCapabilities Uses

type ApplicationCapabilities interface {
    // Supported returns an error if there are unknown capabilities in this channel which are required
    Supported() error

    // ForbidDuplicateTXIdInBlock specifies whether two transactions with the same TXId are permitted
    // in the same block or whether we mark the second one as TxValidationCode_DUPLICATE_TXID
    ForbidDuplicateTXIdInBlock() bool

    // ACLs returns true is ACLs may be specified in the Application portion of the config tree
    ACLs() bool

    // PrivateChannelData returns true if support for private channel data (a.k.a. collections) is enabled.
    // In v1.1, the private channel data is experimental and has to be enabled explicitly.
    // In v1.2, the private channel data is enabled by default.
    PrivateChannelData() bool

    // CollectionUpgrade returns true if this channel is configured to allow updates to
    // existing collection or add new collections through chaincode upgrade (as introduced in v1.2)
    CollectionUpgrade() bool

    // V1_1Validation returns true is this channel is configured to perform stricter validation
    // of transactions (as introduced in v1.1).
    V1_1Validation() bool

    // V1_2Validation returns true is this channel is configured to perform stricter validation
    // of transactions (as introduced in v1.2).
    V1_2Validation() bool

    // V1_3Validation returns true if this channel supports transaction validation
    // as introduced in v1.3. This includes:
    //  - policies expressible at a ledger key granularity, as described in FAB-8812
    //  - new chaincode lifecycle, as described in FAB-11237
    V1_3Validation() bool

    // StorePvtDataOfInvalidTx() returns true if the peer needs to store the pvtData of
    // invalid transactions (as introduced in v142).
    StorePvtDataOfInvalidTx() bool

    // V2_0Validation returns true if this channel supports transaction validation
    // as introduced in v2.0. This includes:
    //  - new chaincode lifecycle
    //  - implicit per-org collections
    V2_0Validation() bool

    // LifecycleV20 indicates whether the peer should use the deprecated and problematic
    // v1.x lifecycle, or whether it should use the newer per channel approve/commit definitions
    // process introduced in v2.0.  Note, this should only be used on the endorsing side
    // of peer processing, so that we may safely remove all checks against it in v2.1.
    LifecycleV20() bool

    // MetadataLifecycle always returns false
    MetadataLifecycle() bool

    // KeyLevelEndorsement returns true if this channel supports endorsement
    // policies expressible at a ledger key granularity, as described in FAB-8812
    KeyLevelEndorsement() bool
}

ApplicationCapabilities defines the capabilities for the application portion of a channel

type ApplicationConfig Uses

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

ApplicationConfig implements the Application interface

func NewApplicationConfig Uses

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

NewApplicationConfig creates config from an Application config group

func (*ApplicationConfig) APIPolicyMapper Uses

func (ac *ApplicationConfig) APIPolicyMapper() PolicyMapper

APIPolicyMapper returns a PolicyMapper that maps API names to policies

func (*ApplicationConfig) Capabilities Uses

func (ac *ApplicationConfig) Capabilities() ApplicationCapabilities

Capabilities returns a map of capability name to Capability

func (*ApplicationConfig) Organizations Uses

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

Organizations returns a map of org ID to ApplicationOrg

type ApplicationOrg Uses

type ApplicationOrg interface {
    Org

    // AnchorPeers returns the list of gossip anchor peers
    AnchorPeers() []*pb.AnchorPeer
}

ApplicationOrg stores the per org application config

type ApplicationOrgConfig Uses

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

ApplicationOrgConfig defines the configuration for an application org

func NewApplicationOrgConfig Uses

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

NewApplicationOrgConfig creates a new config for an application org

func (*ApplicationOrgConfig) AnchorPeers Uses

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

AnchorPeers returns the list of anchor peers of this Organization

func (*ApplicationOrgConfig) Validate Uses

func (aoc *ApplicationOrgConfig) Validate() error

type ApplicationOrgProtos Uses

type ApplicationOrgProtos struct {
    AnchorPeers *pb.AnchorPeers
}

ApplicationOrgProtos are deserialized from the config

type ApplicationProtos Uses

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

ApplicationProtos is used as the source of the ApplicationConfig

type Channel Uses

type Channel 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

    // Capabilities defines the capabilities for a channel
    Capabilities() ChannelCapabilities
}

Channel gives read only access to the channel configuration

type ChannelCapabilities Uses

type ChannelCapabilities interface {
    // Supported returns an error if there are unknown capabilities in this channel which are required
    Supported() error

    // MSPVersion specifies the version of the MSP this channel must understand, including the MSP types
    // and MSP principal types.
    MSPVersion() msp.MSPVersion

    // ConsensusTypeMigration return true if consensus-type migration is permitted in both orderer and peer.
    ConsensusTypeMigration() bool

    // OrgSpecificOrdererEndpoints return true if the channel config processing allows orderer orgs to specify their own endpoints
    OrgSpecificOrdererEndpoints() bool
}

ChannelCapabilities defines the capabilities for a channel

type ChannelConfig Uses

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

ChannelConfig stores the channel configuration

func NewChannelConfig Uses

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

NewChannelConfig creates a new ChannelConfig

func (*ChannelConfig) ApplicationConfig Uses

func (cc *ChannelConfig) ApplicationConfig() *ApplicationConfig

ApplicationConfig returns the application config associated with this channel

func (*ChannelConfig) BlockDataHashingStructureWidth Uses

func (cc *ChannelConfig) BlockDataHashingStructureWidth() uint32

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

func (*ChannelConfig) Capabilities Uses

func (cc *ChannelConfig) Capabilities() ChannelCapabilities

Capabilities returns information about the available capabilities for this channel

func (*ChannelConfig) ConsortiumName Uses

func (cc *ChannelConfig) ConsortiumName() string

ConsortiumName returns the name of the consortium this channel was created under

func (*ChannelConfig) ConsortiumsConfig Uses

func (cc *ChannelConfig) ConsortiumsConfig() *ConsortiumsConfig

ConsortiumsConfig returns the consortium config associated with this channel if it exists

func (*ChannelConfig) HashingAlgorithm Uses

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

HashingAlgorithm returns a function pointer to the chain hashing algorihtm

func (*ChannelConfig) MSPManager Uses

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

MSPManager returns the MSP manager for this config

func (*ChannelConfig) OrdererAddresses Uses

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

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

func (*ChannelConfig) OrdererConfig Uses

func (cc *ChannelConfig) OrdererConfig() *OrdererConfig

OrdererConfig returns the orderer config associated with this channel

func (*ChannelConfig) Validate Uses

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

Validate inspects the generated configuration protos and ensures that the values are correct

type ChannelProtos Uses

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

ChannelProtos is where the proposed configuration is unmarshaled into

type ChannelValues Uses

type ChannelValues 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
}

ChannelValues gives read only access to the channel configuration

type ConfigValue Uses

type ConfigValue interface {
    // Key is the key this value should be stored in the *cb.ConfigGroup.Values map.
    Key() string

    // Value is the message which should be marshaled to opaque bytes for the *cb.ConfigValue.value.
    Value() proto.Message
}

ConfigValue defines a common representation for different *cb.ConfigValue values.

type Consortium Uses

type Consortium interface {
    // ChannelCreationPolicy returns the policy to check when instantiating a channel for this consortium
    ChannelCreationPolicy() *cb.Policy

    // Organizations returns the organizations for this consortium
    Organizations() map[string]Org
}

Consortium represents a group of orgs which may create channels together

type ConsortiumConfig Uses

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

ConsortiumConfig holds the consoritums configuration information

func NewConsortiumConfig Uses

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

NewConsortiumConfig creates a new instance of the consoritums config

func (*ConsortiumConfig) ChannelCreationPolicy Uses

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

CreationPolicy returns the policy structure used to validate the channel creation

func (*ConsortiumConfig) Organizations Uses

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

Organizations returns the set of organizations in the consortium

type ConsortiumProtos Uses

type ConsortiumProtos struct {
    ChannelCreationPolicy *cb.Policy
}

ConsortiumProtos holds the config protos for the consortium config

type Consortiums Uses

type Consortiums interface {
    // Consortiums returns the set of consortiums
    Consortiums() map[string]Consortium
}

Consortiums represents the set of consortiums serviced by an ordering service

type ConsortiumsConfig Uses

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

ConsortiumsConfig holds the consoritums configuration information

func NewConsortiumsConfig Uses

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

NewConsortiumsConfig creates a new instance of the consoritums config

func (*ConsortiumsConfig) Consortiums Uses

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

Consortiums returns a map of the current consortiums

type MSPConfigHandler Uses

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

MSPConfigHandler

func NewMSPConfigHandler Uses

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

func (*MSPConfigHandler) CreateMSPManager Uses

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

func (*MSPConfigHandler) ProposeMSP Uses

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

ProposeValue called when an org defines an MSP

type Orderer Uses

type Orderer interface {
    // ConsensusType returns the configured consensus type
    ConsensusType() string

    // ConsensusMetadata returns the metadata associated with the consensus type.
    ConsensusMetadata() []byte

    // ConsensusState returns the consensus-type state.
    ConsensusState() ab.ConsensusType_State

    // BatchSize returns the maximum number of messages to include in a block
    BatchSize() *ab.BatchSize

    // BatchTimeout returns the amount of time to wait before creating a batch
    BatchTimeout() time.Duration

    // MaxChannelsCount returns the maximum count of channels to allow for an ordering network
    MaxChannelsCount() uint64

    // KafkaBrokers returns the addresses (IP:port notation) of a set of "bootstrap"
    // Kafka brokers, i.e. this is not necessarily the entire set of Kafka brokers
    // used for ordering
    KafkaBrokers() []string

    // Organizations returns the organizations for the ordering service
    Organizations() map[string]OrdererOrg

    // Capabilities defines the capabilities for the orderer portion of a channel
    Capabilities() OrdererCapabilities
}

Orderer stores the common shared orderer config

type OrdererCapabilities Uses

type OrdererCapabilities interface {
    // PredictableChannelTemplate specifies whether the v1.0 undesirable behavior of setting the /Channel
    // group's mod_policy to "" and copy versions from the orderer system channel config should be fixed or not.
    PredictableChannelTemplate() bool

    // Resubmission specifies whether the v1.0 non-deterministic commitment of tx should be fixed by re-submitting
    // the re-validated tx.
    Resubmission() bool

    // Supported returns an error if there are unknown capabilities in this channel which are required
    Supported() error

    // ExpirationCheck specifies whether the orderer checks for identity expiration checks
    // when validating messages
    ExpirationCheck() bool

    // ConsensusTypeMigration checks whether the orderer permits a consensus-type migration.
    ConsensusTypeMigration() bool

    // UseChannelCreationPolicyAsAdmins checks whether the orderer should use more sophisticated
    // channel creation logic using channel creation policy as the Admins policy if
    // the creation transaction appears to support it.
    UseChannelCreationPolicyAsAdmins() bool
}

OrdererCapabilities defines the capabilities for the orderer portion of a channel

type OrdererConfig Uses

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

OrdererConfig holds the orderer configuration information.

func NewOrdererConfig Uses

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

NewOrdererConfig creates a new instance of the orderer config.

func (*OrdererConfig) BatchSize Uses

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

BatchSize returns the maximum number of messages to include in a block.

func (*OrdererConfig) BatchTimeout Uses

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

BatchTimeout returns the amount of time to wait before creating a batch.

func (*OrdererConfig) Capabilities Uses

func (oc *OrdererConfig) Capabilities() OrdererCapabilities

Capabilities returns the capabilities the ordering network has for this channel.

func (*OrdererConfig) ConsensusMetadata Uses

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

ConsensusMetadata returns the metadata associated with the consensus type.

func (*OrdererConfig) ConsensusState Uses

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

ConsensusState return the consensus type state.

func (*OrdererConfig) ConsensusType Uses

func (oc *OrdererConfig) ConsensusType() string

ConsensusType returns the configured consensus type.

func (*OrdererConfig) KafkaBrokers Uses

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

KafkaBrokers returns the addresses (IP:port notation) of a set of "bootstrap" Kafka brokers, i.e. this is not necessarily the entire set of Kafka brokers used for ordering.

func (*OrdererConfig) MaxChannelsCount Uses

func (oc *OrdererConfig) MaxChannelsCount() uint64

MaxChannelsCount returns the maximum count of channels this orderer supports.

func (*OrdererConfig) Organizations Uses

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

Organizations returns a map of the orgs in the channel.

func (*OrdererConfig) Validate Uses

func (oc *OrdererConfig) Validate() error

type OrdererOrg Uses

type OrdererOrg interface {
    Org

    // Endpoints returns the endpoints of orderer nodes.
    Endpoints() []string
}

OrdererOrg stores the per org orderer config.

type OrdererOrgConfig Uses

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

OrdererOrgConfig defines the configuration for an orderer org

func NewOrdererOrgConfig Uses

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

NewOrdererOrgConfig returns an orderer org config built from the given ConfigGroup.

func (*OrdererOrgConfig) Endpoints Uses

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

Endpoints returns the set of addresses this ordering org exposes as orderers

func (*OrdererOrgConfig) Validate Uses

func (ooc *OrdererOrgConfig) Validate() error

type OrdererOrgProtos Uses

type OrdererOrgProtos struct {
    Endpoints *cb.OrdererAddresses
}

OrdererOrgProtos are deserialized from the Orderer org config values

type OrdererProtos Uses

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

OrdererProtos is used as the source of the OrdererConfig.

type Org Uses

type Org interface {
    // Name returns the name this org is referred to in config
    Name() string

    // MSPID returns the MSP ID associated with this org
    MSPID() string
}

Org stores the common organizational config

type OrganizationConfig Uses

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

OrganizationConfig stores the configuration for an organization

func NewOrganizationConfig Uses

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

NewOrganizationConfig creates a new config for an organization

func (*OrganizationConfig) MSPID Uses

func (oc *OrganizationConfig) MSPID() string

MSPID returns the MSP ID associated with this org

func (*OrganizationConfig) Name Uses

func (oc *OrganizationConfig) Name() string

Name returns the name this org is referred to in config

func (*OrganizationConfig) Validate Uses

func (oc *OrganizationConfig) Validate() error

Validate returns whether the configuration is valid

type OrganizationProtos Uses

type OrganizationProtos struct {
    MSP *mspprotos.MSPConfig
}

OrganizationProtos are used to deserialize the organization config

type PolicyMapper Uses

type PolicyMapper interface {
    // PolicyRefForAPI takes the name of an API, and returns the policy name
    // or the empty string if the API is not found
    PolicyRefForAPI(apiName string) string
}

PolicyMapper is an interface for

type Resources Uses

type Resources interface {
    // ConfigtxValidator returns the configtx.Validator for the channel
    ConfigtxValidator() configtx.Validator

    // PolicyManager returns the policies.Manager for the channel
    PolicyManager() policies.Manager

    // ChannelConfig returns the config.Channel for the chain
    ChannelConfig() Channel

    // OrdererConfig returns the config.Orderer for the channel
    // and whether the Orderer config exists
    OrdererConfig() (Orderer, bool)

    // ConsortiumsConfig() returns the config.Consortiums for the channel
    // and whether the consortiums config exists
    ConsortiumsConfig() (Consortiums, bool)

    // ApplicationConfig returns the configtxapplication.SharedConfig for the channel
    // and whether the Application config exists
    ApplicationConfig() (Application, bool)

    // MSPManager returns the msp.MSPManager for the chain
    MSPManager() msp.MSPManager

    // ValidateNew should return an error if a new set of configuration resources is incompatible with the current one
    ValidateNew(resources Resources) error
}

Resources is the common set of config resources for all channels Depending on whether chain is used at the orderer or at the peer, other config resources may be available

type StandardConfigValue Uses

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

StandardConfigValue implements the ConfigValue interface.

func ACLValues Uses

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

ACLsValues returns the config definition for an applications resources based ACL definitions. It is a value for the /Channel/Application/.

func AnchorPeersValue Uses

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

AnchorPeersValue returns the config definition for an org's anchor peers. It is a value for the /Channel/Application/*.

func BatchSizeValue Uses

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

BatchSizeValue returns the config definition for the orderer batch size. It is a value for the /Channel/Orderer group.

func BatchTimeoutValue Uses

func BatchTimeoutValue(timeout string) *StandardConfigValue

BatchTimeoutValue returns the config definition for the orderer batch timeout. It is a value for the /Channel/Orderer group.

func BlockDataHashingStructureValue Uses

func BlockDataHashingStructureValue() *StandardConfigValue

BlockDataHashingStructureValue returns the only currently valid block data hashing structure. It is a value for the /Channel group.

func CapabilitiesValue Uses

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

CapabilitiesValue returns the config definition for a a set of capabilities. It is a value for the /Channel/Orderer, Channel/Application/, and /Channel groups.

func ChannelCreationPolicyValue Uses

func ChannelCreationPolicyValue(policy *cb.Policy) *StandardConfigValue

ChannelCreationPolicyValue returns the config definition for a consortium's channel creation policy It is a value for the /Channel/Consortiums/*/*.

func ChannelRestrictionsValue Uses

func ChannelRestrictionsValue(maxChannelCount uint64) *StandardConfigValue

ChannelRestrictionsValue returns the config definition for the orderer channel restrictions. It is a value for the /Channel/Orderer group.

func ConsensusTypeValue Uses

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

ConsensusTypeValue returns the config definition for the orderer consensus type. It is a value for the /Channel/Orderer group.

func ConsortiumValue Uses

func ConsortiumValue(name string) *StandardConfigValue

ConsortiumValue returns the config definition for the consortium name. It is a value for the channel group.

func EndpointsValue Uses

func EndpointsValue(addresses []string) *StandardConfigValue

EndpointsValue returns the config definition for the orderer addresses at an org scoped level. It is a value for the /Channel/Orderer/<OrgName> group.

func HashingAlgorithmValue Uses

func HashingAlgorithmValue() *StandardConfigValue

HashingAlgorithm returns the only currently valid hashing algorithm. It is a value for the /Channel group.

func KafkaBrokersValue Uses

func KafkaBrokersValue(brokers []string) *StandardConfigValue

KafkaBrokersValue returns the config definition for the addresses of the ordering service's Kafka brokers. It is a value for the /Channel/Orderer group.

func MSPValue Uses

func MSPValue(mspDef *mspprotos.MSPConfig) *StandardConfigValue

MSPValue returns the config definition for an MSP. It is a value for the /Channel/Orderer/*, /Channel/Application/*, and /Channel/Consortiums/*/*/* groups.

func OrdererAddressesValue Uses

func OrdererAddressesValue(addresses []string) *StandardConfigValue

OrdererAddressesValue returns the a config definition for the orderer addresses. It is a value for the /Channel group.

func (*StandardConfigValue) Key Uses

func (scv *StandardConfigValue) Key() string

Key is the key this value should be stored in the *cb.ConfigGroup.Values map.

func (*StandardConfigValue) Value Uses

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

Value is the message which should be marshaled to opaque bytes for the *cb.ConfigValue.value.

type StandardValues Uses

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

func NewStandardValues Uses

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

NewStandardValues accepts a structure which must contain only protobuf message types. The structure may embed other (non-pointer) structures which satisfy the same condition. NewStandard values will instantiate memory for all the proto messages and build a lookup map from structure field name to proto message instance This is a useful way to easily implement the Values interface

func (*StandardValues) Deserialize Uses

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

Deserialize looks up the backing Values proto of the given name, unmarshals the given bytes to populate the backing message structure, and returns a referenced to the retained deserialized message (or an error, either because the key did not exist, or there was an an error unmarshaling

Package channelconfig imports 25 packages (graph) and is imported by 4 packages. Updated 2019-09-16. Refresh now. Tools for package owners.