Documentation ¶
Index ¶
- type APIService
- func (as *APIService) ExecTransaction(ctx context.Context, req *rpcpb.TransactionRequest) (*rpcpb.TxReceipt, error)
- func (as *APIService) GetAccount(ctx context.Context, req *rpcpb.GetAccountRequest) (*rpcpb.Account, error)
- func (as *APIService) GetBlockByHash(ctx context.Context, req *rpcpb.GetBlockByHashRequest) (*rpcpb.BlockResponse, error)
- func (as *APIService) GetBlockByNumber(ctx context.Context, req *rpcpb.GetBlockByNumberRequest) (*rpcpb.BlockResponse, error)
- func (as *APIService) GetChainInfo(context.Context, *rpcpb.EmptyRequest) (*rpcpb.ChainInfoResponse, error)
- func (as *APIService) GetContract(ctx context.Context, req *rpcpb.GetContractRequest) (*rpcpb.Contract, error)
- func (as *APIService) GetContractStorage(ctx context.Context, req *rpcpb.GetContractStorageRequest) (*rpcpb.GetContractStorageResponse, error)
- func (as *APIService) GetGasRatio(ctx context.Context, req *rpcpb.EmptyRequest) (*rpcpb.GasRatioResponse, error)
- func (as *APIService) GetNodeInfo(context.Context, *rpcpb.EmptyRequest) (*rpcpb.NodeInfoResponse, error)
- func (as *APIService) GetRAMInfo(context.Context, *rpcpb.EmptyRequest) (*rpcpb.RAMInfoResponse, error)
- func (as *APIService) GetTokenBalance(ctx context.Context, req *rpcpb.GetTokenBalanceRequest) (*rpcpb.GetTokenBalanceResponse, error)
- func (as *APIService) GetTxByHash(ctx context.Context, req *rpcpb.TxHashRequest) (*rpcpb.TransactionResponse, error)
- func (as *APIService) GetTxReceiptByTxHash(ctx context.Context, req *rpcpb.TxHashRequest) (*rpcpb.TxReceipt, error)
- func (as *APIService) SendTransaction(ctx context.Context, req *rpcpb.TransactionRequest) (*rpcpb.SendTransactionResponse, error)
- func (as *APIService) Subscribe(req *rpcpb.SubscribeRequest, res rpcpb.ApiService_SubscribeServer) error
- type Server
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) *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.