Documentation ¶
Index ¶
- Variables
- type BroadcastOutbound
- type Config
- type Option
- type Server
- func (api *Server) EstimateGasForAction(ctx context.Context, in *iotexapi.EstimateGasForActionRequest) (*iotexapi.EstimateGasForActionResponse, error)
- func (api *Server) GetAccount(ctx context.Context, in *iotexapi.GetAccountRequest) (*iotexapi.GetAccountResponse, error)
- func (api *Server) GetActions(ctx context.Context, in *iotexapi.GetActionsRequest) (*iotexapi.GetActionsResponse, error)
- func (api *Server) GetBlockMetas(ctx context.Context, in *iotexapi.GetBlockMetasRequest) (*iotexapi.GetBlockMetasResponse, error)
- func (api *Server) GetChainMeta(ctx context.Context, in *iotexapi.GetChainMetaRequest) (*iotexapi.GetChainMetaResponse, error)
- func (api *Server) GetReceiptByAction(ctx context.Context, in *iotexapi.GetReceiptByActionRequest) (*iotexapi.GetReceiptByActionResponse, error)
- func (api *Server) ReadContract(ctx context.Context, in *iotexapi.ReadContractRequest) (*iotexapi.ReadContractResponse, error)
- func (api *Server) ReadState(ctx context.Context, in *iotexapi.ReadStateRequest) (*iotexapi.ReadStateResponse, error)
- func (api *Server) SendAction(ctx context.Context, in *iotexapi.SendActionRequest) (res *iotexapi.SendActionResponse, err error)
- func (api *Server) Start() error
- func (api *Server) Stop() error
- func (api *Server) SuggestGasPrice(ctx context.Context, in *iotexapi.SuggestGasPriceRequest) (*iotexapi.SuggestGasPriceResponse, error)
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInternalServer indicates the internal server error ErrInternalServer = errors.New("internal server error") // ErrReceipt indicates the error of receipt ErrReceipt = errors.New("invalid receipt") // ErrAction indicates the error of action ErrAction = errors.New("invalid action") )
Functions ¶
This section is empty.
Types ¶
type BroadcastOutbound ¶
BroadcastOutbound sends a broadcast message to the whole network
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config represents the config to setup api
type Option ¶
Option is the option to override the api config
func WithBroadcastOutbound ¶
func WithBroadcastOutbound(broadcastHandler BroadcastOutbound) Option
WithBroadcastOutbound is the option to broadcast msg outbound
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server provides api for user to query blockchain data
func NewServer ¶
func NewServer( cfg config.API, chain blockchain.Blockchain, dispatcher dispatcher.Dispatcher, actPool actpool.ActPool, idx *indexservice.Server, registry *protocol.Registry, opts ...Option, ) (*Server, error)
NewServer creates a new server
func (*Server) EstimateGasForAction ¶
func (api *Server) EstimateGasForAction(ctx context.Context, in *iotexapi.EstimateGasForActionRequest) (*iotexapi.EstimateGasForActionResponse, error)
EstimateGasForAction estimates gas for action
func (*Server) GetAccount ¶
func (api *Server) GetAccount(ctx context.Context, in *iotexapi.GetAccountRequest) (*iotexapi.GetAccountResponse, error)
GetAccount returns the metadata of an account
func (*Server) GetActions ¶
func (api *Server) GetActions(ctx context.Context, in *iotexapi.GetActionsRequest) (*iotexapi.GetActionsResponse, error)
GetActions returns actions
func (*Server) GetBlockMetas ¶
func (api *Server) GetBlockMetas(ctx context.Context, in *iotexapi.GetBlockMetasRequest) (*iotexapi.GetBlockMetasResponse, error)
GetBlockMetas returns block metadata
func (*Server) GetChainMeta ¶
func (api *Server) GetChainMeta(ctx context.Context, in *iotexapi.GetChainMetaRequest) (*iotexapi.GetChainMetaResponse, error)
GetChainMeta returns blockchain metadata
func (*Server) GetReceiptByAction ¶
func (api *Server) GetReceiptByAction(ctx context.Context, in *iotexapi.GetReceiptByActionRequest) (*iotexapi.GetReceiptByActionResponse, error)
GetReceiptByAction gets receipt with corresponding action hash
func (*Server) ReadContract ¶
func (api *Server) ReadContract(ctx context.Context, in *iotexapi.ReadContractRequest) (*iotexapi.ReadContractResponse, error)
ReadContract reads the state in a contract address specified by the slot
func (*Server) ReadState ¶
func (api *Server) ReadState(ctx context.Context, in *iotexapi.ReadStateRequest) (*iotexapi.ReadStateResponse, error)
ReadState reads state on blockchain
func (*Server) SendAction ¶
func (api *Server) SendAction(ctx context.Context, in *iotexapi.SendActionRequest) (res *iotexapi.SendActionResponse, err error)
SendAction is the API to send an action to blockchain.
func (*Server) SuggestGasPrice ¶
func (api *Server) SuggestGasPrice(ctx context.Context, in *iotexapi.SuggestGasPriceRequest) (*iotexapi.SuggestGasPriceResponse, error)
SuggestGasPrice suggests gas price