client

package
v0.0.0-...-9098a98 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package client defines the APIs to communicate with the node.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewResolver

func NewResolver() naming.Resolver

NewResolver creates a simple resolver which returns saved addrs.

Types

type GrpcClient

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

GrpcClient manages the gRPC connections to ult servers and works as a load balancer to the backend ult servers.

func New

func New(networkID, coreEndpoints string) (*GrpcClient, error)

New creates a GrpcClient to the given target servers.

func (*GrpcClient) CreateTestAccount

func (c *GrpcClient) CreateTestAccount(accountID string) (*ultpb.Account, error)

CreateTestAccount creates a test account for the purpose of testing in testnet.

func (*GrpcClient) GetAccount

func (c *GrpcClient) GetAccount(accountID string) (*ultpb.Account, error)

GetAccount gets the account with the requested account id.

func (*GrpcClient) QueryTx

func (c *GrpcClient) QueryTx(txKey string) (*types.TxStatus, error)

QueryTx queries the tx status from ult servers and return current tx status.

func (*GrpcClient) SubmitTx

func (c *GrpcClient) SubmitTx(txKey string, signature string, data []byte) error

SummitTx summits the tx to ult servers and return appropriate response messages to the client.

Directories

Path Synopsis
Package build defines various convient methods to construct a transaction.
Package build defines various convient methods to construct a transaction.
Package types defines custom types to represent the response from the node server.
Package types defines custom types to represent the response from the node server.

Jump to

Keyboard shortcuts

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