ccpackager

package
v1.0.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2022 License: Apache-2.0, MIT Imports: 13 Imported by: 0

Documentation

Overview

Package ccpackager provides functionality to package a FPC chaincode.

Example:

desc := &ccpackager.Descriptor{
	Path:    "/my_fpc_chaincode/build/_lib",
	Type:    ccpackager.ChaincodeType,
	Label:   "my-fpc-chaincode-v1",
	SGXMode: "SIM",
}
ccPkg, err := ccpackager.NewCCPackage(desc)
if err != nil {
	log.Fatal(err)
}

Index

Constants

View Source
const (
	ChaincodeType = "fpc-c"
	CaaSType      = "external"
)

Variables

This section is empty.

Functions

func NewCCPackage

func NewCCPackage(desc *Descriptor) ([]byte, error)

NewCCPackage creates a FPC chaincode package.

func ReadMrenclave

func ReadMrenclave(ccPath string) (string, error)

ReadMrenclave returns mrenclave for the given FPC chaincode at ccPath

Types

type Descriptor

type Descriptor struct {
	// Type defines the FPC package type. Supported types are fpc.ChaincodeType or fpc.CaaSType.
	Type string
	// Label defines a succinct and human readable description of the package.
	Label string
	// Path defines the location of FPC enclave artifacts.
	Path string
	// SGXMode defines SGX runtime mode. Supported types are SIM and HW.
	SGXMode string
	// CaaSEndpoint defines the FPC Chaincode address if running as CaaS.
	CaaSEndpoint string
	// CaaSTimeout defines the connection timeout. Default value is 10s.
	CaaSTimeout string
	// CaaSUseTLS defines the use of TLS connection.
	CaaSUseTLS bool
}

Descriptor holds the package data. FPC supports two types of packages, ChaincodeType and CaaSType. For normal chaincode deployments, the package type ChaincodeType is used. It requires to define Type, Label, Path, and SGXMode. Alternatively, for deployments as Chaincode as a Service (CaaS), the package type CaaSType is used. It requires to define Type, Label, Path, and CaaSEndpoint. Optionally, CaaSTimeout and CaaSUseTLS can be set.

Jump to

Keyboard shortcuts

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