client

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2019 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromArgument

func FromArgument(arg string) []byte

func NewRESTConfig

func NewRESTConfig() client.ChainClient

func NewRPCConfig

func NewRPCConfig() client.RpcClient

Types

type ClientConn

type ClientConn struct {
	C         *grpc.ClientConn
	BlockConn bool
}

func (*ClientConn) Dial

func (conn *ClientConn) Dial(conf map[string]string) error

type RPCManager

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

func NewRpcManager

func NewRpcManager() *RPCManager

func (*RPCManager) Cancel

func (m *RPCManager) Cancel()

func (*RPCManager) Context

func (m *RPCManager) Context() context.Context

type Rpc

type Rpc struct {
}

depecrated

func (*Rpc) NewManager

func (_ *Rpc) NewManager() *RPCManager

type RpcBuilder

type RpcBuilder struct {
	ChaincodeName string
	//	ChaincodeLang    string
	Function string

	Security *SecurityPolicy

	Conn        ClientConn
	ConnManager *RPCManager
	TxTimeout   time.Duration
}

func (*RpcBuilder) Deploy

func (b *RpcBuilder) Deploy(args [][]byte) (*pb.ChaincodeDeploymentSpec, error)

func (*RpcBuilder) Fire

func (b *RpcBuilder) Fire(args [][]byte) (string, error)

func (*RpcBuilder) GetBlock

func (b *RpcBuilder) GetBlock(blknum int64) (*pb.Block, error)

func (*RpcBuilder) GetCurrentBlock

func (b *RpcBuilder) GetCurrentBlock() (int64, error)

also imply the chainAcquire

func (*RpcBuilder) GetTransaction

func (b *RpcBuilder) GetTransaction(txid string) (*pb.Transaction, error)

func (*RpcBuilder) GetTxIndex

func (b *RpcBuilder) GetTxIndex(string) (int64, error)

func (*RpcBuilder) Query

func (b *RpcBuilder) Query(args [][]byte) ([]byte, error)

func (*RpcBuilder) VerifyConn

func (b *RpcBuilder) VerifyConn() error

type RpcClientConfig

type RpcClientConfig struct {
	TxTimeout time.Duration
	// contains filtered or unexported fields
}

func (*RpcClientConfig) Caller

func (c *RpcClientConfig) Caller(spec *client.RpcSpec) (rpc.Caller, error)

Assign each http request (run cocurrency) a client, which can be adapted to a caller the client is "lazy" connect: it just do connect when required (a request has come) and wait for connect finish

func (*RpcClientConfig) Chain

func (c *RpcClientConfig) Chain() (client.ChainInfo, error)

func (*RpcClientConfig) Load

func (c *RpcClientConfig) Load(vp *viper.Viper) error

the configuration for client can include these fields:

  • chaincode
  • username
  • userattr (a list of strings)
  • endpoint (for compatible, its subfield can be put in top level now but this will be deprecated later)
  • server
  • tlsenabled
  • certfile
  • hostname (override the hostname in certfile)

func (*RpcClientConfig) Quit

func (c *RpcClientConfig) Quit()

type SecurityPolicy

type SecurityPolicy struct {
	User           string
	Attributes     []string
	Metadata       []byte
	CustomIDGenAlg string
}

Directories

Path Synopsis
Package protos is a generated protocol buffer package.
Package protos is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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