common

package
v0.0.0-...-6a6d068 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2025 License: Apache-2.0 Imports: 24 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Abort

func Abort(c *gin.Context, status int, err error)

func CloseSDK

func CloseSDK()

Closes sdk instance if it was created

func CreateGatewayConnection

func CreateGatewayConnection(grpcConn *grpc.ClientConn, user string) (*client.Gateway, error)

func CreateGrpcConnection

func CreateGrpcConnection(endpoint string) (*grpc.ClientConn, error)

func GetClientOrg

func GetClientOrg() string

GetClientOrg returns the name of the client organization

func GetCryptoPath

func GetCryptoPath() string

func GetMSPID

func GetMSPID() string

func GetSDK

func GetSDK(sdkOpts ...fabsdk.Option) (*sdk, error)

GetSDK returns a fabric sdk instance.

A new sdk is created if:
- it is the first time it is beeing used, or
- new sdk options are given

Otherwise, it returns the one previoulsy created. If options are given, the new sdk is not a singleton, and must be closed by whoever invoked it.

The configsdk file can be set via environment variable and defaults to './config/configsdk.yaml'

func GetTLSCACert

func GetTLSCACert() string

func NewFabricChClient

func NewFabricChClient(channelName, userName, orgName string) (*fabricChannelClient, error)

Returns a client which has channel transaction capabilities These are, but not limited to: Execute, Query, Invoke cc...

Function works like this:

  1. Get sdk
  2. Use sdk to create a ChannelProvider ()
  3. From channel provider create channel Client

You can then use this .Client to call for specific functionalities

func NewFabricLedgerClient

func NewFabricLedgerClient(channelName, user, orgName string) (*fabricLedgerClient, error)

Returns a client which can query a channel's underlying ledger, such as QueryBlock and QueryConfig

Function works like this:

  1. Get sdk
  2. Use sdk to create a ChannelProvider ()
  3. From channel provider create ledger Client

You can then use this .Client to call for specific functionalities

func NewFabricResmgmtClient

func NewFabricResmgmtClient(orgName, userName string, opts ...resmgmt.ClientOption) (*fabricResmgtmClient, error)

Returns a client which has access resource management capabilities These are, but not limited to: create channel, query cfg, cc lifecycle...

Function works like this:

  1. Get sdk
  2. Use sdk to create a ClientProvider ()
  3. From client provider create resmgmt Client

You can then use this .Client to call for specific functionalities

func ParseError

func ParseError(err error) (error, int)

Returns error and status code

func Respond

func Respond(c *gin.Context, res interface{}, status int, err error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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