Documentation
¶
Overview ¶
Package resource provides access to fabric network resource management, typically using system channel queries.
Package resource provides access to fabric network resource management, typically using system channel queries.
Index ¶
- func CreateAnchorPeersUpdate(conf *genesisconfig.Profile, channelID string, asOrg string) (*common.Envelope, error)
- func CreateChaincodeInstallProposal(txh fab.TransactionHeader, request ChaincodeInstallRequest) (*fab.TransactionProposal, error)
- func CreateChannel(reqCtx reqContext.Context, request CreateChannelRequest, opts ...Opt) (fab.TransactionID, error)
- func CreateChannelCreateTx(conf, baseProfile *genesisconfig.Profile, channelID string) ([]byte, error)
- func CreateConfigEnvelope(data []byte) (*common.ConfigEnvelope, error)
- func CreateConfigSignature(ctx context.Client, config []byte) (*common.ConfigSignature, error)
- func CreateConfigUpdateEnvelope(data []byte) (*common.ConfigUpdateEnvelope, error)
- func CreateGenesisBlock(config *genesisconfig.Profile, channelID string) ([]byte, error)
- func CreateGenesisBlockForOrderer(config *genesisconfig.Profile, channelID string) ([]byte, error)
- func ExtractChannelConfig(configEnvelope []byte) ([]byte, error)
- func ExtractConfigFromBlock(block *common.Block) (*common.Config, error)
- func GenerateMspDir(mspDir string, config *msp.MSPConfig) error
- func GenesisBlockFromOrderer(reqCtx reqContext.Context, channelName string, orderer fab.Orderer, ...) (*common.Block, error)
- func GetLastConfigFromBlock(block *common.Block) (*common.LastConfig, error)
- func InspectBlock(data []byte) (string, error)
- func InspectChannelCreateTx(data []byte) (string, error)
- func InstallChaincode(reqCtx reqContext.Context, req InstallChaincodeRequest, ...) ([]*fab.TransactionProposalResponse, fab.TransactionID, error)
- func JoinChannel(reqCtx reqContext.Context, request JoinChannelRequest, ...) error
- func LastConfigFromOrderer(reqCtx reqContext.Context, channelName string, orderer fab.Orderer, ...) (*common.Block, error)
- func QueryChannels(reqCtx reqContext.Context, peer fab.ProposalProcessor, opts ...Opt) (*pb.ChannelQueryResponse, error)
- func QueryInstalledChaincodes(reqCtx reqContext.Context, peer fab.ProposalProcessor, opts ...Opt) (*pb.ChaincodeQueryResponse, error)
- func SignChannelConfig(ctx context.Client, config []byte, signer msp.SigningIdentity) (*common.ConfigSignature, error)
- type CCPackage
- type ChaincodeInstallRequest
- type ChaincodePackage
- type ConfigSignatureData
- type CreateChannelRequest
- type InstallChaincodeRequest
- type JoinChannelRequest
- type Opt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateAnchorPeersUpdate ¶
func CreateAnchorPeersUpdate(conf *genesisconfig.Profile, channelID string, asOrg string) (*common.Envelope, error)
CreateAnchorPeersUpdate creates an anchor peers update transaction
func CreateChaincodeInstallProposal ¶
func CreateChaincodeInstallProposal(txh fab.TransactionHeader, request ChaincodeInstallRequest) (*fab.TransactionProposal, error)
CreateChaincodeInstallProposal creates an install chaincode proposal.
func CreateChannel ¶
func CreateChannel(reqCtx reqContext.Context, request CreateChannelRequest, opts ...Opt) (fab.TransactionID, error)
CreateChannel calls the orderer to start building the new channel.
func CreateChannelCreateTx ¶
func CreateChannelCreateTx(conf, baseProfile *genesisconfig.Profile, channelID string) ([]byte, error)
CreateChannelCreateTx creates a Fabric transaction for creating a channel
func CreateConfigEnvelope ¶
func CreateConfigEnvelope(data []byte) (*common.ConfigEnvelope, error)
CreateConfigEnvelope creates configuration envelope proto
func CreateConfigSignature ¶
CreateConfigSignature creates a ConfigSignature for the current context
func CreateConfigUpdateEnvelope ¶
func CreateConfigUpdateEnvelope(data []byte) (*common.ConfigUpdateEnvelope, error)
CreateConfigUpdateEnvelope creates configuration update envelope proto
func CreateGenesisBlock ¶
func CreateGenesisBlock(config *genesisconfig.Profile, channelID string) ([]byte, error)
CreateGenesisBlock creates a genesis block for a channel
func CreateGenesisBlockForOrderer ¶
func CreateGenesisBlockForOrderer(config *genesisconfig.Profile, channelID string) ([]byte, error)
CreateGenesisBlockForOrderer creates a genesis block for a channel
func ExtractChannelConfig ¶
ExtractChannelConfig extracts the protobuf 'ConfigUpdate' object out of the 'ConfigEnvelope'.
func ExtractConfigFromBlock ¶
ExtractConfigFromBlock extracts channel configuration from block
func GenerateMspDir ¶
GenerateMspDir generates a MSP directory, using values from the provided MSP config. The intended usage is within the scope of creating a genesis block. This means private keys are currently not handled.
func GenesisBlockFromOrderer ¶
func GenesisBlockFromOrderer(reqCtx reqContext.Context, channelName string, orderer fab.Orderer, opts ...Opt) (*common.Block, error)
GenesisBlockFromOrderer returns the genesis block from the defined orderer that may be used in a join request
func GetLastConfigFromBlock ¶
func GetLastConfigFromBlock(block *common.Block) (*common.LastConfig, error)
GetLastConfigFromBlock returns the LastConfig data from the given block
func InspectChannelCreateTx ¶
InspectChannelCreateTx inspects a Fabric transaction for creating a channel
func InstallChaincode ¶
func InstallChaincode(reqCtx reqContext.Context, req InstallChaincodeRequest, targets []fab.ProposalProcessor, opts ...Opt) ([]*fab.TransactionProposalResponse, fab.TransactionID, error)
InstallChaincode sends an install proposal to one or more endorsing peers.
func JoinChannel ¶
func JoinChannel(reqCtx reqContext.Context, request JoinChannelRequest, targets []fab.ProposalProcessor, opts ...Opt) error
JoinChannel sends a join channel proposal to the target peer.
TODO extract targets from request into parameter.
func LastConfigFromOrderer ¶
func LastConfigFromOrderer(reqCtx reqContext.Context, channelName string, orderer fab.Orderer, opts ...Opt) (*common.Block, error)
LastConfigFromOrderer fetches the current configuration block for the specified channel from the given orderer
func QueryChannels ¶
func QueryChannels(reqCtx reqContext.Context, peer fab.ProposalProcessor, opts ...Opt) (*pb.ChannelQueryResponse, error)
QueryChannels queries the names of all the channels that a peer has joined.
func QueryInstalledChaincodes ¶
func QueryInstalledChaincodes(reqCtx reqContext.Context, peer fab.ProposalProcessor, opts ...Opt) (*pb.ChaincodeQueryResponse, error)
QueryInstalledChaincodes queries the installed chaincodes on a peer. Returns the details of all chaincodes installed on a peer.
func SignChannelConfig ¶
func SignChannelConfig(ctx context.Client, config []byte, signer msp.SigningIdentity) (*common.ConfigSignature, error)
SignChannelConfig signs a configuration.
Types ¶
type CCPackage ¶
type CCPackage struct {
Type pb.ChaincodeSpec_Type
Code []byte
}
CCPackage contains package type and bytes required to create CDS
type ChaincodeInstallRequest ¶
type ChaincodeInstallRequest struct {
Name string
Path string
Version string
Package *ChaincodePackage
}
ChaincodeInstallRequest requests chaincode installation on the network
type ChaincodePackage ¶
type ChaincodePackage struct {
Type pb.ChaincodeSpec_Type
Code []byte
}
ChaincodePackage contains package type and bytes required to create CDS
type ConfigSignatureData ¶
type ConfigSignatureData struct {
SignatureHeader common.SignatureHeader
SignatureHeaderBytes []byte
SigningBytes []byte
}
ConfigSignatureData holds data ready to be signed (SigningBytes) + Signature Header
When building the common.ConfigSignature instance with the signed SigningBytes from the external tool, assign the returned ConfigSignatureData.SignatureHeader as part of the new ConfigSignature instance.
func GetConfigSignatureData ¶
func GetConfigSignatureData(creator identitySerializer, config []byte) (signatureHeaderData ConfigSignatureData, e error)
GetConfigSignatureData will prepare a ConfigSignatureData comprising: SignatureHeader, its marshaled []byte and the full signing []byte to be used for signing (by an external tool) a Channel Config
type CreateChannelRequest ¶
type CreateChannelRequest struct {
// required - The name of the new channel
Name string
// required - The Orderer to send the update request
Orderer fab.Orderer
// optional - the envelope object containing all
// required settings and signatures to initialize this channel.
// This envelope would have been created by the command
// line tool "configtx"
Envelope []byte
// optional - ConfigUpdate object built by the
// buildChannelConfig() method of this package
Config []byte
// optional - the list of collected signatures
// required by the channel create policy when using the `apiconfig` parameter.
// see signChannelConfig() method of this package
Signatures []*common.ConfigSignature
}
CreateChannelRequest requests channel creation on the network
type InstallChaincodeRequest ¶
type InstallChaincodeRequest struct {
// required - name of the chaincode
Name string
// required - path to the location of chaincode sources (path from GOPATH/src folder)
Path string
// chaincodeVersion: required - version of the chaincode
Version string
// required - package (chaincode package type and bytes)
Package *CCPackage
}
InstallChaincodeRequest requests chaincode installation on the network
type JoinChannelRequest ¶
type JoinChannelRequest struct {
// The name of the channel to be joined.
Name string
GenesisBlock *common.Block
}
JoinChannelRequest allows a set of peers to transact on a channel on the network