Documentation
¶
Index ¶
- Constants
- Variables
- func ACLModulePath() string
- func CcModulePath() string
- func ChannelTransferModulePath() string
- func ChannelTransferPortNames() []nwo.PortName
- func CtorFromSlice(s []string) string
- func DeployACL(network *nwo.Network, components *nwo.Components, peer *nwo.Peer, ...)
- func DeployCC(network *nwo.Network, components *nwo.Components, peer *nwo.Peer, ...)
- func DeployChaincode(n *nwo.Network, channel string, orderer *nwo.Orderer, chaincode nwo.Chaincode, ...)
- func DeployChaincodeFoundation(network *nwo.Network, channel string, components *nwo.Components, path string, ...)
- func DeployFiat(network *nwo.Network, components *nwo.Components, peer *nwo.Peer, ...)
- func DeployIndustrial(network *nwo.Network, components *nwo.Components, peer *nwo.Peer, ...)
- func FiatModulePath() string
- func IndustrialModulePath() string
- func InitChaincode(n *nwo.Network, channel string, orderer *nwo.Orderer, chaincode nwo.Chaincode, ...)
- func ReadSKI(pathToPrivateKey string) (string, error)
- func RobotModulePath() string
- func RobotPortNames() []nwo.PortName
- type Channel
- type ChannelTransfer
- type NetworkFoundation
- func (n *NetworkFoundation) ChannelTransferAccessToken() string
- func (n *NetworkFoundation) ChannelTransferGRPCAddress() string
- func (n *NetworkFoundation) ChannelTransferHTTPAddress() string
- func (n *NetworkFoundation) ChannelTransferHostAddress() string
- func (n *NetworkFoundation) ChannelTransferPath() string
- func (n *NetworkFoundation) ChannelTransferPort(portName nwo.PortName) string
- func (n *NetworkFoundation) ChannelTransferRunner(env ...string) *ginkgomon.Runner
- func (n *NetworkFoundation) ChannelTransferTTL() string
- func (n *NetworkFoundation) ConnectionPath(user string) string
- func (n *NetworkFoundation) GenerateChannelTransferConfig(user string)
- func (n *NetworkFoundation) GenerateConfigTree()
- func (n *NetworkFoundation) GenerateConnection(p *nwo.Peer, u string)
- func (n *NetworkFoundation) GenerateRobotConfig(u string)
- func (n *NetworkFoundation) OrdererTLSCACert(o *nwo.Orderer) string
- func (n *NetworkFoundation) PeerTLSCACert(p *nwo.Peer) string
- func (n *NetworkFoundation) PeerUserKeyFound(p *nwo.Peer, user string) string
- func (n *NetworkFoundation) RobotPath() string
- func (n *NetworkFoundation) RobotPort(portName nwo.PortName) uint16
- func (n *NetworkFoundation) RobotRunner(env ...string) *ginkgomon.Runner
- type NetworkFoundationOption
- type Robot
- type TaskExecutor
- type TemplatesFound
Constants ¶
const ( ChannelACL = "acl" ChannelCC = "cc" ChannelFiat = "fiat" ChannelIndustrial = "industrial" )
const ( HTTPPort nwo.PortName = "HttpPort" GrpcPort nwo.PortName = "GrpcPort" )
Variables ¶
var ( RobotCfgDefault = &Robot{Ports: nwo.Ports{}} ChannelTransferCfgDefault = &ChannelTransfer{ HostAddress: "localhost", AccessToken: "test", Ports: nwo.Ports{}, TTL: "10800s", } )
Functions ¶
func ACLModulePath ¶
func ACLModulePath() string
func CcModulePath ¶
func CcModulePath() string
func ChannelTransferModulePath ¶
func ChannelTransferModulePath() string
func ChannelTransferPortNames ¶
ChannelTransferPortNames returns the list of ports that need to be reserved for the Channel Transfer service
func CtorFromSlice ¶
func DeployChaincode ¶
func DeployChaincode(n *nwo.Network, channel string, orderer *nwo.Orderer, chaincode nwo.Chaincode, peers ...*nwo.Peer)
DeployChaincode is a helper that will install chaincode to all peers that are connected to the specified channel, approve the chaincode on one of the peers of each organization in the network, commit the chaincode definition on the channel using one of the peers, and wait for the chaincode commit to complete on all the peers. It uses the _lifecycle implementation. NOTE V2_0 capabilities must be enabled for this functionality to work.
func DeployFiat ¶
func DeployIndustrial ¶
func FiatModulePath ¶
func FiatModulePath() string
func IndustrialModulePath ¶
func IndustrialModulePath() string
func InitChaincode ¶
func RobotModulePath ¶
func RobotModulePath() string
func RobotPortNames ¶
RobotPortNames returns the list of ports that need to be reserved for a robot.
Types ¶
type Channel ¶
type Channel struct { Name string `yaml:"name"` TaskExecutor *TaskExecutor `yaml:"task_executor,omitempty"` }
Channel defines a configuration of an HLF channel
func ChannelsFromNames ¶
func (*Channel) HasTaskExecutor ¶
func (*Channel) TaskExecutorGRPCAddress ¶
TaskExecutorGRPCAddress returns external task executor GRPC host & port as a string
type ChannelTransfer ¶
type ChannelTransfer struct { HostAddress string `yaml:"host_address,omitempty"` Ports nwo.Ports `yaml:"ports,omitempty"` RedisAddresses []string `yaml:"redis_addresses,omitempty"` AccessToken string `yaml:"access_token,omitempty"` TTL string `yaml:"ttl,omitempty"` }
ChannelTransfer defines Channel Transfer service
type NetworkFoundation ¶
type NetworkFoundation struct { *nwo.Network Robot *Robot ChannelTransfer *ChannelTransfer Templates *TemplatesFound Channels []*Channel LogLevelSDK string // contains filtered or unexported fields }
NetworkFoundation holds information about a fabric network.
func New ¶
func New(network *nwo.Network, channels []*Channel, opts ...NetworkFoundationOption) *NetworkFoundation
func (*NetworkFoundation) ChannelTransferAccessToken ¶
func (n *NetworkFoundation) ChannelTransferAccessToken() string
ChannelTransferAccessToken returns Channel Transfer access token
func (*NetworkFoundation) ChannelTransferGRPCAddress ¶
func (n *NetworkFoundation) ChannelTransferGRPCAddress() string
ChannelTransferGRPCAddress returns channel transfer GRPC host & port as a string
func (*NetworkFoundation) ChannelTransferHTTPAddress ¶
func (n *NetworkFoundation) ChannelTransferHTTPAddress() string
ChannelTransferHTTPAddress returns channel transfer HTTP host & port as a string
func (*NetworkFoundation) ChannelTransferHostAddress ¶
func (n *NetworkFoundation) ChannelTransferHostAddress() string
ChannelTransferHostAddress returns channel transfer host & port as a string
func (*NetworkFoundation) ChannelTransferPath ¶
func (n *NetworkFoundation) ChannelTransferPath() string
ChannelTransferPath returns the path to the generated connection profile
func (*NetworkFoundation) ChannelTransferPort ¶
func (n *NetworkFoundation) ChannelTransferPort(portName nwo.PortName) string
ChannelTransferPort returns the named port reserved for the Channel Transfer instance
func (*NetworkFoundation) ChannelTransferRunner ¶
func (n *NetworkFoundation) ChannelTransferRunner(env ...string) *ginkgomon.Runner
ChannelTransferRunner returns an ifrit.Runner for the specified channel_transfer service. The runner can be used to start and manage the channel_transfer process.
func (*NetworkFoundation) ChannelTransferTTL ¶
func (n *NetworkFoundation) ChannelTransferTTL() string
ChannelTransferTTL returns Channel Transfer TTL value
func (*NetworkFoundation) ConnectionPath ¶
func (n *NetworkFoundation) ConnectionPath(user string) string
ConnectionPath returns the path to the generated connection profile file.
func (*NetworkFoundation) GenerateChannelTransferConfig ¶
func (n *NetworkFoundation) GenerateChannelTransferConfig(user string)
GenerateChannelTransferConfig creates the `robot.yaml` configuration file provided to config for Channel Transfer service. The path to the generated file can be obtained from ChannelTransferPath.
func (*NetworkFoundation) GenerateConfigTree ¶
func (n *NetworkFoundation) GenerateConfigTree()
func (*NetworkFoundation) GenerateConnection ¶
func (n *NetworkFoundation) GenerateConnection(p *nwo.Peer, u string)
GenerateConnection creates the `connection.yaml` configuration file provided to profile `connection` for client. The path to the generated file can be obtained from ConnectionPath.
func (*NetworkFoundation) GenerateRobotConfig ¶
func (n *NetworkFoundation) GenerateRobotConfig(u string)
GenerateRobotConfig creates the `robot.yaml` configuration file provided to config for robot. The path to the generated file can be obtained from RobotPath.
func (*NetworkFoundation) OrdererTLSCACert ¶
func (n *NetworkFoundation) OrdererTLSCACert(o *nwo.Orderer) string
OrdererTLSCACert returns the path to the local tlsca cert for the Orderer.
func (*NetworkFoundation) PeerTLSCACert ¶
func (n *NetworkFoundation) PeerTLSCACert(p *nwo.Peer) string
PeerTLSCACert returns the path to the local tlsca cert for the peer.
func (*NetworkFoundation) PeerUserKeyFound ¶
func (n *NetworkFoundation) PeerUserKeyFound(p *nwo.Peer, user string) string
PeerUserKeyFound returns the path to the private key for the specified user in the peer organization.
func (*NetworkFoundation) RobotPath ¶
func (n *NetworkFoundation) RobotPath() string
RobotPath returns the path to the generated robot profile file.
func (*NetworkFoundation) RobotPort ¶
func (n *NetworkFoundation) RobotPort(portName nwo.PortName) uint16
RobotPort returns the named port reserved for the Robot instance.
func (*NetworkFoundation) RobotRunner ¶
func (n *NetworkFoundation) RobotRunner(env ...string) *ginkgomon.Runner
RobotRunner returns an ifrit.Runner for the specified robot. The runner can be used to start and manage a robot process.
type NetworkFoundationOption ¶
type NetworkFoundationOption func(nf *NetworkFoundation) error
func WithChannelTransferCfg ¶
func WithChannelTransferCfg(ctCfg *ChannelTransfer) NetworkFoundationOption
func WithChannelTransferTemplate ¶
func WithChannelTransferTemplate(ctTemplate string) NetworkFoundationOption
func WithRobotCfg ¶
func WithRobotCfg(robotCfg *Robot) NetworkFoundationOption
func WithRobotTemplate ¶
func WithRobotTemplate(robotTemplate string) NetworkFoundationOption
type Robot ¶
type Robot struct { Ports nwo.Ports `yaml:"ports,omitempty"` RedisAddresses []string `yaml:"redis_addresses,omitempty"` }
Robot structure defines Robot service
type TaskExecutor ¶
type TaskExecutor struct { HostAddress string `yaml:"host_address,omitempty"` Ports nwo.Ports `yaml:"ports,omitempty"` }
TaskExecutor defines external task executor
type TemplatesFound ¶
type TemplatesFound struct { *nwo.Templates Robot string `yaml:"robot,omitempty"` Connection string `yaml:"connection,omitempty"` ChannelTransfer string `yaml:"channel_transfer,omitempty"` }
TemplatesFound can be used to provide custom templates to GenerateConfigTree.
func (*TemplatesFound) ChannelTransferTemplate ¶
func (t *TemplatesFound) ChannelTransferTemplate() string
func (*TemplatesFound) ConnectionTemplate ¶
func (t *TemplatesFound) ConnectionTemplate() string
func (*TemplatesFound) RobotTemplate ¶
func (t *TemplatesFound) RobotTemplate() string