Documentation ¶
Index ¶
- Constants
- type ClientOpts
- type FabricClient
- func (c *FabricClient) AddCityNode(nodeName, gateWayUrl, privateKey string) error
- func (c *FabricClient) BlockEventRegister(body eventreq.RegisterReqDataBody) (*eventres.RegisterResData, error)
- func (c *FabricClient) Call(method string, req base.ReqInterface, res base.ResInterface) error
- func (c *FabricClient) EnrollUser(body userreq.RegisterReqDataBody) (*userres.EnrollResData, error)
- func (c *FabricClient) EventQuery() (*eventres.QueryResData, error)
- func (c *FabricClient) EventRegister(body eventreq.RegisterReqDataBody) (*eventres.RegisterResData, error)
- func (c *FabricClient) EventRemove(body eventreq.RemoveReqDataBody) (*resBase.BaseResModel, error)
- func (c *FabricClient) GetBlockData(body nodereq.BlockReqDataBody) (*noderes.BlockDataRes, *common.Block, error)
- func (c *FabricClient) GetBlockInfo(body nodereq.BlockReqDataBody) (*noderes.BlockResData, error)
- func (c *FabricClient) GetHeader() base.ReqHeader
- func (c *FabricClient) GetLedgerInfo() (*noderes.LedgerResData, error)
- func (c *FabricClient) GetTransData(body nodereq.TxTransReqDataBody) (*noderes.TranDataRes, *pb.ProcessedTransaction, error)
- func (c *FabricClient) GetTransInfo(body nodereq.TxTransReqDataBody) (*noderes.TransactionResData, error)
- func (c *FabricClient) LoadUser(userName string) (*msp.UserData, error)
- func (c *FabricClient) RegisterUser(body userreq.RegisterReqDataBody) (*userres.RegisterResData, error)
- func (c *FabricClient) ReqChainCode(body nodereq.TransReqDataBody) (*noderes.TranResData, error)
- func (c *FabricClient) SdkTran(body nodereq.TransReqDataBody, user *msp.UserData) (*noderes.TranResData, error)
- type KeyOpts
Constants ¶
const ( EventRegister = "chainCode/event/register" BlockEventRegister = "chainCode/event/blockRegister" EventQuery = "chainCode/event/query" EventRemove = "chainCode/event/remove" )
const ( ReqChainCode = "node/reqChainCode" SDKTran = "node/trans" GetTransInfo = "node/getTransaction" GetTransData = "node/getTransdata" GetBlockInfo = "node/getBlockInfo" GetBlockData = "node/getBlockData" GetLedgerInfo = "node/getLedgerInfo" )
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 ¶
func (c *FabricClient) EnrollUser(body userreq.RegisterReqDataBody) (*userres.EnrollResData, error)
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 ¶
func (c *FabricClient) EventRegister(body eventreq.RegisterReqDataBody) (*eventres.RegisterResData, error)
EventRegister register fabric transaction event listeners
func (*FabricClient) EventRemove ¶
func (c *FabricClient) EventRemove(body eventreq.RemoveReqDataBody) (*resBase.BaseResModel, error)
EventRemove remove fabric event
func (*FabricClient) GetBlockData ¶ added in v1.1.3
func (c *FabricClient) GetBlockData(body nodereq.BlockReqDataBody) (*noderes.BlockDataRes, *common.Block, error)
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
func (c *FabricClient) GetTransData(body nodereq.TxTransReqDataBody) (*noderes.TranDataRes, *pb.ProcessedTransaction, error)
GetTransData query fabric transaction, but the return data is "peer.ProcessedTransaction" serialized bytes after Base64 encoding .
func (*FabricClient) GetTransInfo ¶
func (c *FabricClient) GetTransInfo(body nodereq.TxTransReqDataBody) (*noderes.TransactionResData, error)
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 ¶
func (c *FabricClient) RegisterUser(body userreq.RegisterReqDataBody) (*userres.RegisterResData, error)
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 ¶
func (c *FabricClient) SdkTran(body nodereq.TransReqDataBody, user *msp.UserData) (*noderes.TranResData, error)
SdkTran Dapp transaction in key upload mode