Documentation ¶
Overview ¶
Package resmgmt provides FPC specific chaincode management functionality.
For more information on the FPC management commands and related constraints on chaincode versions and endorsement policies, see `$FPC_PATH/docs/design/fabric-v2+/fpc-management.md`
Example:
adminContext := sdk.Context(fabsdk.WithUser(orgAdmin), fabsdk.WithOrg(orgName)) client, err := resmgmt.New(adminContext) if err != nil { log.Fatal(err) } attestationParams, err := sgx.CreateAttestationParamsFromEnvironment() if err != nil { log.Fatal(err) } initReq := resmgmt.LifecycleInitEnclaveRequest{ ChaincodeID: "my-fpc-chaincode", EnclavePeerEndpoint: "mypeer.myorg.example.com", // define the peer where we wanna init our enclave AttestationParams: attestationParams, } initTxId, err := client.LifecycleInitEnclave("mychannel", initReq) if err != nil { log.Fatal(err) }
See also `lifecycle_test.go` and `$FPC_PATH/integration/client_sdk/go/utils/utils.go` for a running example.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChannelClientProvider ¶
type ChannelClientProvider struct {
// contains filtered or unexported fields
}
func NewChannelClientProvider ¶
func NewChannelClientProvider(ctxProvider context.ClientProvider) *ChannelClientProvider
func (*ChannelClientProvider) ChannelClient ¶
func (c *ChannelClientProvider) ChannelClient(id string) (lifecycle.ChannelClient, error)
type Client ¶
Client enables managing resources in Fabric network. It extends resmgmt.Client (https://pkg.go.dev/github.com/hyperledger/fabric-sdk-go/pkg/client/resmgmt#Client) from the standard Fabric Client SDK with additional FPC-specific functionality.
func New ¶
func New(ctxProvider context.ClientProvider, opts ...resmgmt.ClientOption) (*Client, error)
New returns a FPC resource management client instance.
func (*Client) LifecycleInitEnclave ¶
func (rc *Client) LifecycleInitEnclave(channelId string, req LifecycleInitEnclaveRequest, options ...resmgmt.RequestOption) (fab.TransactionID, error)
LifecycleInitEnclave initializes and registers an enclave for a particular FPC chaincode.
type GoSDKChannelClient ¶
type GoSDKChannelClient interface { Query(request channel.Request, options ...channel.RequestOption) (channel.Response, error) Execute(request channel.Request, options ...channel.RequestOption) (channel.Response, error) InvokeHandler(handler invoke.Handler, request channel.Request, options ...channel.RequestOption) (channel.Response, error) RegisterChaincodeEvent(chainCodeID string, eventFilter string) (fab.Registration, <-chan *fab.CCEvent, error) UnregisterChaincodeEvent(registration fab.Registration) }
type LifecycleInitEnclaveRequest ¶
type LifecycleInitEnclaveRequest struct { ChaincodeID string EnclavePeerEndpoint string AttestationParams *sgx.AttestationParams }
LifecycleInitEnclaveRequest contains init enclave request parameters. In particular, it contains the FPC chaincode ID, the endpoint of the target peer to spawn the enclave, and attestation params to perform attestation and enclave registration.