client

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is the client model for client service.

func NewClient

func NewClient(ip, port string) (*Client, error)

NewClient setups a Client given ip and port.

func (*Client) Close

func (client *Client) Close() error

Close closes the Client.

func (*Client) GetBalance

func (client *Client) GetBalance(address common.Address) (*proto.FetchAccountStateResponse, error)

GetBalance gets account balance from the client service.

func (*Client) GetFreeToken

func (client *Client) GetFreeToken(address common.Address) (*proto.GetFreeTokenResponse, error)

GetFreeToken requests free token from the faucet contract.

type Server

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

Server is the Server struct for client service package.

func NewServer

func NewServer(
	stateReader func() (*state.DB, error),
	callFaucetContract func(common.Address) common.Hash) *Server

NewServer creates new Server which implements ClientServiceServer interface.

func (*Server) FetchAccountState

func (s *Server) FetchAccountState(ctx context.Context, request *proto.FetchAccountStateRequest) (*proto.FetchAccountStateResponse, error)

FetchAccountState implements the FetchAccountState interface to return account state.

func (*Server) GetFreeToken

func (s *Server) GetFreeToken(ctx context.Context, request *proto.GetFreeTokenRequest) (*proto.GetFreeTokenResponse, error)

GetFreeToken implements the GetFreeToken interface to request free token.

func (*Server) Start

func (s *Server) Start(ip, port string) (*grpc.Server, error)

Start starts the Server on given ip and port.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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