chaincode

package
v1.0.0-rc3.0...-059df17 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: Apache-2.0, MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Enclave

type Enclave interface {

	// Init initializes the chaincode enclave.
	// The input and output parameters are serialized protobufs
	// triggered by an admin
	Init(chaincodeParams, hostParams, attestationParams []byte) (credentials []byte, err error)

	// GetEnclaveId returns the EnclaveId hosted by the peer
	GetEnclaveId() (string, error)

	// GenerateCCKeys returns a signed CCKeyRegistration Message including
	// The output parameters is a serialized protobuf
	GenerateCCKeys() (signedCCKeyRegistrationMessage []byte, err error)

	// ExportCCKeys exports chaincode secrets to enclave with provided credentials
	// The input and output parameters are serialized protobufs
	ExportCCKeys(credentials []byte) (signedExportMessage []byte, err error)

	// ImportCCKeys imports chaincode secrets
	// The output parameters is a serialized protobuf
	ImportCCKeys() (signedCCKeyRegistrationMessage []byte, err error)

	// ChaincodeInvoke invokes fpc chaincode inside enclave
	// chaincodeRequestMessage and chaincodeResponseMessage are serialized protobuf
	ChaincodeInvoke(stub shim.ChaincodeStubInterface, chaincodeRequestMessage []byte) (chaincodeResponseMessage []byte, err error)
}

type EnclaveChaincode

type EnclaveChaincode struct {
	Enclave   Enclave
	Validator endorsement.Validation
	Extractor Extractors
	Ercc      ercc.Stub
}

EnclaveChaincode struct

func (*EnclaveChaincode) Init

Init sets the chaincode state to "init"

func (*EnclaveChaincode) Invoke

Invoke receives transactions and forwards to op handlers

type ExtractorImpl

type ExtractorImpl struct {
}

func (*ExtractorImpl) GetChaincodeParams

func (s *ExtractorImpl) GetChaincodeParams(stub shim.ChaincodeStubInterface) (*protos.CCParameters, error)

func (*ExtractorImpl) GetHostParams

func (*ExtractorImpl) GetInitEnclaveMessage

func (s *ExtractorImpl) GetInitEnclaveMessage(stub shim.ChaincodeStubInterface) (*protos.InitEnclaveMessage, error)

func (*ExtractorImpl) GetSerializedChaincodeRequest

func (s *ExtractorImpl) GetSerializedChaincodeRequest(stub shim.ChaincodeStubInterface) ([]byte, error)

type Extractors

type Extractors interface {
	GetInitEnclaveMessage(stub shim.ChaincodeStubInterface) (*protos.InitEnclaveMessage, error)
	GetSerializedChaincodeRequest(stub shim.ChaincodeStubInterface) ([]byte, error)
	GetChaincodeResponseMessages(stub shim.ChaincodeStubInterface) (*protos.SignedChaincodeResponseMessage, *protos.ChaincodeResponseMessage, error)
	GetChaincodeParams(stub shim.ChaincodeStubInterface) (*protos.CCParameters, error)
	GetHostParams(stub shim.ChaincodeStubInterface) (*protos.HostParameters, error)
}

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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