sdk

package
v0.0.0-...-a76d37d Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2019 License: Apache-2.0 Imports: 41 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Success 请求返回成功码
	Success = "200"
	// Fail 请求返回失败码
	Fail = "9999"
)

Variables

This section is empty.

Functions

func AddAffiliation

func AddAffiliation(orgName string, affReq *msp.AffiliationRequest, configBytes []byte, sdkOpts ...fabsdk.Option) (*msp.AffiliationResponse, error)

func AddGroup

func AddGroup(originalBlock, updateBlock *common.Block, channelID, consortium, groupName string) ([]byte, error)

func CAInfo

func CAInfo(orgName string, configBytes []byte, sdkOpts ...fabsdk.Option) (*msp.GetCAInfoResponse, error)

func Channels

func Channels(orgName, orgUser, peerName string, configBytes []byte, sdkOpts ...fabsdk.Option) ([]*peer.ChannelInfo, error)

func Create

func Create(orderOrgName, orderOrgUser, orderURL, orgName, orgUser, channelID, channelConfigPath string, configBytes []byte,
	sdkOpts ...fabsdk.Option) (txID string, err error)

setupAndRun enables testing an end-to-end scenario against the supplied SDK options the createChannel flag will be used to either create a channel and the example CC or not(ie run the tests with existing ch and CC)

func CreateConfigUpdateBytes

func CreateConfigUpdateBytes(configUpdateEnvBytes []byte, leagueName, channelID string) error

func CreateIdentity

func CreateIdentity(orgName string, req *msp.IdentityRequest, configBytes []byte, sdkOpts ...fabsdk.Option) (*msp.IdentityResponse, error)

func CreateSigningIdentity

func CreateSigningIdentity(orgName string, configBytes []byte, opts []mspctx.SigningIdentityOption, sdkOpts ...fabsdk.Option) (mspctx.SigningIdentity, error)

func DiscoveryChannelPeers

func DiscoveryChannelPeers(channelID, orgName, orgUser string, configBytes []byte, sdkOpts ...fabsdk.Option) ([]fab.Peer, error)

func DiscoveryLocalPeers

func DiscoveryLocalPeers(orgName, orgUser string, configBytes []byte, sdkOpts ...fabsdk.Option) ([]fab.Peer, error)

func Enroll

func Enroll(orgName, enrollmentID string, configBytes []byte, opts []msp.EnrollmentOption, sdkOpts ...fabsdk.Option) error

func GetAffiliation

func GetAffiliation(affiliation, orgName string, configBytes []byte, sdkOpts ...fabsdk.Option) (*msp.AffiliationResponse, error)

func GetAffiliationByCaName

func GetAffiliationByCaName(affiliation, orgName, caName string, configBytes []byte, sdkOpts ...fabsdk.Option) (*msp.AffiliationResponse, error)

func GetAllAffiliations

func GetAllAffiliations(orgName string, configBytes []byte, sdkOpts ...fabsdk.Option) (*msp.AffiliationResponse, error)

func GetAllAffiliationsByCaName

func GetAllAffiliationsByCaName(orgName, caName string, configBytes []byte, sdkOpts ...fabsdk.Option) (*msp.AffiliationResponse, error)

func GetAllIdentities

func GetAllIdentities(orgName string, configBytes []byte, sdkOpts ...fabsdk.Option) ([]*msp.IdentityResponse, error)

func GetAllIdentitiesByCaName

func GetAllIdentitiesByCaName(orgName, caName string, configBytes []byte, sdkOpts ...fabsdk.Option) ([]*msp.IdentityResponse, error)

func GetIdentity

func GetIdentity(id, orgName string, configBytes []byte, sdkOpts ...fabsdk.Option) (*msp.IdentityResponse, error)

func GetIdentityByCaName

func GetIdentityByCaName(id, caName, orgName string, configBytes []byte, sdkOpts ...fabsdk.Option) (*msp.IdentityResponse, error)

func GetSigningIdentity

func GetSigningIdentity(id, orgName string, configBytes []byte, sdkOpts ...fabsdk.Option) (mspctx.SigningIdentity, error)

