fabric-sdk-go文档
fabric-sdk-go是Hyperledger Fabric官方提供的go语言SDK。
fabsdk包
- FabricSDK - sdk入口
- fabsdk.New() - 创建FabricSDK实例
- sdk.ChannelContext() - 创建通道上下文实例
- sdk.Close() - 关闭FabricSDK实例
- sdk.CloseContext() - 关闭指定的上下文实例
- sdk.Config() - 创建配置后端实例
- sdk.Context() - 创建SDK上下文实例
- fabsdk.ContextOption - SDK上下文配置结构定义
- fabsdk.WithIdentity() - 创建身份上下文配置对象
- fabsdk.WithOrg() - 创建机构上下文配置对象
- fabsdk.WithUser() - 创建用户上下文配置对象
- fabsdk.Option - SDK配置结构定义
- fabsdk.WithCorePkg() - 向SDK注入核心包
- fabsdk.WithCryptoSuiteConfig() - 向SDK注入密码学套件接口
- fabsdk.WithEndpointConfig() - 向SDK注入端结点配置接口
- fabsdk.WithErrorHandler() - 设置错误处理程序
- fabsdk.WithIdentityConfig() - 向SDK注入身份配置接口
- fabsdk.WithLoggerPkg() - 向SDK注入日志实现
- fabsdk.WithMSPPkg() - 向SDK注入MSP实现
- fabsdk.WithMetricsConfig() - 向SDK注入监视指标配置接口
- fabsdk.WithProviderOpts() - 向提供器添加额外的选项
- fabsdk.WithServicePkg() - 向SDK注入服务实现
client/channel包
- channel.Client - 通道客户端结构定义
- channel.New() - 创建通道客户端
- cc.Execute() - 执行交易
- cc.InvokeHandler() - 调用指定的处理器
- cc.Query() - 查询链码
- cc.RegisterChaincodeEvent() - 监听链码事件
- cc.UnregisterChaincodeEvent() - 取消监听链码事件
- channel.ClientOption - 客户端选项结构定义
- channel.Request - 链码请求结构定义
- channle.RequestOption - 链码请求选项函数
- channel.WithBeforeRetry() - 设置链码请求重试前需调用的函数
- channel.WithChaincodeFilter() - 为链码请求添加链码过滤器
- channel.WithParentContext() - 为链码请求封装父级上下文
- channel.WithRetry() - 为链码请求配置重试参数
- channel.WithTargetEndpoints() - 为链码请求配置访问端结点
- channel.WithTargetFilter() - 为特定链码请求指定节点过滤器
- channel.WithTargetSorter() - 对特定链码请求指定排序器
- channel.WithTargets() - 为链码请求设置目标peer节点
- channel.WithTimeout() - 为链码请求设置超时参数
- channel.Response - 链码响应结构定义
client/event包
- event.Client - 通道事件客户端结构定义
- event.New() - 创建通道事件客户端
- ec.RegisterBlockEvent() - 监听区块事件
- ec.RegisterChaincodeEvent() - 监听链码事件
- ec.RegisterFilteredBlockEvent() - 监听过滤的区块事件
- ec.RegisterTxStatusEvent() - 监听交易状态事件
- ec.Unregister() - 取消事件监听
- event.ClientOption - 通道事件客户端选项结构定义
- event.WithBlockEvents() - 创建监听区块事件的选项
- event.WithBlockNum() - 只监听指定编号的区块
- evnet.WithSeekType() - 指定区块定位类型
client/ledger包
- ledger.Client - 账本客户端结构定义
- ledger.New() - 创建账本客户端实例
- lc.QueryBlock() - 按编号查询区块
- lc.QueryBlockByHash() - 按哈希查询区块
- lc.QueryBlockByTxID() - 查询包含指定交易的区块
- lc.QueryConfig() - 查询通道配置
- lc.QueryConfigBlock() - 查询指定通道的当前配置区块
- lc.QueryInfo() - 查询指定通道的相关信息
- lc.QueryTransaction() - 查询指定的交易
- ClientOption - 账本客户端选项结构定义
- ledger.WithDefaultTargetFilter - 使用默认的节点过滤器
- RequestOption - 请求选项函数
- ledger.WithMaxTargets - 声明每个请求最多可以选择的节点
- ledger.WithMinTargets - 声明每个请求最少需要的响应
- ledger.WithParentContext - 使用父级上下文
- ledger.WithTargetEndpoints - 使用指定的访问端节点
- ledger.WithTargetFilter - 声明节点选择过滤器
- ledger.WithTargets - 为特定请求指定目标节点
- ledger.WithTimeout - 指定账本客户端的超时参数
client/resmgmt包
- resmgmt.CalculateConfigUpdate()
- resmgmt.MarshalConfigSignature()
- resmgmt.UnmarshalConfigSignature()
- resmgmt.Client
- resmgmt.New()
- rc.CreateConfigSignature()
- rc.CreateConfigSignatureData()
- rc.CreateConfigSignatureDataFromReader()
- rc.CreateConfigSignatureFromReader()
- rc.InstallCC()
- rc.InstantiateCC()
- rc.JoinChannel()
- rc.QueryChannels()
- rc.QueryCollectionsConfig()
- rc.QueryConfigBlockFromOrderer()
- rc.QueryCOnfigFromOrderer()
- rc.QueryInstalledChaincodes()
- rc.QueryInstantiatedChaincodes()
- rc.SaveChannel()
- rc.UpgradeCC()
- resmgmt.ClientOption
- resmgmt.WithDefaultTargetFilter()
- resmgmt.SaveChannelRequest
- resmgmt.SaveChannelResponse
- resmgmt.UpgradeCCRequest
- resmgmt.UPgradeCCResponse
client/msp包
- msp.AffiliationInfo
- msp.AffiliationRequest
- msp.AffiliationResponse
- msp.Attribute
- msp.AttributeRequest
- msp.CSRInfo
- msp.Client
- msp.New()
- mc.AddAffiliation()
- mc.CreateIdentity()
- mc.CreateSigningIdentity()
- mc.Enroll()
- mc.GetAffiliation()
- mc.GetAllAffiliations()
- mc.GetAllIdentities()
- mc.GetCAInfo()
- mc.GetIdentity()
- mc.GetSigningIdentity()
- mc.ModifyAffiliation()
- mc.ModifyIdentity()
- mc.Reenroll()
- mc.Register()
- mc.RemoveAffiliation()
- mc.RemoveIdentity()
- mc.Revoke()
- msp.ClientOption
- msp.WithCAInstance()
- msp.WithOrg()
- msp.EnrollmentOption
- msp.WithAttributeRequests()
- msp.WithCSR()
- msp.WithLabel()
- msp.WithProfile()
- msp.WithSecret()
- msp.WithType()
- msp.GetCAInfoResponse
- msp.IdentityInfo
- msp.IdentityManager
- msp.IdentityRequest
- msp.IdentityResponse
- msp.ModifyAffiliationRequest
- msp.RegistrationRequest
- msp.RemoveIdentityRequest
- msp.ReqeustOption
- msp.WithCA()
- msp.RevocationRequest
- msp.RevocationResponse
- msp.RevokeCert