fabric

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventRegister      = "chainCode/event/register"
	BlockEventRegister = "chainCode/event/blockRegister"
	EventQuery         = "chainCode/event/query"
	EventRemove        = "chainCode/event/remove"
)
View Source
const (
	ReqChainCode  = "node/reqChainCode"
	SDKTran       = "node/trans"
	GetTransInfo  = "node/getTransaction"
	GetTransData  = "node/getTransdata"
	GetBlockInfo  = "node/getBlockInfo"
	GetBlockData  = "node/getBlockData"
	GetLedgerInfo = "node/getLedgerInfo"
)
View Source
const (
	RegisterUser = "user/register"
	EnrollUser   = "user/enroll"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientOpts added in v1.2.0

type ClientOpts func(*FabricClient) error

func WithDefaultNodeName added in v1.2.0

func WithDefaultNodeName(nodeName string) ClientOpts

func WithKeyOpts added in v1.2.0

func WithKeyOpts(keyOpts keystore.KeyStore) ClientOpts

func WithUserOpts added in v1.2.0

func WithUserOpts(userOpts keystore.UserCertStore) ClientOpts

type FabricClient

type FabricClient struct {
	// contains filtered or unexported fields
}

func InitFabricClient

func InitFabricClient(config *config.Config, opts ...ClientOpts) (*FabricClient, error)

initialize client requested by fabric

func (*FabricClient) AddCityNode added in v1.2.0

func (c *FabricClient) AddCityNode(nodeName, gateWayUrl, privateKey string) error

func (*FabricClient) BlockEventRegister added in v1.1.1

func (c *FabricClient) BlockEventRegister(body eventreq.RegisterReqDataBody) (*eventres.RegisterResData, error)

BlockEventRegister register fabric block event listeners

func (*FabricClient) Call added in v1.2.0

func (c *FabricClient) Call(method string, req base.ReqInterface, res base.ResInterface) error

func (*FabricClient) EnrollUser

EnrollUser enroll sub user certificate and store to local folder and FabricClient.Users

func (*FabricClient) EventQuery

func (c *FabricClient) EventQuery() (*eventres.QueryResData, error)

EventQuery query fabric event list

func (*FabricClient) EventRegister

EventRegister register fabric transaction event listeners

func (*FabricClient) EventRemove

EventRemove remove fabric event

func (*FabricClient) GetBlockData added in v1.1.3

GetBlockData query fabric block data but the return data is "common.Block" serialized bytes after Base64 encoding .

func (*FabricClient) GetBlockInfo

func (c *FabricClient) GetBlockInfo(body nodereq.BlockReqDataBody) (*noderes.BlockResData, error)

GetBlockInfo query fabric block data

func (*FabricClient) GetHeader added in v1.2.0

func (c *FabricClient) GetHeader() base.ReqHeader

func (*FabricClient) GetLedgerInfo

func (c *FabricClient) GetLedgerInfo() (*noderes.LedgerResData, error)

GetBlockData query fabric ledger data

func (*FabricClient) GetTransData added in v1.1.3

GetTransData query fabric transaction, but the return data is "peer.ProcessedTransaction" serialized bytes after Base64 encoding .

func (*FabricClient) GetTransInfo

GetTransInfo query fabric transaction

func (*FabricClient) LoadUser

func (c *FabricClient) LoadUser(userName string) (*msp.UserData, error)

LoadUser load user from local store , before, the cache is checked from the client users

func (*FabricClient) RegisterUser

RegisterUser register sub user

func (*FabricClient) ReqChainCode

func (c *FabricClient) ReqChainCode(body nodereq.TransReqDataBody) (*noderes.TranResData, error)

ReqChainCode Dapp transaction in public key trust mode

func (*FabricClient) SdkTran

SdkTran Dapp transaction in key upload mode

type KeyOpts added in v1.2.0

type KeyOpts func(rawPem []byte, alias string) error

saveKey delegate method for saving private key

func DefaultSaveKey added in v1.2.0

func DefaultSaveKey(dir string) KeyOpts

DefaultSaveKey Default delegate method for saving private key

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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