func Join

func Join(orderURL, orgName, orgUser, channelID, peerName string, configBytes []byte, sdkOpts ...fabsdk.Option) error

func ModifyAffiliation

func ModifyAffiliation(orgName string, affReq *msp.ModifyAffiliationRequest, configBytes []byte, sdkOpts ...fabsdk.Option) (*msp.AffiliationResponse, error)

func ModifyIdentity

func ModifyIdentity(orgName string, req *msp.IdentityRequest, configBytes []byte, sdkOpts ...fabsdk.Option) (*msp.IdentityResponse, error)

func Reenroll

func Reenroll(orgName, enrollmentID string, configBytes []byte, opts []msp.EnrollmentOption, sdkOpts ...fabsdk.Option) error

func Register

func Register(orgName string, registerReq *msp.RegistrationRequest, configBytes []byte, sdkOpts ...fabsdk.Option) (string, error)

func RemoveAffiliation

func RemoveAffiliation(orgName string, affReq *msp.AffiliationRequest, configBytes []byte, sdkOpts ...fabsdk.Option) (*msp.AffiliationResponse, error)

func RemoveIdentity

func RemoveIdentity(orgName string, req *msp.RemoveIdentityRequest, configBytes []byte, sdkOpts ...fabsdk.Option) (*msp.IdentityResponse, error)

func Revoke

func Revoke(orgName string, req *msp.RevocationRequest, configBytes []byte, sdkOpts ...fabsdk.Option) (*msp.RevocationResponse, error)

func Sign

func Sign(configBytes, envelopeBytes []byte, leagueName, orgName, orgUser, channelID string, sdkOpts ...fabsdk.Option) error

func UpdateChannel

func UpdateChannel(resmgmtClient *resmgmt.Client, envelopeBytes []byte, orderURL, channelID string) error

Types

type ChainCodeInfoArr

type ChainCodeInfoArr struct {
	ChainCodes []*peer.ChaincodeInfo `json:"chaincodes"`
}

type ChannelArr

type ChannelArr struct {
	Channels []*peer2.ChannelInfo `json:"channels"`
}

type Result

type Result struct {
	ResultCode string `json:"code"`
	Msg        string `json:"msg"`
	// 数据接口
	Data interface{} `json:"data"`
}

Result 请求返回对象实体

func Install

func Install(orgName, orgUser, peerName, name, goPath, chainCodePath, version string, configBytes []byte, sdkOpts ...fabsdk.Option) *Result

func Installed

func Installed(orgName, orgUser, peerName string, configBytes []byte, sdkOpts ...fabsdk.Option) *Result

func Instantiate

func Instantiate(orgName, orgUser, peerName, channelID, name, path, version string, orgPolicies []string, args [][]byte,
	configBytes []byte, sdkOpts ...fabsdk.Option) *Result

func Instantiated

func Instantiated(orgName, orgUser, channelID, peerName string, configBytes []byte, sdkOpts ...fabsdk.Option) *Result

func Invoke

func Invoke(chaincodeID, orgName, orgUser, channelID, fcn string, args [][]byte, targetEndpoints []string, configBytes []byte,
	sdkOpts ...fabsdk.Option) *Result

func InvokeAsync

func InvokeAsync(chaincodeID, orgName, orgUser, channelID, callback, fcn string, args [][]byte, targetEndpoints []string, configBytes []byte,
	sdkOpts ...fabsdk.Option) *Result

func OrderConfig

func OrderConfig(orgName, orgUser, channelID, orderURL string, configBytes []byte, sdkOpts ...fabsdk.Option) *Result

func Query

func Query(chaincodeID, orgName, orgUser, channelID, fcn string, args [][]byte, targetEndpoints []string, configBytes []byte,
	sdkOpts ...fabsdk.Option) *Result

func QueryChannelBlockByHash

func QueryChannelBlockByHash(channelID, orgName, orgUser, peerName, hash string, configBytes []byte, sdkOpts ...fabsdk.Option) *Result

