fabric-sdk-go: github.com/hyperledger/fabric-sdk-go/pkg/fab/resource Index | Files | Directories

package resource

import "github.com/hyperledger/fabric-sdk-go/pkg/fab/resource"

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.


Package Files

api.go block.go config.go configtx.go configtxmsp.go cscc.go lscc.go resource.go

func CreateAnchorPeersUpdate Uses

func CreateAnchorPeersUpdate(conf *genesisconfig.Profile, channelID string, asOrg string) (*common.Envelope, error)

CreateAnchorPeersUpdate creates an anchor peers update transaction

func CreateChaincodeInstallProposal Uses

func CreateChaincodeInstallProposal(txh fab.TransactionHeader, request ChaincodeInstallRequest) (*fab.TransactionProposal, error)

CreateChaincodeInstallProposal creates an install chaincode proposal.

func CreateChannel Uses

func CreateChannel(reqCtx reqContext.Context, request CreateChannelRequest, opts ...Opt) (fab.TransactionID, error)

CreateChannel calls the orderer to start building the new channel.

func CreateChannelCreateTx Uses

func CreateChannelCreateTx(conf, baseProfile *genesisconfig.Profile, channelID string) ([]byte, error)

CreateChannelCreateTx creates a Fabric transaction for creating a channel

func CreateConfigEnvelope Uses

func CreateConfigEnvelope(data []byte) (*common.ConfigEnvelope, error)

CreateConfigEnvelope creates configuration envelope proto

func CreateConfigSignature Uses

func CreateConfigSignature(ctx context.Client, config []byte) (*common.ConfigSignature, error)

CreateConfigSignature creates a ConfigSignature for the current context

func CreateConfigUpdateEnvelope Uses

func CreateConfigUpdateEnvelope(data []byte) (*common.ConfigUpdateEnvelope, error)

CreateConfigUpdateEnvelope creates configuration update envelope proto

func CreateGenesisBlock Uses

func CreateGenesisBlock(config *genesisconfig.Profile, channelID string) ([]byte, error)

CreateGenesisBlock creates a genesis block for a channel

func CreateGenesisBlockForOrderer Uses

func CreateGenesisBlockForOrderer(config *genesisconfig.Profile, channelID string) ([]byte, error)

CreateGenesisBlockForOrderer creates a genesis block for a channel

func ExtractChannelConfig Uses

func ExtractChannelConfig(configEnvelope []byte) ([]byte, error)

ExtractChannelConfig extracts the protobuf 'ConfigUpdate' object out of the 'ConfigEnvelope'.

func ExtractConfigFromBlock Uses

func ExtractConfigFromBlock(block *common.Block) (*common.Config, error)

ExtractConfigFromBlock extracts channel configuration from block

func GenerateMspDir Uses

func GenerateMspDir(mspDir string, config *msp.MSPConfig) error

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 Uses

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 Uses

func GetLastConfigFromBlock(block *common.Block) (*common.LastConfig, error)

GetLastConfigFromBlock returns the LastConfig data from the given block

func InspectBlock Uses

func InspectBlock(data []byte) (string, error)

InspectBlock inspects a block

func InspectChannelCreateTx Uses

func InspectChannelCreateTx(data []byte) (string, error)

InspectChannelCreateTx inspects a Fabric transaction for creating a channel

func InstallChaincode Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

func SignChannelConfig(ctx context.Client, config []byte, signer msp.SigningIdentity) (*common.ConfigSignature, error)

SignChannelConfig signs a configuration.

type CCPackage Uses

type CCPackage struct {
    Type pb.ChaincodeSpec_Type
    Code []byte

CCPackage contains package type and bytes required to create CDS

type ChaincodeInstallRequest Uses

type ChaincodeInstallRequest struct {
    Name    string
    Path    string
    Version string
    Package *ChaincodePackage

ChaincodeInstallRequest requests chaincode installation on the network

type ChaincodePackage Uses

type ChaincodePackage struct {
    Type pb.ChaincodeSpec_Type
    Code []byte

ChaincodePackage contains package type and bytes required to create CDS

type ConfigSignatureData Uses

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 Uses

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 Uses

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 Uses

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 Uses

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

type Opt Uses

type Opt func(opts *options)

Opt is a resource option

func WithRetry Uses

func WithRetry(retry retry.Opts) Opt

WithRetry supplies retry options



Package resource imports 35 packages (graph) and is imported by 6 packages. Updated 2019-12-16. Refresh now. Tools for package owners.