rpc

package
v0.0.0-...-376a440 Latest Latest
Warning

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

Go to latest
Published: May 10, 2020 License: LGPL-3.0 Imports: 42 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIService

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

APIService implements all rpc APIs.

func NewAPIService

func NewAPIService(tp txpool.TxPool, chainBase *chainbase.ChainBase, config *config.Config, p2pService p2p.Service, quitCh chan struct{}) *APIService

NewAPIService returns a new APIService instance.

func (*APIService) ExecTransaction

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

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) GetBatchContractStorage

GetBatchContractStorage returns contract storage corresponding to the given keys and fields.

func (*APIService) GetBlockByHash

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

GetBlockByHash returns block corresponding to the given hash.

func (*APIService) GetBlockByNumber

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

GetBlockByNumber returns block corresponding to the given number.

func (*APIService) GetCandidateBonus

func (as *APIService) GetCandidateBonus(ctx context.Context, req *rpcpb.GetAccountRequest) (*rpcpb.CandidateBonus, error)

GetCandidateBonus returns the bonus a candidate can claim.

func (*APIService) GetChainInfo

GetChainInfo returns the chain info.

func (*APIService) GetContract

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

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

func (*APIService) GetContractStorageFields

GetContractStorageFields returns contract storage corresponding to the given fields.

func (*APIService) GetContractVote

func (as *APIService) GetContractVote(ctx context.Context, req *rpcpb.GetContractRequest) (*rpcpb.ContractVote, error)

GetContractVote returns contract vote information by contract ID.

func (*APIService) GetGasRatio

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

GetGasRatio returns gas ratio information in head block

func (*APIService) GetNodeInfo

GetNodeInfo returns information abount node.

func (*APIService) GetProducerVoteInfo

GetProducerVoteInfo returns producers's vote info

func (*APIService) GetRAMInfo

GetRAMInfo returns the chain info.

func (*APIService) GetToken721Balance

GetToken721Balance returns balance of account of an specific token721 token.

func (*APIService) GetToken721Metadata

GetToken721Metadata returns metadata of an specific token721 token.

func (*APIService) GetToken721Owner

GetToken721Owner returns owner of an specific token721 token.

func (*APIService) GetTokenBalance

GetTokenBalance returns contract information corresponding to the given contract ID.

func (*APIService) GetTokenInfo

func (as *APIService) GetTokenInfo(ctx context.Context, req *rpcpb.GetTokenInfoRequest) (*rpcpb.TokenInfo, error)

GetTokenInfo returns the information of a given token.

func (*APIService) GetTxByHash

GetTxByHash returns the transaction corresponding to the given hash.

func (*APIService) GetTxReceiptByTxHash

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) GetVoterBonus

func (as *APIService) GetVoterBonus(ctx context.Context, req *rpcpb.GetAccountRequest) (*rpcpb.VoterBonus, error)

GetVoterBonus returns the bonus a voter can claim.

func (*APIService) ListContractStorage

nolint: gocyclo

func (*APIService) SendTransaction

SendTransaction sends a transaction to iserver.

func (*APIService) Subscribe

Subscribe used for event.

type Server

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

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

func New

func New(tp txpool.TxPool, chainBase *chainbase.ChainBase, config *config.Config, p2pService p2p.Service) *Server

New returns a new rpc server instance.

func (*Server) Start

func (s *Server) Start() error

Start starts the rpc server.

func (*Server) Stop

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