Documentation ¶
Index ¶
- Constants
- func ApplyChaincodeSecrets(ctx context.Context, logger *log.CmdLogger, secretsClient v1.SecretInterface, ...) error
- func CopyImageJSON(logger *log.CmdLogger, src, dest string) error
- func CopyIndexFiles(logger *log.CmdLogger, src, dest string) error
- func CopyMetadataDir(logger *log.CmdLogger, src, dest string) error
- func CreateChaincodePod(ctx context.Context, logger *log.CmdLogger, podsClient v1.PodInterface, ...) (*apiv1.Pod, error)
- func GetKubeClientset(logger *log.CmdLogger, kubeconfigPath string) (*kubernetes.Clientset, error)
- func GetKubeNamespace() (string, error)
- func GetOptionalEnv(key, defaultValue string) string
- func GetRequiredEnv(key string) (string, error)
- func GetValidName(mspID, peerID, chaincodeID string) string
- func WaitForChaincodePod(ctx context.Context, logger *log.CmdLogger, podsClient v1.PodInterface, ...) error
- type ChaincodeJSON
- type ImageJSON
Constants ¶
View Source
const ( ChaincodeNamespaceVariable = builderVariablePrefix + "NAMESPACE" ChaincodeServiceAccountVariable = builderVariablePrefix + "SERVICE_ACCOUNT" DebugVariable = builderVariablePrefix + "DEBUG" KubeconfigPathVariable = "KUBECONFIG_PATH" PeerIDVariable = "CORE_PEER_ID" )
View Source
const ( ChaincodeFile = "chaincode.json" ImageFile = "image.json" MetadataDir = "META-INF" )
View Source
const ( // Mutual TLS auth client key and cert paths in the chaincode container. TLSClientKeyPath string = "/etc/hyperledger/fabric/client.key" TLSClientCertPath string = "/etc/hyperledger/fabric/client.crt" TLSClientKeyFile string = "/etc/hyperledger/fabric/client_pem.key" TLSClientCertFile string = "/etc/hyperledger/fabric/client_pem.crt" TLSClientRootCertFile string = "/etc/hyperledger/fabric/peer.crt" )
Variables ¶
This section is empty.
Functions ¶
func ApplyChaincodeSecrets ¶
func ApplyChaincodeSecrets( ctx context.Context, logger *log.CmdLogger, secretsClient v1.SecretInterface, namespace, peerID string, chaincodeData *ChaincodeJSON, ) error
func CopyImageJSON ¶
CopyImageJSON validates and copies the chaincode image file.
func CopyIndexFiles ¶
CopyIndexFiles copies CouchDB index definitions from source to destination directories.
func CopyMetadataDir ¶
CopyMetadataDir copies all chaincode metadata from source to destination directories.
func CreateChaincodePod ¶
func GetKubeClientset ¶
GetKubeClientset returns a client object for a provided kubeconfig filepath if one is provided, or which uses the service account kubernetes gives to pods otherwise.
func GetKubeNamespace ¶
func GetOptionalEnv ¶
func GetRequiredEnv ¶
func GetValidName ¶ added in v0.10.0
GetValidName returns a valid RFC 1035 label name.
Types ¶
type ChaincodeJSON ¶
type ChaincodeJSON struct { ChaincodeID string `json:"chaincode_id"` PeerAddress string `json:"peer_address"` ClientCert string `json:"client_cert"` ClientKey string `json:"client_key"` RootCert string `json:"root_cert"` MspID string `json:"mspid"` }
ChaincodeJSON represents the chaincode.json file that is supplied by Fabric in the RUN_METADATA_DIR.
func ReadChaincodeJSON ¶
func ReadChaincodeJSON(logger *log.CmdLogger, dir string) (*ChaincodeJSON, error)
ReadChaincodeJSON reads and parses the chaincode.json file in the provided directory.
Click to show internal directories.
Click to hide internal directories.