configtx

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2017 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RootGroupKey = "Channel"

	GroupPrefix  = "[Groups] "
	ValuePrefix  = "[Values] "
	PolicyPrefix = "[Policy] " // The plurarility doesn't match, but, it makes the logs much easier being the same length as "Groups" and "Values"

	PathSeparator = "/"
)
View Source
const (
	// CreationPolicyKey defines the config key used in the channel
	// config, under which the creation policy is defined.
	CreationPolicyKey = "CreationPolicy"
)

Variables

This section is empty.

Functions

func ComputeDeltaSet added in v1.0.0

func ComputeDeltaSet(readSet, writeSet map[string]comparable) map[string]comparable

func MakeChainCreationTransaction added in v1.0.0

func MakeChainCreationTransaction(channelID string, consortium string, signer msp.SigningIdentity, orgs ...string) (*cb.Envelope, error)

MakeChainCreationTransaction is a handy utility function for creating new chain transactions using the underlying Template framework

func MapConfig added in v1.0.0

func MapConfig(channelGroup *cb.ConfigGroup) (map[string]comparable, error)

MapConfig is intended to be called outside this file it takes a ConfigGroup and generates a map of fqPath to comparables (or error on invalid keys)

func NewInitializer added in v1.0.0

func NewInitializer() api.Initializer

NewInitializer creates a chain initializer for the basic set of common chain resources

func NewManagerImpl added in v1.0.0

func NewManagerImpl(envConfig *cb.Envelope, initializer api.Initializer, callOnUpdate []func(api.Manager)) (api.Manager, error)

func UnmarshalConfig

func UnmarshalConfig(data []byte) (*cb.Config, error)

UnmarshalConfig attempts to unmarshal bytes to a *cb.Config

func UnmarshalConfigEnvelope

func UnmarshalConfigEnvelope(data []byte) (*cb.ConfigEnvelope, error)

UnmarshalConfigEnvelope attempts to unmarshal bytes to a *cb.ConfigEnvelope

func UnmarshalConfigEnvelopeOrPanic

func UnmarshalConfigEnvelopeOrPanic(data []byte) *cb.ConfigEnvelope

UnmarshalConfigEnvelope attempts to unmarshal bytes to a *cb.ConfigEnvelope or panics

func UnmarshalConfigOrPanic

func UnmarshalConfigOrPanic(data []byte) *cb.Config

UnmarshalConfig attempts to unmarshal bytes to a *cb.Config

func UnmarshalConfigUpdate

func UnmarshalConfigUpdate(data []byte) (*cb.ConfigUpdate, error)

UnmarshalConfigUpdate attempts to unmarshal bytes to a *cb.ConfigUpdate

func UnmarshalConfigUpdateEnvelope

func UnmarshalConfigUpdateEnvelope(data []byte) (*cb.ConfigUpdateEnvelope, error)

UnmarshalConfigUpdateEnvelope attempts to unmarshal bytes to a *cb.ConfigUpdate

func UnmarshalConfigUpdateEnvelopeOrPanic

func UnmarshalConfigUpdateEnvelopeOrPanic(data []byte) *cb.ConfigUpdateEnvelope

UnmarshalConfigUpdateEnvelope attempts to unmarshal bytes to a *cb.ConfigUpdateEnvelope or panics

func UnmarshalConfigUpdateOrPanic

func UnmarshalConfigUpdateOrPanic(data []byte) *cb.ConfigUpdate

UnmarshalConfigUpdate attempts to unmarshal bytes to a *cb.ConfigUpdate or panics

Types

type ConfigResult added in v1.0.0

type ConfigResult interface {
	JSON() string
}

func NewConfigResult added in v1.0.0

func NewConfigResult(config *cb.ConfigGroup, proposer api.Proposer) (ConfigResult, error)

type Template added in v1.0.0

type Template interface {
	// Envelope returns a ConfigUpdateEnvelope for the given chainID
	Envelope(chainID string) (*cb.ConfigUpdateEnvelope, error)
}

Template can be used to facilitate creation of config transactions

func NewChainCreationTemplate added in v1.0.0

func NewChainCreationTemplate(consortiumName string, orgs []string) Template

NewChainCreationTemplate takes a consortium name and a Template to produce a Template which outputs an appropriately constructed list of ConfigUpdateEnvelopes.

func NewCompositeTemplate added in v1.0.0

func NewCompositeTemplate(templates ...Template) Template

NewCompositeTemplate creates a Template using the source Templates

func NewModPolicySettingTemplate added in v1.0.0

func NewModPolicySettingTemplate(modPolicy string, template Template) Template

NewModPolicySettingTemplate wraps another template and sets the ModPolicy of every ConfigGroup/ConfigValue/ConfigPolicy without a modPolicy to modPolicy

func NewSimpleTemplate added in v1.0.0

func NewSimpleTemplate(configGroups ...*cb.ConfigGroup) Template

NewSimpleTemplate creates a Template using the supplied ConfigGroups

Directories

Path Synopsis
tool

Jump to

Keyboard shortcuts

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