rpc

package
v2.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2018 License: LGPL-3.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIService added in v1.1.0

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

APIService implements all rpc APIs.

func NewAPIService added in v1.1.0

func NewAPIService(tp txpool.TxPool, bcache blockcache.BlockCache, bv global.BaseVariable, p2pService p2p.Service, quitCh chan struct{}) *APIService

NewAPIService returns a new APIService instance.

func (*APIService) ExecTransaction added in v1.1.0

func (as *APIService) ExecTransaction(ctx context.Context, req *rpcpb.TransactionRequest) (*rpcpb.TxReceipt, error)

ExecTransaction executes a transaction by the node and returns the receipt.

func (*APIService) GetAccount added in v1.1.0

func (as *APIService) GetAccount(ctx context.Context, req *rpcpb.GetAccountRequest) (*rpcpb.Account, error)

GetAccount returns account information corresponding to the given account name.

func (*APIService) GetBlockByHash added in v1.1.0

func (as *APIService) GetBlockByHash(ctx context.Context, req *rpcpb.GetBlockByHashRequest) (*rpcpb.BlockResponse, error)

GetBlockByHash returns block corresponding to the given hash.

func (*APIService) GetBlockByNumber added in v1.1.0

func (as *APIService) GetBlockByNumber(ctx context.Context, req *rpcpb.GetBlockByNumberRequest) (*rpcpb.BlockResponse, error)

GetBlockByNumber returns block corresponding to the given number.

func (*APIService) GetChainInfo added in v1.1.0

func (as *APIService) GetChainInfo(context.Context, *rpcpb.EmptyRequest) (*rpcpb.ChainInfoResponse, error)

GetChainInfo returns the chain info.

func (*APIService) GetContract added in v1.1.0

func (as *APIService) GetContract(ctx context.Context, req *rpcpb.GetContractRequest) (*rpcpb.Contract, error)

GetContract returns contract information corresponding to the given contract ID.

func (*APIService) GetContractStorage added in v1.1.0

func (as *APIService) GetContractStorage(ctx context.Context, req *rpcpb.GetContractStorageRequest) (*rpcpb.GetContractStorageResponse, error)

GetContractStorage returns contract storage corresponding to the given key and field.

func (*APIService) GetGasRatio added in v1.1.0

func (as *APIService) GetGasRatio(ctx context.Context, req *rpcpb.EmptyRequest) (*rpcpb.GasRatioResponse, error)

GetGasRatio returns gas ratio information in head block

func (*APIService) GetNodeInfo added in v1.1.0

func (as *APIService) GetNodeInfo(context.Context, *rpcpb.EmptyRequest) (*rpcpb.NodeInfoResponse, error)

GetNodeInfo returns information abount node.

func (*APIService) GetRAMInfo added in v1.1.0

func (as *APIService) GetRAMInfo(context.Context, *rpcpb.EmptyRequest) (*rpcpb.RAMInfoResponse, error)

GetRAMInfo returns the chain info.

func (*APIService) GetTokenBalance added in v1.1.0

func (as *APIService) GetTokenBalance(ctx context.Context, req *rpcpb.GetTokenBalanceRequest) (*rpcpb.GetTokenBalanceResponse, error)

GetTokenBalance returns contract information corresponding to the given contract ID.

func (*APIService) GetTxByHash added in v1.1.0

func (as *APIService) GetTxByHash(ctx context.Context, req *rpcpb.TxHashRequest) (*rpcpb.TransactionResponse, error)

GetTxByHash returns the transaction corresponding to the given hash.

func (*APIService) GetTxReceiptByTxHash added in v1.1.0

func (as *APIService) GetTxReceiptByTxHash(ctx context.Context, req *rpcpb.TxHashRequest) (*rpcpb.TxReceipt, error)

GetTxReceiptByTxHash returns transaction receipts corresponding to the given tx hash.

func (*APIService) SendTransaction added in v1.1.0

func (as *APIService) SendTransaction(ctx context.Context, req *rpcpb.TransactionRequest) (*rpcpb.SendTransactionResponse, error)

SendTransaction sends a transaction to iserver.

func (*APIService) Subscribe added in v1.1.0

func (as *APIService) Subscribe(req *rpcpb.SubscribeRequest, res rpcpb.ApiService_SubscribeServer) error

Subscribe used for event.

type Server added in v1.1.0

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

Server is the rpc server including grpc server and json gateway server.

func New added in v1.1.0

func New(tp txpool.TxPool, bc blockcache.BlockCache, bv global.BaseVariable, p2pService p2p.Service) *Server

New returns a new rpc server instance.

func (*Server) Start added in v1.1.0

func (s *Server) Start() error

Start starts the rpc server.

func (*Server) Stop added in v1.1.0

func (s *Server) Stop()

Stop stops the rpc server.

Directories

Path Synopsis
Package main is a generated GoMock package.
Package main is a generated GoMock package.
Package rpcpb is a reverse proxy.
Package rpcpb is a reverse proxy.

Jump to

Keyboard shortcuts

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