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) GetBatchContractStorage(ctx context.Context, req *rpcpb.GetBatchContractStorageRequest) (*rpcpb.GetBatchContractStorageResponse, 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) GetCandidateBonus(ctx context.Context, req *rpcpb.GetAccountRequest) (*rpcpb.CandidateBonus, 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) GetContractStorageFields(ctx context.Context, req *rpcpb.GetContractStorageFieldsRequest) (*rpcpb.GetContractStorageFieldsResponse, error)
- func (as *APIService) GetContractVote(ctx context.Context, req *rpcpb.GetContractRequest) (*rpcpb.ContractVote, 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) GetProducerVoteInfo(ctx context.Context, req *rpcpb.GetProducerVoteInfoRequest) (*rpcpb.GetProducerVoteInfoResponse, error)
- func (as *APIService) GetRAMInfo(context.Context, *rpcpb.EmptyRequest) (*rpcpb.RAMInfoResponse, error)
- func (as *APIService) GetToken721Balance(ctx context.Context, req *rpcpb.GetTokenBalanceRequest) (*rpcpb.GetToken721BalanceResponse, error)
- func (as *APIService) GetToken721Metadata(ctx context.Context, req *rpcpb.GetToken721InfoRequest) (*rpcpb.GetToken721MetadataResponse, error)
- func (as *APIService) GetToken721Owner(ctx context.Context, req *rpcpb.GetToken721InfoRequest) (*rpcpb.GetToken721OwnerResponse, error)
- func (as *APIService) GetTokenBalance(ctx context.Context, req *rpcpb.GetTokenBalanceRequest) (*rpcpb.GetTokenBalanceResponse, error)
- func (as *APIService) GetTokenInfo(ctx context.Context, req *rpcpb.GetTokenInfoRequest) (*rpcpb.TokenInfo, 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) GetVoterBonus(ctx context.Context, req *rpcpb.GetAccountRequest) (*rpcpb.VoterBonus, error)
- func (as *APIService) ListContractStorage(ctx context.Context, req *rpcpb.ListContractStorageRequest) (*rpcpb.ListContractStorageResponse, 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 ¶
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 ¶
func (as *APIService) GetBatchContractStorage(ctx context.Context, req *rpcpb.GetBatchContractStorageRequest) (*rpcpb.GetBatchContractStorageResponse, error)
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 ¶
func (as *APIService) GetChainInfo(context.Context, *rpcpb.EmptyRequest) (*rpcpb.ChainInfoResponse, error)
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 ¶
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) GetContractStorageFields ¶
func (as *APIService) GetContractStorageFields(ctx context.Context, req *rpcpb.GetContractStorageFieldsRequest) (*rpcpb.GetContractStorageFieldsResponse, error)
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 ¶
func (as *APIService) GetNodeInfo(context.Context, *rpcpb.EmptyRequest) (*rpcpb.NodeInfoResponse, error)
GetNodeInfo returns information abount node.
func (*APIService) GetProducerVoteInfo ¶
func (as *APIService) GetProducerVoteInfo(ctx context.Context, req *rpcpb.GetProducerVoteInfoRequest) (*rpcpb.GetProducerVoteInfoResponse, error)
GetProducerVoteInfo returns producers's vote info
func (*APIService) GetRAMInfo ¶
func (as *APIService) GetRAMInfo(context.Context, *rpcpb.EmptyRequest) (*rpcpb.RAMInfoResponse, error)
GetRAMInfo returns the chain info.
func (*APIService) GetToken721Balance ¶
func (as *APIService) GetToken721Balance(ctx context.Context, req *rpcpb.GetTokenBalanceRequest) (*rpcpb.GetToken721BalanceResponse, error)
GetToken721Balance returns balance of account of an specific token721 token.
func (*APIService) GetToken721Metadata ¶
func (as *APIService) GetToken721Metadata(ctx context.Context, req *rpcpb.GetToken721InfoRequest) (*rpcpb.GetToken721MetadataResponse, error)
GetToken721Metadata returns metadata of an specific token721 token.
func (*APIService) GetToken721Owner ¶
func (as *APIService) GetToken721Owner(ctx context.Context, req *rpcpb.GetToken721InfoRequest) (*rpcpb.GetToken721OwnerResponse, error)
GetToken721Owner returns owner of an specific token721 token.
func (*APIService) GetTokenBalance ¶
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) 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 ¶
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 ¶
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 ¶
func (as *APIService) ListContractStorage(ctx context.Context, req *rpcpb.ListContractStorageRequest) (*rpcpb.ListContractStorageResponse, error)
nolint: gocyclo
func (*APIService) SendTransaction ¶
func (as *APIService) SendTransaction(ctx context.Context, req *rpcpb.TransactionRequest) (*rpcpb.SendTransactionResponse, error)
SendTransaction sends a transaction to iserver.
func (*APIService) Subscribe ¶
func (as *APIService) Subscribe(req *rpcpb.SubscribeRequest, res rpcpb.ApiService_SubscribeServer) error
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.