cmn

package
v0.0.0-...-0412b85 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2024 License: MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ChannelAcl        = "acl"
	ChannelCC         = "cc"
	ChannelFiat       = "fiat"
	ChannelIndustrial = "industrial"
)
View Source
const (
	HttpPort nwo.PortName = "HttpPort"
	GrpcPort nwo.PortName = "GrpcPort"
)

Variables

This section is empty.

Functions

func AclModulePath

func AclModulePath() string

func CcModulePath

func CcModulePath() string

func ChannelTransferModulePath

func ChannelTransferModulePath() string

func ChannelTransferPortNames

func ChannelTransferPortNames() []nwo.PortName

ChannelTransferPortNames returns the list of ports that need to be reserved for the Channel Transfer service

func CtorFromSlice

func CtorFromSlice(s []string) string

func DeployACL

func DeployACL(
	network *nwo.Network,
	components *nwo.Components,
	peer *nwo.Peer,
	testDir string,
	skiBackend string,
	publicKeyBase58 string,
	validatorKeyType string,
)

func DeployCC

func DeployCC(network *nwo.Network, components *nwo.Components, peer *nwo.Peer,
	testDir string, skiRobot string, addressBase58Check string)

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 of the peers. It uses the _lifecycle implementation. NOTE V2_0 capabilities must be enabled for this functionality to work.

func DeployChaincodeFoundation

func DeployChaincodeFoundation(
	network *nwo.Network,
	channel string,
	components *nwo.Components,
	path string,
	ctor string,
	testDir string,
)

func DeployFiat

func DeployFiat(network *nwo.Network, components *nwo.Components, peer *nwo.Peer,
	testDir string, skiRobot string, adminAddressBase58Check string,
	feeSetterAddressBase58Check string, feeAddressSetterAddressBase58Check string)

func DeployIndustrial

func DeployIndustrial(network *nwo.Network, components *nwo.Components, peer *nwo.Peer,
	testDir string, skiRobot string, adminAddressBase58Check string,
	feeSetterAddressBase58Check string, feeAddressSetterAddressBase58Check string)

func FiatModulePath

func FiatModulePath() string

func IndustrialModulePath

func IndustrialModulePath() string

func InitChaincode

func InitChaincode(n *nwo.Network, channel string, orderer *nwo.Orderer, chaincode nwo.Chaincode, peers ...*nwo.Peer)

func ReadSKI

func ReadSKI(pathToPrivateKey string) (string, error)

func RobotModulePath

func RobotModulePath() string

func RobotPortNames

func RobotPortNames() []nwo.PortName

RobotPortNames returns the list of ports that need to be reserved for a robot.

Types

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        []string
	// contains filtered or unexported fields
}

NetworkFoundation holds information about a fabric network.

func New

func New(network *nwo.Network, channels []string) *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 Robot

type Robot struct {
	Ports          nwo.Ports `yaml:"ports,omitempty"`
	RedisAddresses []string  `yaml:"redis_addresses,omitempty"`
}

Robot structure defines Robot service

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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