func QueryChannelBlockByHeight

func QueryChannelBlockByHeight(channelID, orgName, orgUser, peerName string, height uint64, configBytes []byte, sdkOpts ...fabsdk.Option) *Result

func QueryChannelBlockByTxID

func QueryChannelBlockByTxID(channelID, orgName, orgUser, peerName, txID string, configBytes []byte, sdkOpts ...fabsdk.Option) *Result

func QueryChannelInfo

func QueryChannelInfo(channelID, orgName, orgUser, peerName string, configBytes []byte, sdkOpts ...fabsdk.Option) *Result

func QueryChannelTransaction

func QueryChannelTransaction(channelID, orgName, orgUser, peerName, txID string, configBytes []byte, sdkOpts ...fabsdk.Option) *Result

func QueryCollectionsConfig

func QueryCollectionsConfig(chaincodeID, orgName, orgUser, channelID, peerName string, configBytes []byte,
	sdkOpts ...fabsdk.Option) *Result

func QueryConfigBlock

func QueryConfigBlock(channelID, orgName, orgUser, peerName string, configBytes []byte, sdkOpts ...fabsdk.Option) *Result

func QueryLedgerBlockByHash

func QueryLedgerBlockByHash(configID, peerName, channelID, hash string, configBytes []byte, sdkOpts ...fabsdk.Option) *Result

func QueryLedgerBlockByHashSpec

func QueryLedgerBlockByHashSpec(peerName, channelID, orgName, orgUser, hash string, configBytes []byte, sdkOpts ...fabsdk.Option) *Result

func QueryLedgerBlockByHeight

func QueryLedgerBlockByHeight(configID, peerName, channelID string, height uint64, configBytes []byte, sdkOpts ...fabsdk.Option) *Result

func QueryLedgerBlockByHeightSpec

func QueryLedgerBlockByHeightSpec(peerName, channelID, orgName, orgUser string, height uint64, configBytes []byte, sdkOpts ...fabsdk.Option) *Result

func QueryLedgerBlockByTxID

func QueryLedgerBlockByTxID(configID, peerName, channelID, txID string, configBytes []byte, sdkOpts ...fabsdk.Option) *Result

func QueryLedgerBlockByTxIDSpec

func QueryLedgerBlockByTxIDSpec(peerName, channelID, orgName, orgUser, txID string, configBytes []byte, sdkOpts ...fabsdk.Option) *Result

func QueryLedgerConfig

func QueryLedgerConfig(configID, peerName, channelID string, configBytes []byte, sdkOpts ...fabsdk.Option) *Result

func QueryLedgerConfigSpec

func QueryLedgerConfigSpec(peerName, channelID, orgName, orgUser string, configBytes []byte, sdkOpts ...fabsdk.Option) *Result

func QueryLedgerInfo

func QueryLedgerInfo(configID, peerName, channelID string, configBytes []byte, sdkOpts ...fabsdk.Option) *Result

func QueryLedgerInfoSpec

func QueryLedgerInfoSpec(peerName, channelID, orgName, orgUser string, configBytes []byte, sdkOpts ...fabsdk.Option) *Result

func QueryLedgerTransaction

func QueryLedgerTransaction(configID, peerName, channelID, txID string, configBytes []byte, sdkOpts ...fabsdk.Option) *Result

func QueryLedgerTransactionSpec

func QueryLedgerTransactionSpec(peerName, channelID, orgName, orgUser, txID string, configBytes []byte, sdkOpts ...fabsdk.Option) *Result

func Upgrade

func Upgrade(orgName, orgUser, peerName, channelID, name, path, version string, orgPolicies []string, args [][]byte,
	configBytes []byte, sdkOpts ...fabsdk.Option) *Result

func (*Result) Fail

func (result *Result) Fail(msg string)

Fail 方法主要提供返回错误的json数据

func (*Result) FailErr

func (result *Result) FailErr(err error)

FailErr 携带error信息

func (*Result) Success

func (result *Result) Success(obj interface{})

Success 默认成功返回

Jump to

Keyboard shortcuts

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