Documentation ¶
Index ¶
- Constants
- func ApproveChaincodeForMyOrg(n *Network, channel string, orderer *topology.Orderer, ...)
- func BCCSPOpts(defaultProvider string) *topology.BCCSP
- func Broadcast(n *Network, o *topology.Orderer, env *common.Envelope) (*orderer.BroadcastResponse, error)
- func CheckCommitReadinessUntilReady(n *Network, channel string, chaincode *topology.Chaincode, ...)
- func CommitChaincode(n *Network, channel string, orderer *topology.Orderer, ...)
- func Compute(original, updated *cb.Config) (*cb.ConfigUpdate, error)
- func ComputeUpdateOrdererConfig(updateFile string, n *Network, channel string, current, updated *common.Config, ...)
- func CurrentConfigBlockNumber(n *Network, peer *topology.Peer, orderer *topology.Orderer, channel string) uint64
- func CurrentConfigBlockNumberFromPeer(n *Network, peer *topology.Peer, channel, output string) uint64
- func Deliver(n *Network, o *topology.Orderer, env *common.Envelope) (*common.Block, error)
- func DiscoverPeers(n *Network, p *topology.Peer, user, channelName string) func() []DiscoveredPeer
- func EnsureChaincodeCommitted(n *Network, channel, name, version, sequence string, ...)
- func EnsureInstalled(n *Network, label, packageID string, peers ...*topology.Peer)
- func FetchConfigBlock(n *Network, peer *topology.Peer, orderer *topology.Orderer, channel string, ...)
- func FindOptOrg(orgs []opts.Organization, network string) (opts.Organization, bool)
- func GetConfig(n *Network, peer *topology.Peer, orderer *topology.Orderer, channel string) *common.Config
- func GetConfigBlock(n *Network, peer *topology.Peer, orderer *topology.Orderer, channel string) *common.Block
- func GetLinkedIdentities(peer *topology.Peer) []string
- func GetPersistenceType(peer *topology.Peer) string
- func GetVaultPersistenceOrionCreator(peer *topology.Peer) string
- func GetVaultPersistenceOrionDatabase(peer *topology.Peer) string
- func GetVaultPersistenceOrionNetwork(peer *topology.Peer) string
- func InitChaincode(n *Network, channel string, orderer *topology.Orderer, ...)
- func InstallChaincode(n *Network, chaincode *topology.Chaincode, peers ...*topology.Peer)
- func NewEmptyTopology() *topology.Topology
- func NewIdemixPeerIdentity(id, eid string) *topology.PeerIdentity
- func NewX509PeerIdentity(id, eid, path string, org opts.Organization, bccspDefault string, Default bool) *topology.PeerIdentity
- func OrdererPortNames() []api.PortName
- func PackageAndInstallChaincode(n *Network, chaincode *topology.Chaincode, peers ...*topology.Peer)
- func PackageChaincode(n *Network, chaincode *topology.Chaincode, peer *topology.Peer)
- func PackageChaincodeBinary(c *topology.Chaincode)
- func PeerPortNames() []api.PortName
- func QueryInstalled(n *Network, peer *topology.Peer) func() []lifecycle.QueryInstalledChaincodesResult_InstalledChaincode
- func QueryInstalledReferences(n *Network, channel, label, packageID string, checkPeer *topology.Peer, ...)
- func UnmarshalBlockFromFile(blockFile string) *common.Block
- func UpdateConfig(n *Network, orderer *topology.Orderer, channel string, ...)
- func UpdateConsensusMetadata(network *Network, peer *topology.Peer, orderer *topology.Orderer, ...)
- func UpdateOrdererConfig(n *Network, orderer *topology.Orderer, channel string, ...)
- func UpdateOrdererConfigSession(n *Network, orderer *topology.Orderer, channel string, ...) *gexec.Session
- func UpdateOrdererMSP(network *Network, peer *topology.Peer, orderer *topology.Orderer, ...)
- type AdminCredential
- type Builder
- type BuilderClient
- type CertificationAuthority
- type ChaincodeProcessor
- type Channel
- type ChannelPeer
- type Client
- type Connection
- type ConnectionProfile
- type ConsensusMetadataMutator
- type DiscoveredPeer
- type Extension
- type HttpOptions
- type MSPMutator
- type Network
- func (n *Network) AddExtension(ex Extension)
- func (n *Network) AddOrg(o *topology.Organization, peers ...*topology.Peer)
- func (n *Network) AnchorsForChannel(chanName string) []*topology.Peer
- func (n *Network) AnchorsInOrg(orgName string) []*topology.Peer
- func (n *Network) AppendPeer(peer *topology.Peer)
- func (n *Network) BootstrapNode(me *topology.Peer) string
- func (n *Network) CACertsBundlePath() string
- func (n *Network) Chaincodes(channel string) []*topology.ChannelChaincode
- func (n *Network) CheckTopology()
- func (n *Network) CheckTopologyExtensions()
- func (n *Network) CheckTopologyFSCNodes() (users map[string]int, userSpecs map[string][]topology.UserSpec)
- func (n *Network) CheckTopologyFabricPeers()
- func (n *Network) CheckTopologyOrderers()
- func (n *Network) CheckTopologyOrgs(users map[string]int, userSpecs map[string][]topology.UserSpec)
- func (n *Network) Cleanup()
- func (n *Network) ConcatenateTLSCACertificates()
- func (n *Network) ConfigDir() string
- func (n *Network) ConfigTxConfigPath() string
- func (n *Network) ConfigTxGen(command common.Command) (*gexec.Session, error)
- func (n *Network) Consortium(name string) *topology.Consortium
- func (n *Network) CreateAndJoinChannel(o *topology.Orderer, channelName string)
- func (n *Network) CreateAndJoinChannels(o *topology.Orderer)
- func (n *Network) CreateChannel(channelName string, o *topology.Orderer, p *topology.Peer, ...)
- func (n *Network) CreateChannelExitCode(channelName string, o *topology.Orderer, p *topology.Peer, ...) int
- func (n *Network) CreateChannelTxPath(channelName string) string
- func (n *Network) CryptoConfigPath() string
- func (n *Network) CryptoPath() string
- func (n *Network) Cryptogen(command common.Command) (*gexec.Session, error)
- func (n *Network) DefaultIdemixOrgMSPDir() string
- func (n *Network) DeployChaincode(chaincode *topology.ChannelChaincode)
- func (n *Network) Discover(command common.Command) (*gexec.Session, error)
- func (n *Network) DiscoveredPeer(p *topology.Peer, chaincodes ...string) DiscoveredPeer
- func (n *Network) DiscoveredPeerMatcher(p *topology.Peer, chaincodes ...string) types.GomegaMatcher
- func (n *Network) FSCNodeLocalTLSDir(p *topology.Peer) string
- func (n *Network) FSCNodeVaultDir(peer *topology.Peer) string
- func (n *Network) FSCPeerByName(name string) *topology.Peer
- func (n *Network) GenerateArtifacts()
- func (n *Network) GenerateConfigTree()
- func (n *Network) GenerateConfigTxConfig()
- func (n *Network) GenerateCoreConfig(p *topology.Peer)
- func (n *Network) GenerateCryptoConfig()
- func (n *Network) GenerateOrdererConfig(o *topology.Orderer)
- func (n *Network) GenerateResolverMap()
- func (n *Network) IdemixOrgMSPDir(org *topology.Organization) string
- func (n *Network) IdemixOrgs() []*topology.Organization
- func (n *Network) IdemixUserMSPDir(o *topology.Organization, user string) string
- func (n *Network) Idemixgen(command common.Command) (*gexec.Session, error)
- func (n *Network) JoinChannel(name string, o *topology.Orderer, peers ...*topology.Peer)
- func (n *Network) ListTLSCACertificates() []string
- func (n *Network) Load()
- func (n *Network) LogFormat() string
- func (n *Network) LogSpec() string
- func (n *Network) Members() []grouper.Member
- func (n *Network) Orderer(name string) *topology.Orderer
- func (n *Network) OrdererAddress(o *topology.Orderer, portName api.PortName) string
- func (n *Network) OrdererAdminSession(o *topology.Orderer, p *topology.Peer, command common.Command) (*gexec.Session, error)
- func (n *Network) OrdererBootstrapFile() string
- func (n *Network) OrdererConfigPath(o *topology.Orderer) string
- func (n *Network) OrdererDir(o *topology.Orderer) string
- func (n *Network) OrdererGroupRunner() ifrit.Runner
- func (n *Network) OrdererHost(o *topology.Orderer) string
- func (n *Network) OrdererLocalCryptoDir(o *topology.Orderer, cryptoType string) string
- func (n *Network) OrdererLocalMSPDir(o *topology.Orderer) string
- func (n *Network) OrdererLocalTLSDir(o *topology.Orderer) string
- func (n *Network) OrdererLogsFolder() string
- func (n *Network) OrdererOrgMSPDir(o *topology.Organization) string
- func (n *Network) OrdererOrgs() []*topology.Organization
- func (n *Network) OrdererPort(o *topology.Orderer, portName api.PortName) uint16
- func (n *Network) OrdererRunner(o *topology.Orderer) *runner2.Runner
- func (n *Network) OrdererUserCert(o *topology.Orderer, user string) string
- func (n *Network) OrdererUserKey(o *topology.Orderer, user string) string
- func (n *Network) OrdererUserMSPDir(o *topology.Orderer, user string) string
- func (n *Network) OrderersInOrg(orgName string) []*topology.Orderer
- func (n *Network) OrgOrdererCACertificatePath(org *topology.Organization) string
- func (n *Network) OrgOrdererTLSCACertificatePath(org *topology.Organization) string
- func (n *Network) OrgPeerCACertificatePath(org *topology.Organization) string
- func (n *Network) Organization(orgName string) *topology.Organization
- func (n *Network) OrgsForOrderers(ordererNames []string) []*topology.Organization
- func (n *Network) OutputBlockPath(channelName string) string
- func (n *Network) Peer(orgName, peerName string) *topology.Peer
- func (n *Network) PeerAddress(p *topology.Peer, portName api.PortName) string
- func (n *Network) PeerAddressByName(p *topology.Peer, portName api.PortName) string
- func (n *Network) PeerAdminSession(p *topology.Peer, command common.Command) (*gexec.Session, error)
- func (n *Network) PeerByName(name string) *topology.Peer
- func (n *Network) PeerCert(p *topology.Peer) string
- func (n *Network) PeerConfigPath(p *topology.Peer) string
- func (n *Network) PeerDir(p *topology.Peer) string
- func (n *Network) PeerGroupRunner() ifrit.Runner
- func (n *Network) PeerHost(o *topology.Peer) string
- func (n *Network) PeerKey(p *topology.Peer) string
- func (n *Network) PeerLedgerDir(p *topology.Peer) string
- func (n *Network) PeerLocalExtraIdentityDir(p *topology.Peer, id string) string
- func (n *Network) PeerLocalIdemixExtraIdentitiesDir(p *topology.Peer) string
- func (n *Network) PeerLocalMSP(p *topology.Peer) string
- func (n *Network) PeerLocalMSPDir(p *topology.Peer) string
- func (n *Network) PeerLocalMSPIdentityCert(p *topology.Peer) string
- func (n *Network) PeerLocalTLSDir(p *topology.Peer) string
- func (n *Network) PeerLogsFolder() string
- func (n *Network) PeerOrgMSPDir(org *topology.Organization) string
- func (n *Network) PeerOrgs() []*topology.Organization
- func (n *Network) PeerOrgsByPeers(peers []*topology.Peer) []*topology.Organization
- func (n *Network) PeerPort(p *topology.Peer, portName api.PortName) uint16
- func (n *Network) PeerPortByName(p *topology.Peer, portName api.PortName) uint16
- func (n *Network) PeerRunner(p *topology.Peer, env ...string) *runner2.Runner
- func (n *Network) PeerUserCert(p *topology.Peer, user string) string
- func (n *Network) PeerUserKey(p *topology.Peer, user string) string
- func (n *Network) PeerUserLocalMSP(p *topology.Peer, user string) string
- func (n *Network) PeerUserLocalMSPIdentityCert(p *topology.Peer, user string) string
- func (n *Network) PeerUserMSPDir(p *topology.Peer, user string) string
- func (n *Network) PeerUserSession(p *topology.Peer, user string, command common.Command) (*gexec.Session, error)
- func (n *Network) PeerUserTLSDir(p *topology.Peer, user string) string
- func (n *Network) PeersByName(names []string) []*topology.Peer
- func (n *Network) PeersForChaincodeByName(names []string) []*topology.Peer
- func (n *Network) PeersInOrg(orgName string) []*topology.Peer
- func (n *Network) PeersInOrgWithOptions(orgName string, includeAll bool) []*topology.Peer
- func (n *Network) PeersWithChannel(chanName string) []*topology.Peer
- func (n *Network) PostRun(load bool)
- func (n *Network) ProfileForChannel(channelName string) string
- func (n *Network) ReadConfigTxConfig() *fabricconfig.ConfigTx
- func (n *Network) ReadOrdererConfig(o *topology.Orderer) *fabricconfig.Orderer
- func (n *Network) ReadPeerConfig(p *topology.Peer) *fabricconfig.Core
- func (n *Network) ResolverMapPath(p *topology.Peer) string
- func (n *Network) StartSession(cmd *exec.Cmd, name string) (*gexec.Session, error)
- func (n *Network) Topology() *topology.Topology
- func (n *Network) UpdateChaincode(chaincodeId string, version string, path string, packageFile string)
- func (n *Network) UpdateChannelAnchors(o *topology.Orderer, channelName string)
- func (n *Network) VerifyMembership(expectedPeers []*topology.Peer, channel string, chaincodes ...string)
- func (n *Network) ViewNodeLocalCertPath(peer *topology.Peer) string
- func (n *Network) ViewNodeLocalPrivateKeyPath(peer *topology.Peer) string
- func (n *Network) ViewNodeMSPDir(p *topology.Peer) string
- func (n *Network) WriteConfigTxConfig(config *fabricconfig.ConfigTx)
- func (n *Network) WriteOrdererConfig(o *topology.Orderer, config *fabricconfig.Orderer)
- func (n *Network) WritePeerConfig(p *topology.Peer, config *fabricconfig.Core)
- type Orderer
- type Organization
- type Peer
- type Resolver
- type ResolverIdentity
- type T
- type Timeout
Constants ¶
const ( ChaincodePort api.PortName = "Chaincode" EventsPort api.PortName = "Events" HostPort api.PortName = "HostPort" ListenPort api.PortName = "Listen" ProfilePort api.PortName = "Profile" OperationsPort api.PortName = "Operations" ViewPort api.PortName = "View" P2PPort api.PortName = "P2P" ClusterPort api.PortName = "Cluster" WebPort api.PortName = "Web" AdminPort api.PortName = "Admin" )
const (
FabricBinsPathEnvKey = "FAB_BINS"
)
Variables ¶
This section is empty.
Functions ¶
func BCCSPOpts ¶
BCCSPOpts returns a `topology.BCCSP` instance. `defaultProvider` sets the `Default` value of the BCCSP, that is denoting the which provider impl is used. `defaultProvider` currently supports `SW` and `PKCS11`.
func Broadcast ¶
func Broadcast(n *Network, o *topology.Orderer, env *common.Envelope) (*orderer.BroadcastResponse, error)
Broadcast sends given env to Broadcast API of specified orderer.
func CommitChaincode ¶
func CurrentConfigBlockNumber ¶
func CurrentConfigBlockNumber(n *Network, peer *topology.Peer, orderer *topology.Orderer, channel string) uint64
CurrentConfigBlockNumber retrieves the block number from the header of the current config block. This can be used to detect when configuration change has completed. If an orderer is not provided, the current config block will be fetched from the peer.
func CurrentConfigBlockNumberFromPeer ¶
func CurrentConfigBlockNumberFromPeer(n *Network, peer *topology.Peer, channel, output string) uint64
CurrentConfigBlockNumberFromPeer retrieves the block number from the header of the peer's current config block.
func DiscoverPeers ¶
func DiscoverPeers(n *Network, p *topology.Peer, user, channelName string) func() []DiscoveredPeer
running discovery service command discover peers against peer using channel name and user as specified in the function arguments. return a slice of the discovered peers
func EnsureChaincodeCommitted ¶
func EnsureChaincodeCommitted(n *Network, channel, name, version, sequence string, checkOrgs []*topology.Organization, peers ...*topology.Peer)
EnsureChaincodeCommitted polls each supplied peer until the chaincode definition has been committed to the peer's rwset.
func EnsureInstalled ¶
func FetchConfigBlock ¶
func FetchConfigBlock(n *Network, peer *topology.Peer, orderer *topology.Orderer, channel string, output string)
FetchConfigBlock fetches latest config block.
func FindOptOrg ¶
func FindOptOrg(orgs []opts.Organization, network string) (opts.Organization, bool)
FindOptOrg searches for the organization matching the passed network.
func GetConfig ¶
func GetConfig(n *Network, peer *topology.Peer, orderer *topology.Orderer, channel string) *common.Config
GetConfig retrieves the last config of the given channel.
func GetConfigBlock ¶
func GetConfigBlock(n *Network, peer *topology.Peer, orderer *topology.Orderer, channel string) *common.Block
GetConfigBlock retrieves the current config block for a channel.
func GetLinkedIdentities ¶
func GetPersistenceType ¶
func InitChaincode ¶
func InstallChaincode ¶
func NewEmptyTopology ¶
func NewIdemixPeerIdentity ¶
func NewIdemixPeerIdentity(id, eid string) *topology.PeerIdentity
func NewX509PeerIdentity ¶
func NewX509PeerIdentity(id, eid, path string, org opts.Organization, bccspDefault string, Default bool) *topology.PeerIdentity
func OrdererPortNames ¶
OrdererPortNames returns the list of ports that need to be reserved for an Orderer.
func PackageChaincode ¶
func PackageChaincodeBinary ¶
PackageChaincodeBinary is a helper function to package an already built chaincode and write it to the location specified by Chaincode.PackageFile.
func PeerPortNames ¶
PeerPortNames returns the list of ports that need to be reserved for a Peer.
func QueryInstalled ¶
func QueryInstalled(n *Network, peer *topology.Peer) func() []lifecycle.QueryInstalledChaincodesResult_InstalledChaincode
func UnmarshalBlockFromFile ¶
UnmarshalBlockFromFile unmarshals a proto encoded block from a file.
func UpdateConfig ¶
func UpdateConfig(n *Network, orderer *topology.Orderer, channel string, current, updated *common.Config, getConfigBlockFromOrderer bool, submitter *topology.Peer, additionalSigners ...*topology.Peer)
UpdateConfig computes, signs, and submits a configuration update and waits for the update to complete.
func UpdateConsensusMetadata ¶
func UpdateConsensusMetadata(network *Network, peer *topology.Peer, orderer *topology.Orderer, channel string, mutateMetadata ConsensusMetadataMutator)
UpdateConsensusMetadata executes a config update that updates the consensus metadata according to the given ConsensusMetadataMutator.
func UpdateOrdererConfig ¶
func UpdateOrdererConfig(n *Network, orderer *topology.Orderer, channel string, current, updated *common.Config, submitter *topology.Peer, additionalSigners ...*topology.Orderer)
UpdateOrdererConfig computes, signs, and submits a configuration update which requires orderers signature and waits for the update to complete.
func UpdateOrdererConfigSession ¶
func UpdateOrdererConfigSession(n *Network, orderer *topology.Orderer, channel string, current, updated *common.Config, submitter *topology.Peer, additionalSigners ...*topology.Orderer) *gexec.Session
UpdateOrdererConfigSession computes, signs, and submits a configuration update which requires orderer signatures. The caller should wait on the returned seession retrieve the exit code.
func UpdateOrdererMSP ¶
Types ¶
type AdminCredential ¶
type BuilderClient ¶
type CertificationAuthority ¶
type CertificationAuthority struct { Url string `json:"url"` CaName string `json:"caName"` TLSCACerts map[string]string `json:"tlsCACerts"` HttpOptions HttpOptions `json:"httpOptions"` }
type ChaincodeProcessor ¶
type ChaincodeProcessor interface {
Process(network *Network, cc *topology.ChannelChaincode) *topology.ChannelChaincode
}
type Channel ¶
type Channel struct { Orderers []string `json:"orderers"` Peers map[string]ChannelPeer `json:"peers"` }
type ChannelPeer ¶
type Client ¶
type Client struct { AdminCredential AdminCredential `json:"adminCredential"` Organization string `json:"organization"` EnableAuthentication bool `json:"enableAuthentication"` TlsEnable bool `json:"tlsEnable"` Connection Connection `json:"connection"` }
type Connection ¶
type Connection struct {
Timeout Timeout `json:"timeout"`
}
type ConnectionProfile ¶
type ConnectionProfile struct { Name string `json:"name"` Version string `json:"version"` Client Client `json:"client"` Channels map[string]Channel `json:"channels"` Orderers map[string]Orderer `json:"orderers"` Organizations map[string]Organization `json:"organizations"` Peers map[string]Peer `json:"peers"` CertificateAuthorities map[string]CertificationAuthority `json:"certificateAuthorities"` }
type ConsensusMetadataMutator ¶
ConsensusMetadataMutator receives ConsensusType.Metadata and mutates it.
type DiscoveredPeer ¶
type DiscoveredPeer struct { MSPID string `yaml:"mspid,omitempty"` Endpoint string `yaml:"endpoint,omitempty"` Identity string `yaml:"identity,omitempty"` Chaincodes []string `yaml:"chaincodes,omitempty"` }
DiscoveredPeer defines a struct for discovering peers using discovery service. each peer in the result will have these fields
type Extension ¶
type Extension interface { CheckTopology() GenerateArtifacts() PostRun(load bool) }
type HttpOptions ¶
type HttpOptions struct {
Verify bool `json:"verify"`
}
type MSPMutator ¶
type MSPMutator func(config msp.FabricMSPConfig) msp.FabricMSPConfig
MSPMutator receives FabricMSPConfig and mutates it.
type Network ¶
type Network struct { Context api.Context RootDir string Prefix string Builder *Builder ExternalBuilders []fabricconfig.ExternalBuilder NetworkID string EventuallyTimeout time.Duration MetricsProvider string StatsdEndpoint string ClientAuthRequired bool Logging *topology.Logging PvtTxSupport bool PvtTxCCSupport bool MSPvtTxSupport bool MSPvtCCSupport bool FabTokenSupport bool FabTokenCCSupport bool GRPCLogging bool Organizations []*topology.Organization SystemChannel *topology.SystemChannel Channels []*topology.Channel Consensus *topology.Consensus Orderers []*topology.Orderer Peers []*topology.Peer Profiles []*topology.Profile Consortiums []*topology.Consortium Templates *topology.Templates Resolvers []*Resolver Extensions []Extension // contains filtered or unexported fields }
func New ¶
func New(reg api.Context, topology *topology.Topology, builderClient BuilderClient, ccps []ChaincodeProcessor, NetworkID string) *Network
func (*Network) AddExtension ¶
func (*Network) AddOrg ¶
func (n *Network) AddOrg(o *topology.Organization, peers ...*topology.Peer)
AddOrg adds an organization to a network.
func (*Network) AnchorsForChannel ¶
AnchorsForChannel returns all Peer instances that are anchors for the named channel.
func (*Network) AnchorsInOrg ¶
AnchorsInOrg returns all peers that are an anchor for at least one channel in the named organization.
func (*Network) AppendPeer ¶ added in v0.3.0
func (*Network) CACertsBundlePath ¶
CACertsBundlePath returns the path to the bundle of CA certificates for the network. This bundle is used when connecting to peers.
func (*Network) Chaincodes ¶
func (n *Network) Chaincodes(channel string) []*topology.ChannelChaincode
func (*Network) CheckTopology ¶
func (n *Network) CheckTopology()
CheckTopology checks the topology of the network
func (*Network) CheckTopologyExtensions ¶
func (n *Network) CheckTopologyExtensions()
CheckTopologyExtensions checks the topology of each extension
func (*Network) CheckTopologyFSCNodes ¶
func (n *Network) CheckTopologyFSCNodes() (users map[string]int, userSpecs map[string][]topology.UserSpec)
CheckTopologyFSCNodes checks that the FSC nodes' are well configured. It returns the parameters to be used for cryptogen.
func (*Network) CheckTopologyFabricPeers ¶
func (n *Network) CheckTopologyFabricPeers()
CheckTopologyFabricPeers checks that the fabric peers' ports are allocated
func (*Network) CheckTopologyOrderers ¶
func (n *Network) CheckTopologyOrderers()
CheckTopologyOrderers checks that the orderers' ports are allocated
func (*Network) CheckTopologyOrgs ¶
CheckTopologyOrgs allocates users for each organization
func (*Network) ConcatenateTLSCACertificates ¶
func (n *Network) ConcatenateTLSCACertificates()
ConcatenateTLSCACertificates concatenates all TLS CA certificates into a single file to be used by peer CLI.
func (*Network) ConfigTxConfigPath ¶
ConfigTxPath returns the path to the generated configtxgen configuration file.
func (*Network) ConfigTxGen ¶
ConfigTxGen starts a gexec.Session for the provided configtxgen command.
func (*Network) Consortium ¶
func (n *Network) Consortium(name string) *topology.Consortium
Consortium returns information about the named Consortium.
func (*Network) CreateAndJoinChannel ¶
CreateAndJoinChannel will create the specified channel. The referencing peers will then be joined to the channel.
The network must be running before this is called.
func (*Network) CreateAndJoinChannels ¶
CreateAndJoinChannels will create all channels specified in the config that are referenced by peers. The referencing peers will then be joined to the channel(s).
The network must be running before this is called.
func (*Network) CreateChannel ¶
func (n *Network) CreateChannel(channelName string, o *topology.Orderer, p *topology.Peer, additionalSigners ...interface{})
CreateChannel will submit an existing create channel transaction to the specified orderer. The channel transaction must exist at the location returned by CreateChannelTxPath. Optionally, additional signers may be included in the case where the channel creation tx modifies other aspects of the channel config for the new channel.
The orderer must be running when this is called.
func (*Network) CreateChannelExitCode ¶
func (n *Network) CreateChannelExitCode(channelName string, o *topology.Orderer, p *topology.Peer, additionalSigners ...interface{}) int
CreateChannelExitCode will submit an existing create channel transaction to the specified orderer, wait for the operation to complete, and return the exit status of the "peer channel create" command.
The channel transaction must exist at the location returned by CreateChannelTxPath and the orderer must be running when this is called.
func (*Network) CreateChannelTxPath ¶
CreateChannelTxPath returns the path to the create channel transaction for the named channel.
func (*Network) CryptoConfigPath ¶
CryptoConfigPath returns the path to the generated cryptogen configuration file.
func (*Network) CryptoPath ¶
CryptoPath returns the path to the directory where cryptogen will place its generated artifacts.
func (*Network) DefaultIdemixOrgMSPDir ¶
func (*Network) DeployChaincode ¶
func (n *Network) DeployChaincode(chaincode *topology.ChannelChaincode)
func (*Network) DiscoveredPeer ¶
func (n *Network) DiscoveredPeer(p *topology.Peer, chaincodes ...string) DiscoveredPeer
DiscoveredPeer creates a new DiscoveredPeer from the peer and chaincodes passed as arguments.
func (*Network) DiscoveredPeerMatcher ¶
func (*Network) FSCNodeLocalTLSDir ¶
FSCNodeLocalTLSDir returns the path to the local TLS directory for the peer.
func (*Network) GenerateArtifacts ¶
func (n *Network) GenerateArtifacts()
func (*Network) GenerateConfigTree ¶
func (n *Network) GenerateConfigTree()
func (*Network) GenerateConfigTxConfig ¶
func (n *Network) GenerateConfigTxConfig()
func (*Network) GenerateCoreConfig ¶
func (*Network) GenerateCryptoConfig ¶
func (n *Network) GenerateCryptoConfig()
func (*Network) GenerateOrdererConfig ¶
func (*Network) GenerateResolverMap ¶
func (n *Network) GenerateResolverMap()
func (*Network) IdemixOrgMSPDir ¶
func (n *Network) IdemixOrgMSPDir(org *topology.Organization) string
func (*Network) IdemixOrgs ¶
func (n *Network) IdemixOrgs() []*topology.Organization
IdemixOrgs returns all Organizations of type idemix.
func (*Network) IdemixUserMSPDir ¶
func (n *Network) IdemixUserMSPDir(o *topology.Organization, user string) string
IdemixUserMSPDir returns the path to the MSP directory containing the idemix-related crypto material for the specified user of the organization.
func (*Network) JoinChannel ¶
JoinChannel will join peers to the specified channel. The orderer is used to obtain the current configuration block for the channel.
The orderer and listed peers must be running before this is called.
func (*Network) ListTLSCACertificates ¶
ListTLSCACertificates returns the paths of all TLS CA certificates in the network, across all organizations.
func (*Network) OrdererAddress ¶
OrdererAddress returns the address (host and port) exposed by the Orderer for the named port. Commands line tools should use the returned address when connecting to the orderer.
This assumes that the orderer is listening on 0.0.0.0 or 127.0.0.1 and is available on the loopback address.
func (*Network) OrdererAdminSession ¶
func (n *Network) OrdererAdminSession(o *topology.Orderer, p *topology.Peer, command common.Command) (*gexec.Session, error)
OrdererAdminSession starts a gexec.Session as an orderer admin user. This is used primarily to generate orderer configuration updates.
func (*Network) OrdererBootstrapFile ¶
func (*Network) OrdererConfigPath ¶
OrdererConfigPath returns the path to the orderer configuration document for the specified Orderer.
func (*Network) OrdererDir ¶
OrdererDir returns the path to the configuration directory for the specified Orderer.
func (*Network) OrdererGroupRunner ¶
OrdererGroupRunner returns a runner that can be used to start and stop all orderers in a network.
func (*Network) OrdererHost ¶ added in v0.3.0
OrdererHost returns the hostname of the Orderer instance.
func (*Network) OrdererLocalCryptoDir ¶
OrdererLocalCryptoDir returns the path to the local crypto directory for the Orderer.
func (*Network) OrdererLocalMSPDir ¶
OrdererLocalMSPDir returns the path to the local MSP directory for the Orderer.
func (*Network) OrdererLocalTLSDir ¶
OrdererLocalTLSDir returns the path to the local TLS directory for the Orderer.
func (*Network) OrdererLogsFolder ¶
func (*Network) OrdererOrgMSPDir ¶
func (n *Network) OrdererOrgMSPDir(o *topology.Organization) string
OrdererOrgMSPDir returns the path to the MSP directory of the Orderer organization.
func (*Network) OrdererOrgs ¶
func (n *Network) OrdererOrgs() []*topology.Organization
OrdererOrgs returns all Organization instances that own at least one orderer.
func (*Network) OrdererPort ¶
OrdererPort returns the named port reserved for the Orderer instance.
func (*Network) OrdererRunner ¶
OrdererRunner returns an ifrit.Runner for the specified orderer. The runner can be used to start and manage an orderer process.
func (*Network) OrdererUserCert ¶
OrdererUserCert returns the path to the certificate for the specified user in the orderer organization.
func (*Network) OrdererUserKey ¶
OrdererUserKey returns the path to the private key for the specified user in the orderer organization.
func (*Network) OrdererUserMSPDir ¶
OrdererUserMSPDir returns the path to the MSP directory containing the certificates and keys for the specified user of the peer.
func (*Network) OrderersInOrg ¶
OrderersInOrg returns all Orderer instances owned by the named organaiztion.
func (*Network) OrgOrdererCACertificatePath ¶ added in v0.3.0
func (n *Network) OrgOrdererCACertificatePath(org *topology.Organization) string
func (*Network) OrgOrdererTLSCACertificatePath ¶ added in v0.3.0
func (n *Network) OrgOrdererTLSCACertificatePath(org *topology.Organization) string
func (*Network) OrgPeerCACertificatePath ¶
func (n *Network) OrgPeerCACertificatePath(org *topology.Organization) string
func (*Network) Organization ¶
func (n *Network) Organization(orgName string) *topology.Organization
Organization returns the information about the named Organization.
func (*Network) OrgsForOrderers ¶
func (n *Network) OrgsForOrderers(ordererNames []string) []*topology.Organization
OrgsForOrderers returns all Organization instances that own at least one of the named orderers.
func (*Network) OutputBlockPath ¶
OutputBlockPath returns the path to the genesis block for the named system channel.
func (*Network) PeerAddress ¶
PeerAddress returns the address (host and port) exposed by the Peer for the named port. Commands line tools should use the returned address when connecting to a peer.
This assumes that the peer is listening on 0.0.0.0 and is available on the loopback address.
func (*Network) PeerAddressByName ¶
func (*Network) PeerAdminSession ¶
func (n *Network) PeerAdminSession(p *topology.Peer, command common.Command) (*gexec.Session, error)
PeerAdminSession starts a gexec.Session as a peer admin for the provided peer command. This is intended to be used by short running peer fsccli commands that execute in the context of a peer configuration.
func (*Network) PeerConfigPath ¶
PeerConfigPath returns the path to the peer configuration document for the specified peer.
func (*Network) PeerDir ¶
PeerDir returns the path to the configuration directory for the specified Peer.
func (*Network) PeerGroupRunner ¶
PeerGroupRunner returns a runner that can be used to start and stop all peers in a network.
func (*Network) PeerLedgerDir ¶
PeerLedgerDir returns the rwset root directory for the specified peer.
func (*Network) PeerLocalExtraIdentityDir ¶
func (*Network) PeerLocalIdemixExtraIdentitiesDir ¶
func (*Network) PeerLocalMSPDir ¶
PeerLocalMSPDir returns the path to the local MSP directory for the peer.
func (*Network) PeerLocalMSPIdentityCert ¶
func (*Network) PeerLocalTLSDir ¶
PeerLocalTLSDir returns the path to the local TLS directory for the peer.
func (*Network) PeerLogsFolder ¶
func (*Network) PeerOrgMSPDir ¶
func (n *Network) PeerOrgMSPDir(org *topology.Organization) string
PeerOrgMSPDir returns the path to the MSP directory of the Peer organization.
func (*Network) PeerOrgs ¶
func (n *Network) PeerOrgs() []*topology.Organization
PeerOrgs returns all Organizations associated with at least one Peer.
func (*Network) PeerOrgsByPeers ¶
func (n *Network) PeerOrgsByPeers(peers []*topology.Peer) []*topology.Organization
func (*Network) PeerPortByName ¶
func (*Network) PeerRunner ¶
PeerRunner returns an ifrit.Runner for the specified peer. The runner can be used to start and manage a peer process.
func (*Network) PeerUserCert ¶
PeerUserCert returns the path to the certificate for the specified user in the peer organization.
func (*Network) PeerUserKey ¶
PeerUserKey returns the path to the private key for the specified user in the peer organization.
func (*Network) PeerUserLocalMSP ¶
func (*Network) PeerUserLocalMSPIdentityCert ¶
func (*Network) PeerUserMSPDir ¶
PeerUserMSPDir returns the path to the MSP directory containing the certificates and keys for the specified user of the peer.
func (*Network) PeerUserSession ¶
func (n *Network) PeerUserSession(p *topology.Peer, user string, command common.Command) (*gexec.Session, error)
PeerUserSession starts a gexec.Session as a peer user for the provided peer command. This is intended to be used by short running peer fsccli commands that execute in the context of a peer configuration.
func (*Network) PeerUserTLSDir ¶
PeerUserTLSDir returns the path to the TLS directory containing the certificates and keys for the specified user of the peer.
func (*Network) PeersForChaincodeByName ¶ added in v0.3.0
func (*Network) PeersInOrg ¶
PeersInOrg returns all Peer instances that are owned by the named organization.
func (*Network) PeersInOrgWithOptions ¶
func (*Network) PeersWithChannel ¶
PeersWithChannel returns all Peer instances that have joined the named channel.
func (*Network) ProfileForChannel ¶
ProfileForChannel gets the configtxgen profile name associated with the specified channel.
func (*Network) ReadConfigTxConfig ¶
func (n *Network) ReadConfigTxConfig() *fabricconfig.ConfigTx
ReadConfigTxConfig unmarshals the configtx.yaml and returns an object approximating its contents.
func (*Network) ReadOrdererConfig ¶
func (n *Network) ReadOrdererConfig(o *topology.Orderer) *fabricconfig.Orderer
ReadOrdererConfig unmarshals an orderer's orderer.yaml and returns an object approximating its contents.
func (*Network) ReadPeerConfig ¶
func (n *Network) ReadPeerConfig(p *topology.Peer) *fabricconfig.Core
ReadPeerConfig unmarshals a peer's core.yaml and returns an object approximating its contents.
func (*Network) ResolverMapPath ¶
ResolverMapPath returns the path to the generated resolver map configuration file.
func (*Network) StartSession ¶
StartSession executes a command session. This should be used to launch command line tools that are expected to run to completion.
func (*Network) UpdateChaincode ¶
func (n *Network) UpdateChaincode(chaincodeId string, version string, path string, packageFile string)
UpdateChaincode deploys the new version of the chaincode passed by chaincodeId
func (*Network) UpdateChannelAnchors ¶
UpdateChannelAnchors determines the anchor peers for the specified channel, creates an anchor peer update transaction for each organization, and submits the update transactions to the orderer.
func (*Network) VerifyMembership ¶
func (n *Network) VerifyMembership(expectedPeers []*topology.Peer, channel string, chaincodes ...string)
VerifyMembership checks that each peer has discovered the expected peers in the network
func (*Network) ViewNodeLocalCertPath ¶
func (*Network) ViewNodeLocalPrivateKeyPath ¶
func (*Network) WriteConfigTxConfig ¶
func (n *Network) WriteConfigTxConfig(config *fabricconfig.ConfigTx)
WriteConfigTxConfig serializes the provided configuration to configtx.yaml.
func (*Network) WriteOrdererConfig ¶
func (n *Network) WriteOrdererConfig(o *topology.Orderer, config *fabricconfig.Orderer)
WriteOrdererConfig serializes the provided configuration as the specified orderer's orderer.yaml document.
func (*Network) WritePeerConfig ¶
func (n *Network) WritePeerConfig(p *topology.Peer, config *fabricconfig.Core)
WritePeerConfig serializes the provided configuration as the specified peer's core.yaml document.