Documentation ¶
Index ¶
- Constants
- func WithMREnclave(mrenclave string) func(*ChannelChaincode)
- func WithSGXDevicesPaths(paths []string) func(*ChannelChaincode)
- func WithSGXMode(mode string) func(*ChannelChaincode)
- type BCCSP
- type CA
- type Chaincode
- type Channel
- type ChannelChaincode
- type Consensus
- type Consortium
- type KeyIDMapping
- type Logging
- type Orderer
- type Organization
- type OrganizationOpt
- type PKCS11
- type Peer
- type PeerChannel
- type PeerIdentity
- type PeerType
- type Policy
- type PostRunInvocation
- type PrivateChaincode
- type Profile
- type SoftwareProvider
- type SystemChannel
- type Templates
- type Topology
- func (t *Topology) AddChaincode(cc *ChannelChaincode)
- func (t *Topology) AddFPC(name, image string, options ...func(*ChannelChaincode)) *ChannelChaincode
- func (t *Topology) AddFPCAtOrgs(name, image string, orgs []string, options ...func(*ChannelChaincode)) *ChannelChaincode
- func (t *Topology) AddManagedNamespace(name string, policy string, chaincode string, ctor string, peers ...string)
- func (t *Topology) AddNamespace(name string, policy string, peers ...string)
- func (t *Topology) AddNamespaceWithOneOutOfN(name string, orgs ...string)
- func (t *Topology) AddNamespaceWithUnanimity(name string, orgs ...string) *namespace
- func (t *Topology) AddOrganization(name string) *fscOrg
- func (t *Topology) AddOrganizations(num int) *Topology
- func (t *Topology) AddOrganizationsByMapping(mapping map[string][]string) *Topology
- func (t *Topology) AddOrganizationsByName(names ...string) *Topology
- func (t *Topology) AddPeer(name string, org string, typ PeerType, bootstrap bool, executable string) *Peer
- func (t *Topology) AppendOrganization(org *Organization)
- func (t *Topology) AppendPeer(peer *Peer)
- func (t *Topology) EnableFPC()
- func (t *Topology) EnableGRPCLogging()
- func (t *Topology) EnableIdemix() *fscOrg
- func (t *Topology) EnableLogOrderersToFile()
- func (t *Topology) EnableLogPeersToFile()
- func (t *Topology) EnableNodeOUs()
- func (t *Topology) EnableWeaver()
- func (t *Topology) Name() string
- func (t *Topology) SetDefault() *Topology
- func (t *Topology) SetLogging(spec, format string)
- func (t *Topology) SetNamespaceApproverOrgs(orgs ...string)
- func (t *Topology) SetNamespaceApproverOrgsOR(orgs ...string)
- func (t *Topology) Type() string
- type UserSpec
Constants ¶
const DefaultConfigTxTemplate = `` /* 5702-byte string literal not displayed */
const DefaultCoreTemplate = `` /* 6032-byte string literal not displayed */
const DefaultCryptoTemplate = `` /* 1162-byte string literal not displayed */
const DefaultFSCFabricExtensionTemplate = `` /* 3067-byte string literal not displayed */
const DefaultOrdererTemplate = `` /* 2569-byte string literal not displayed */
const OrgUpdateConfigTxTemplate = `` /* 656-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
func WithMREnclave ¶
func WithMREnclave(mrenclave string) func(*ChannelChaincode)
func WithSGXDevicesPaths ¶
func WithSGXDevicesPaths(paths []string) func(*ChannelChaincode)
func WithSGXMode ¶
func WithSGXMode(mode string) func(*ChannelChaincode)
Types ¶
type Chaincode ¶
type Chaincode struct { Name string Version string Path string Ctor string Policy string // only used for legacy lifecycle. For new lifecycle use SignaturePolicy Lang string CollectionsConfig string // optional PackageFile string PackageID string `yaml:"packageID,omitempty"` // if unspecified, chaincode won't be executable. Can use SetPackageIDFromPackageFile() to set. CodeFiles map[string]string // map from paths on the filesystem to code.tar.gz paths Sequence string EndorsementPlugin string ValidationPlugin string InitRequired bool Label string SignaturePolicy string ChannelConfigPolicy string }
func (*Chaincode) SetPackageIDFromPackageFile ¶
func (c *Chaincode) SetPackageIDFromPackageFile()
type Channel ¶
type Channel struct { Name string `yaml:"name,omitempty"` Profile string `yaml:"profile,omitempty"` BaseProfile string `yaml:"baseprofile,omitempty"` Default bool `yaml:"default,omitempty"` }
Channel associates a channel name with a configtxgen profile name.
type ChannelChaincode ¶
type ChannelChaincode struct { Chaincode Chaincode `yaml:"chaincode,omitempty"` PrivateChaincode PrivateChaincode `yaml:"privatechaincode,omitempty"` Path string `yaml:"path,omitempty"` Channel string `yaml:"channel,omitempty"` Peers []string `yaml:"peers,omitempty"` Private bool `yaml:"private,omitempty"` PostRunInvocations []PostRunInvocation `yaml:"postruninvocations,omitempty"` }
func (*ChannelChaincode) AddPostRunInvocation ¶
func (c *ChannelChaincode) AddPostRunInvocation(functionName string, expectedResult interface{}, args ...[]byte)
type Consensus ¶
type Consensus struct { Type string `yaml:"type,omitempty"` BootstrapMethod string `yaml:"bootstrap_method,omitempty"` ChannelParticipationEnabled bool `yaml:"channel_participation_enabled,omitempty"` }
Consensus indicates the orderer types (we only support SOLO for testing)
type Consortium ¶
type Consortium struct { Name string `yaml:"name,omitempty"` Organizations []string `yaml:"organizations,omitempty"` }
A Consortium is a named collection of Organizations. It is used to populate the Orderer geneesis block profile.
type KeyIDMapping ¶
type KeyIDMapping = config.KeyIDMapping
type Orderer ¶
type Orderer struct { Name string `yaml:"name,omitempty"` Organization string `yaml:"organization,omitempty"` Id int `yaml:"id,omitempty"` }
Orderer defines an orderer instance and its owning organization.
type Organization ¶
type Organization struct { ID string `yaml:"id,omitempty"` MSPID string `yaml:"msp_id,omitempty"` MSPType string `yaml:"msp_type,omitempty"` Name string `yaml:"name,omitempty"` Domain string `yaml:"domain,omitempty"` EnableNodeOUs bool `yaml:"enable_node_organizational_units"` Users int `yaml:"users,omitempty"` UserSpecs []UserSpec `yaml:"Specs,omitempty"` CA *CA `yaml:"ca,omitempty"` }
Organization models information about an Organization. It includes the information needed to populate an MSP with cryptogen.
type OrganizationOpt ¶
type OrganizationOpt struct {
Name string
}
type Peer ¶
type Peer struct { Name string `yaml:"name,omitempty"` Organization string `yaml:"organization,omitempty"` Type PeerType `yaml:"type,omitempty"` Bootstrap bool `yaml:"bootstrap,omitempty"` ExecutablePath string `yaml:"executablepath,omitempty"` Role string `yaml:"role,omitempty"` Channels []*PeerChannel `yaml:"channels,omitempty"` DefaultIdentity string `yaml:"defaultMSP,omitempty"` Identities []*PeerIdentity `yaml:"identities,omitempty"` Usage string `yaml:"usage,omitempty"` SkipInit bool `yaml:"skipinit,omitempty"` SkipRunning bool `yaml:"skiprunning,omitempty"` TLSDisabled bool `yaml:"tlsdisabled,omitempty"` Hostname string `yaml:"hostname,omitempty"` DevMode bool DefaultNetwork bool `yaml:"-"` FSCNode *node.Node `yaml:"-"` }
Peer defines a peer instance, it's owning organization, and the list of channels that the peer should be joined to.
type PeerChannel ¶
PeerChannel names of the channel a peer should be joined to and whether or not the peer should be an anchor for the channel.
type PeerIdentity ¶
type PostRunInvocation ¶
type PrivateChaincode ¶
type Profile ¶
type Profile struct { Name string `yaml:"name,omitempty"` Orderers []string `yaml:"orderers,omitempty"` Consortium string `yaml:"consortium,omitempty"` Organizations []string `yaml:"organizations,omitempty"` AppCapabilities []string `yaml:"app_capabilities,omitempty"` ChannelCapabilities []string `yaml:"channel_capabilities,omitempty"` Policies []*Policy `yaml:"policies,omitempty"` }
Profile encapsulates basic information for a configtxgen profile.
type SoftwareProvider ¶
type SoftwareProvider = config.SoftwareProvider
type SystemChannel ¶
type SystemChannel struct { Name string `yaml:"name,omitempty"` Profile string `yaml:"profile,omitempty"` }
The SystemChannel declares the name of the network system channel and its associated configtxgen profile name.
type Templates ¶
type Templates struct { ConfigTx string `yaml:"configtx,omitempty"` Core string `yaml:"core,omitempty"` Crypto string `yaml:"crypto,omitempty"` Orderer string `yaml:"orderer,omitempty"` }
Templates can be used to provide custom templates to GenerateConfigTree.
func (*Templates) ConfigTxTemplate ¶
func (*Templates) CoreTemplate ¶
func (*Templates) CryptoTemplate ¶
func (*Templates) FSCFabricExtensionTemplate ¶
func (*Templates) OrdererTemplate ¶
type Topology ¶
type Topology struct { TopologyName string `yaml:"name,omitempty"` TopologyType string `yaml:"type,omitempty"` Default bool `yaml:"default,omitempty"` Driver string `yaml:"driver,omitempty"` Logging *Logging `yaml:"logging,omitempty"` Organizations []*Organization `yaml:"organizations,omitempty"` Peers []*Peer `yaml:"peers,omitempty"` Consortiums []*Consortium `yaml:"consortiums,omitempty"` SystemChannel *SystemChannel `yaml:"system_channel,omitempty"` Channels []*Channel `yaml:"channels,omitempty"` Consensus *Consensus `yaml:"consensus,omitempty"` Orderers []*Orderer `yaml:"orderers,omitempty"` Profiles []*Profile `yaml:"profiles,omitempty"` Templates *Templates `yaml:"templates,omitempty"` Chaincodes []*ChannelChaincode `yaml:"chaincodes,omitempty"` PvtTxSupport bool `yaml:"pvttxsupport,omitempty"` PvtTxCCSupport bool `yaml:"pvttxccsupport,omitempty"` MSPvtTxSupport bool `yaml:"mspvttxsupport,omitempty"` MSPvtCCSupport bool `yaml:"mspvtccsupport,omitempty"` FabTokenSupport bool `yaml:"fabtokensupport,omitempty"` FabTokenCCSupport bool `yaml:"fabtokenccsupport,omitempty"` GRPCLogging bool `yaml:"grpcLogging,omitempty"` NodeOUs bool `yaml:"nodeous,omitempty"` FPC bool `yaml:"fpc,omitempty"` Weaver bool `yaml:"weaver,omitempty"` LogPeersToFile bool `yaml:"logPeersToFile,omitempty"` LogOrderersToFile bool `yaml:"logOrderersToFile,omitempty"` TLSEnabled bool `yaml:"tlsEnabled,omitempty"` ExtraParams map[string]interface{} `yaml:"-"` }
Topology holds the basic information needed to generate fabric configuration files.
func (*Topology) AddChaincode ¶
func (t *Topology) AddChaincode(cc *ChannelChaincode)
func (*Topology) AddFPC ¶
func (t *Topology) AddFPC(name, image string, options ...func(*ChannelChaincode)) *ChannelChaincode
AddFPC adds the Fabric Private Chaincode with the passed name and image. The Fabric Private Chaincode is installed on all organizations registered so far. The endorsement policy is set to the majority of the organization on which the chaincode has been installed.
func (*Topology) AddFPCAtOrgs ¶
func (t *Topology) AddFPCAtOrgs(name, image string, orgs []string, options ...func(*ChannelChaincode)) *ChannelChaincode
AddFPCAtOrgs adds the Fabric Private Chaincode with the passed name, image, and organizations If no orgs are specified, then the Fabric Private Chaincode is installed on all organizations registered so far. The endorsement policy is set to the majority of the organization on which the chaincode has been installed.
func (*Topology) AddManagedNamespace ¶
func (*Topology) AddNamespace ¶
func (*Topology) AddNamespaceWithOneOutOfN ¶
func (*Topology) AddNamespaceWithUnanimity ¶
func (*Topology) AddOrganization ¶
func (*Topology) AddOrganizations ¶
func (*Topology) AddOrganizationsByMapping ¶
func (*Topology) AddOrganizationsByName ¶
func (*Topology) AppendOrganization ¶
func (t *Topology) AppendOrganization(org *Organization)
func (*Topology) AppendPeer ¶
func (*Topology) EnableFPC ¶
func (t *Topology) EnableFPC()
EnableFPC enables FPC by adding the Enclave Registry Chaincode definition. The ERCC is installed on all organizations and the endorsement policy is set to the majority of the organization on which the chaincode has been installed.
func (*Topology) EnableGRPCLogging ¶
func (t *Topology) EnableGRPCLogging()
func (*Topology) EnableIdemix ¶
func (t *Topology) EnableIdemix() *fscOrg
func (*Topology) EnableLogOrderersToFile ¶
func (t *Topology) EnableLogOrderersToFile()
func (*Topology) EnableLogPeersToFile ¶
func (t *Topology) EnableLogPeersToFile()
func (*Topology) EnableNodeOUs ¶
func (t *Topology) EnableNodeOUs()
func (*Topology) EnableWeaver ¶
func (t *Topology) EnableWeaver()