Documentation ¶
Index ¶
- type BroadcastOutbound
- type Config
- type GRPCServer
- func (svr *GRPCServer) EstimateActionGasConsumption(ctx context.Context, in *iotexapi.EstimateActionGasConsumptionRequest) (respone *iotexapi.EstimateActionGasConsumptionResponse, err error)
- func (svr *GRPCServer) EstimateGasForAction(ctx context.Context, in *iotexapi.EstimateGasForActionRequest) (*iotexapi.EstimateGasForActionResponse, error)
- func (svr *GRPCServer) GetAccount(ctx context.Context, in *iotexapi.GetAccountRequest) (*iotexapi.GetAccountResponse, error)
- func (svr *GRPCServer) GetActPoolActions(ctx context.Context, in *iotexapi.GetActPoolActionsRequest) (*iotexapi.GetActPoolActionsResponse, error)
- func (svr *GRPCServer) GetActions(ctx context.Context, in *iotexapi.GetActionsRequest) (*iotexapi.GetActionsResponse, error)
- func (svr *GRPCServer) GetBlockMetas(ctx context.Context, in *iotexapi.GetBlockMetasRequest) (*iotexapi.GetBlockMetasResponse, error)
- func (svr *GRPCServer) GetChainMeta(ctx context.Context, in *iotexapi.GetChainMetaRequest) (*iotexapi.GetChainMetaResponse, error)
- func (svr *GRPCServer) GetElectionBuckets(ctx context.Context, in *iotexapi.GetElectionBucketsRequest) (*iotexapi.GetElectionBucketsResponse, error)
- func (svr *GRPCServer) GetEpochMeta(ctx context.Context, in *iotexapi.GetEpochMetaRequest) (*iotexapi.GetEpochMetaResponse, error)
- func (svr *GRPCServer) GetEvmTransfersByActionHash(ctx context.Context, in *iotexapi.GetEvmTransfersByActionHashRequest) (*iotexapi.GetEvmTransfersByActionHashResponse, error)
- func (svr *GRPCServer) GetEvmTransfersByBlockHeight(ctx context.Context, in *iotexapi.GetEvmTransfersByBlockHeightRequest) (*iotexapi.GetEvmTransfersByBlockHeightResponse, error)
- func (svr *GRPCServer) GetLogs(ctx context.Context, in *iotexapi.GetLogsRequest) (*iotexapi.GetLogsResponse, error)
- func (svr *GRPCServer) GetRawBlocks(ctx context.Context, in *iotexapi.GetRawBlocksRequest) (*iotexapi.GetRawBlocksResponse, error)
- func (svr *GRPCServer) GetReceiptByAction(ctx context.Context, in *iotexapi.GetReceiptByActionRequest) (*iotexapi.GetReceiptByActionResponse, error)
- func (svr *GRPCServer) GetServerMeta(ctx context.Context, in *iotexapi.GetServerMetaRequest) (*iotexapi.GetServerMetaResponse, error)
- func (svr *GRPCServer) GetTransactionLogByActionHash(ctx context.Context, in *iotexapi.GetTransactionLogByActionHashRequest) (*iotexapi.GetTransactionLogByActionHashResponse, error)
- func (svr *GRPCServer) GetTransactionLogByBlockHeight(ctx context.Context, in *iotexapi.GetTransactionLogByBlockHeightRequest) (*iotexapi.GetTransactionLogByBlockHeightResponse, error)
- func (svr *GRPCServer) ReadContract(ctx context.Context, in *iotexapi.ReadContractRequest) (*iotexapi.ReadContractResponse, error)
- func (svr *GRPCServer) ReadContractStorage(ctx context.Context, in *iotexapi.ReadContractStorageRequest) (*iotexapi.ReadContractStorageResponse, error)
- func (svr *GRPCServer) ReadState(ctx context.Context, in *iotexapi.ReadStateRequest) (*iotexapi.ReadStateResponse, error)
- func (svr *GRPCServer) SendAction(ctx context.Context, in *iotexapi.SendActionRequest) (*iotexapi.SendActionResponse, error)
- func (svr *GRPCServer) Start() error
- func (svr *GRPCServer) Stop() error
- func (svr *GRPCServer) StreamBlocks(in *iotexapi.StreamBlocksRequest, ...) error
- func (svr *GRPCServer) StreamLogs(in *iotexapi.StreamLogsRequest, stream iotexapi.APIService_StreamLogsServer) error
- func (svr *GRPCServer) SuggestGasPrice(ctx context.Context, in *iotexapi.SuggestGasPriceRequest) (*iotexapi.SuggestGasPriceResponse, error)
- type Listener
- type Option
- type ReadCache
- type ReadKey
- type Responder
- type Server
- func (api *Server) EstimateActionGasConsumption(ctx context.Context, in *iotexapi.EstimateActionGasConsumptionRequest) (respone *iotexapi.EstimateActionGasConsumptionResponse, err error)
- 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) GetActPoolActions(ctx context.Context, in *iotexapi.GetActPoolActionsRequest) (*iotexapi.GetActPoolActionsResponse, error)
- func (api *Server) GetActionByActionHash(h hash.Hash256) (action.SealedEnvelope, 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) GetElectionBuckets(ctx context.Context, in *iotexapi.GetElectionBucketsRequest) (*iotexapi.GetElectionBucketsResponse, error)
- func (api *Server) GetEpochMeta(ctx context.Context, in *iotexapi.GetEpochMetaRequest) (*iotexapi.GetEpochMetaResponse, error)
- func (api *Server) GetEvmTransfersByActionHash(ctx context.Context, in *iotexapi.GetEvmTransfersByActionHashRequest) (*iotexapi.GetEvmTransfersByActionHashResponse, error)
- func (api *Server) GetEvmTransfersByBlockHeight(ctx context.Context, in *iotexapi.GetEvmTransfersByBlockHeightRequest) (*iotexapi.GetEvmTransfersByBlockHeightResponse, error)
- func (api *Server) GetLogs(ctx context.Context, in *iotexapi.GetLogsRequest) (*iotexapi.GetLogsResponse, error)
- func (api *Server) GetRawBlocks(ctx context.Context, in *iotexapi.GetRawBlocksRequest) (*iotexapi.GetRawBlocksResponse, error)
- func (api *Server) GetReceiptByAction(ctx context.Context, in *iotexapi.GetReceiptByActionRequest) (*iotexapi.GetReceiptByActionResponse, error)
- func (api *Server) GetReceiptByActionHash(h hash.Hash256) (*action.Receipt, error)
- func (api *Server) GetServerMeta(ctx context.Context, in *iotexapi.GetServerMetaRequest) (*iotexapi.GetServerMetaResponse, error)
- func (api *Server) GetTransactionLogByActionHash(ctx context.Context, in *iotexapi.GetTransactionLogByActionHashRequest) (*iotexapi.GetTransactionLogByActionHashResponse, error)
- func (api *Server) GetTransactionLogByBlockHeight(ctx context.Context, in *iotexapi.GetTransactionLogByBlockHeightRequest) (*iotexapi.GetTransactionLogByBlockHeightResponse, error)
- func (api *Server) ReadContract(ctx context.Context, in *iotexapi.ReadContractRequest) (res *iotexapi.ReadContractResponse, err error)
- func (api *Server) ReadContractStorage(ctx context.Context, in *iotexapi.ReadContractStorageRequest) (*iotexapi.ReadContractStorageResponse, error)
- func (api *Server) ReadState(ctx context.Context, in *iotexapi.ReadStateRequest) (*iotexapi.ReadStateResponse, error)
- func (api *Server) SendAction(ctx context.Context, in *iotexapi.SendActionRequest) (*iotexapi.SendActionResponse, error)
- func (api *Server) Start() error
- func (api *Server) Stop() error
- func (api *Server) StreamBlocks(in *iotexapi.StreamBlocksRequest, ...) error
- func (api *Server) StreamLogs(in *iotexapi.StreamLogsRequest, stream iotexapi.APIService_StreamLogsServer) error
- func (api *Server) SuggestGasPrice(ctx context.Context, in *iotexapi.SuggestGasPriceRequest) (*iotexapi.SuggestGasPriceResponse, error)
- type ServerV2
- type ServiceClient
- type StreamBlocksServer
- type Web3Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
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 GRPCServer ¶ added in v1.6.3
type GRPCServer struct {
// contains filtered or unexported fields
}
GRPCServer contains grpc server and the pointer to api coreservice
func NewGRPCServer ¶ added in v1.6.3
func NewGRPCServer(core *coreService, grpcPort int) *GRPCServer
NewGRPCServer creates a new grpc server
func (*GRPCServer) EstimateActionGasConsumption ¶ added in v1.6.3
func (svr *GRPCServer) EstimateActionGasConsumption(ctx context.Context, in *iotexapi.EstimateActionGasConsumptionRequest) (respone *iotexapi.EstimateActionGasConsumptionResponse, err error)
EstimateActionGasConsumption estimate gas consume for action without signature
func (*GRPCServer) EstimateGasForAction ¶ added in v1.6.3
func (svr *GRPCServer) EstimateGasForAction(ctx context.Context, in *iotexapi.EstimateGasForActionRequest) (*iotexapi.EstimateGasForActionResponse, error)
EstimateGasForAction estimates gas for action
func (*GRPCServer) GetAccount ¶ added in v1.6.3
func (svr *GRPCServer) GetAccount(ctx context.Context, in *iotexapi.GetAccountRequest) (*iotexapi.GetAccountResponse, error)
GetAccount returns the metadata of an account
func (*GRPCServer) GetActPoolActions ¶ added in v1.6.3
func (svr *GRPCServer) GetActPoolActions(ctx context.Context, in *iotexapi.GetActPoolActionsRequest) (*iotexapi.GetActPoolActionsResponse, error)
GetActPoolActions returns the all Transaction Identifiers in the mempool
func (*GRPCServer) GetActions ¶ added in v1.6.3
func (svr *GRPCServer) GetActions(ctx context.Context, in *iotexapi.GetActionsRequest) (*iotexapi.GetActionsResponse, error)
GetActions returns actions
func (*GRPCServer) GetBlockMetas ¶ added in v1.6.3
func (svr *GRPCServer) GetBlockMetas(ctx context.Context, in *iotexapi.GetBlockMetasRequest) (*iotexapi.GetBlockMetasResponse, error)
GetBlockMetas returns block metadata
func (*GRPCServer) GetChainMeta ¶ added in v1.6.3
func (svr *GRPCServer) GetChainMeta(ctx context.Context, in *iotexapi.GetChainMetaRequest) (*iotexapi.GetChainMetaResponse, error)
GetChainMeta returns blockchain metadata
func (*GRPCServer) GetElectionBuckets ¶ added in v1.6.3
func (svr *GRPCServer) GetElectionBuckets(ctx context.Context, in *iotexapi.GetElectionBucketsRequest) (*iotexapi.GetElectionBucketsResponse, error)
GetElectionBuckets returns the native election buckets.
func (*GRPCServer) GetEpochMeta ¶ added in v1.6.3
func (svr *GRPCServer) GetEpochMeta(ctx context.Context, in *iotexapi.GetEpochMetaRequest) (*iotexapi.GetEpochMetaResponse, error)
GetEpochMeta gets epoch metadata
func (*GRPCServer) GetEvmTransfersByActionHash ¶ added in v1.6.3
func (svr *GRPCServer) GetEvmTransfersByActionHash(ctx context.Context, in *iotexapi.GetEvmTransfersByActionHashRequest) (*iotexapi.GetEvmTransfersByActionHashResponse, error)
GetEvmTransfersByActionHash returns evm transfers by action hash
func (*GRPCServer) GetEvmTransfersByBlockHeight ¶ added in v1.6.3
func (svr *GRPCServer) GetEvmTransfersByBlockHeight(ctx context.Context, in *iotexapi.GetEvmTransfersByBlockHeightRequest) (*iotexapi.GetEvmTransfersByBlockHeightResponse, error)
GetEvmTransfersByBlockHeight returns evm transfers by block height
func (*GRPCServer) GetLogs ¶ added in v1.6.3
func (svr *GRPCServer) GetLogs(ctx context.Context, in *iotexapi.GetLogsRequest) (*iotexapi.GetLogsResponse, error)
GetLogs get logs filtered by contract address and topics
func (*GRPCServer) GetRawBlocks ¶ added in v1.6.3
func (svr *GRPCServer) GetRawBlocks(ctx context.Context, in *iotexapi.GetRawBlocksRequest) (*iotexapi.GetRawBlocksResponse, error)
GetRawBlocks gets raw block data
func (*GRPCServer) GetReceiptByAction ¶ added in v1.6.3
func (svr *GRPCServer) GetReceiptByAction(ctx context.Context, in *iotexapi.GetReceiptByActionRequest) (*iotexapi.GetReceiptByActionResponse, error)
GetReceiptByAction gets receipt with corresponding action hash
func (*GRPCServer) GetServerMeta ¶ added in v1.6.3
func (svr *GRPCServer) GetServerMeta(ctx context.Context, in *iotexapi.GetServerMetaRequest) (*iotexapi.GetServerMetaResponse, error)
GetServerMeta gets the server metadata
func (*GRPCServer) GetTransactionLogByActionHash ¶ added in v1.6.3
func (svr *GRPCServer) GetTransactionLogByActionHash(ctx context.Context, in *iotexapi.GetTransactionLogByActionHashRequest) (*iotexapi.GetTransactionLogByActionHashResponse, error)
GetTransactionLogByActionHash returns transaction log by action hash
func (*GRPCServer) GetTransactionLogByBlockHeight ¶ added in v1.6.3
func (svr *GRPCServer) GetTransactionLogByBlockHeight(ctx context.Context, in *iotexapi.GetTransactionLogByBlockHeightRequest) (*iotexapi.GetTransactionLogByBlockHeightResponse, error)
GetTransactionLogByBlockHeight returns transaction log by block height
func (*GRPCServer) ReadContract ¶ added in v1.6.3
func (svr *GRPCServer) ReadContract(ctx context.Context, in *iotexapi.ReadContractRequest) (*iotexapi.ReadContractResponse, error)
ReadContract reads the state in a contract address specified by the slot
func (*GRPCServer) ReadContractStorage ¶ added in v1.6.3
func (svr *GRPCServer) ReadContractStorage(ctx context.Context, in *iotexapi.ReadContractStorageRequest) (*iotexapi.ReadContractStorageResponse, error)
ReadContractStorage reads contract's storage
func (*GRPCServer) ReadState ¶ added in v1.6.3
func (svr *GRPCServer) ReadState(ctx context.Context, in *iotexapi.ReadStateRequest) (*iotexapi.ReadStateResponse, error)
ReadState reads state on blockchain
func (*GRPCServer) SendAction ¶ added in v1.6.3
func (svr *GRPCServer) SendAction(ctx context.Context, in *iotexapi.SendActionRequest) (*iotexapi.SendActionResponse, error)
SendAction is the API to send an action to blockchain.
func (*GRPCServer) Start ¶ added in v1.6.3
func (svr *GRPCServer) Start() error
Start starts the GRPC server
func (*GRPCServer) Stop ¶ added in v1.6.3
func (svr *GRPCServer) Stop() error
Stop stops the GRPC server
func (*GRPCServer) StreamBlocks ¶ added in v1.6.3
func (svr *GRPCServer) StreamBlocks(in *iotexapi.StreamBlocksRequest, stream iotexapi.APIService_StreamBlocksServer) error
StreamBlocks streams blocks
func (*GRPCServer) StreamLogs ¶ added in v1.6.3
func (svr *GRPCServer) StreamLogs(in *iotexapi.StreamLogsRequest, stream iotexapi.APIService_StreamLogsServer) error
StreamLogs streams logs that match the filter condition
func (*GRPCServer) SuggestGasPrice ¶ added in v1.6.3
func (svr *GRPCServer) SuggestGasPrice(ctx context.Context, in *iotexapi.SuggestGasPriceRequest) (*iotexapi.SuggestGasPriceResponse, error)
SuggestGasPrice suggests gas price
type Listener ¶ added in v0.7.1
type Listener interface { Start() error Stop() error ReceiveBlock(*block.Block) error AddResponder(Responder) error }
Listener pass new block to all responders
func NewChainListener ¶ added in v0.7.1
NewChainListener returns a new blockchain chainListener
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
func WithNativeElection ¶ added in v0.9.0
WithNativeElection is the option to return native election data through API.
type ReadCache ¶ added in v1.5.0
type ReadCache struct {
// contains filtered or unexported fields
}
ReadCache stores read results
func NewReadCache ¶ added in v1.5.0
func NewReadCache() *ReadCache
NewReadCache returns a new read cache
func (*ReadCache) Exit ¶ added in v1.5.0
func (rc *ReadCache) Exit()
Exit implements the Responder interface
type ReadKey ¶ added in v1.5.0
type ReadKey struct { Name string `json:"name,omitempty"` Height string `json:"height,omitempty"` Method []byte `json:"method,omitempty"` Args [][]byte `json:"args,omitempty"` }
ReadKey represents a read key
type Responder ¶ added in v0.7.1
Responder responds to new block
func NewBlockListener ¶ added in v0.7.1
func NewBlockListener(stream iotexapi.APIService_StreamBlocksServer, errChan chan error) Responder
NewBlockListener returns a new block listener
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.Config, chain blockchain.Blockchain, bs blocksync.BlockSync, sf factory.Factory, dao blockdao.BlockDAO, indexer blockindex.Indexer, bfIndexer blockindex.BloomFilterIndexer, actPool actpool.ActPool, registry *protocol.Registry, opts ...Option, ) (*Server, error)
NewServer creates a new server
func (*Server) EstimateActionGasConsumption ¶ added in v0.7.2
func (api *Server) EstimateActionGasConsumption(ctx context.Context, in *iotexapi.EstimateActionGasConsumptionRequest) (respone *iotexapi.EstimateActionGasConsumptionResponse, err error)
EstimateActionGasConsumption estimate gas consume for action without signature
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) GetActPoolActions ¶ added in v1.1.3
func (api *Server) GetActPoolActions(ctx context.Context, in *iotexapi.GetActPoolActionsRequest) (*iotexapi.GetActPoolActionsResponse, error)
GetActPoolActions returns the all Transaction Identifiers in the mempool
func (*Server) GetActionByActionHash ¶ added in v0.11.0
GetActionByActionHash returns action by action hash
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) GetElectionBuckets ¶ added in v0.9.0
func (api *Server) GetElectionBuckets( ctx context.Context, in *iotexapi.GetElectionBucketsRequest, ) (*iotexapi.GetElectionBucketsResponse, error)
GetElectionBuckets returns the native election buckets.
func (*Server) GetEpochMeta ¶
func (api *Server) GetEpochMeta( ctx context.Context, in *iotexapi.GetEpochMetaRequest, ) (*iotexapi.GetEpochMetaResponse, error)
GetEpochMeta gets epoch metadata
func (*Server) GetEvmTransfersByActionHash ¶ added in v1.0.0
func (api *Server) GetEvmTransfersByActionHash(ctx context.Context, in *iotexapi.GetEvmTransfersByActionHashRequest) (*iotexapi.GetEvmTransfersByActionHashResponse, error)
GetEvmTransfersByActionHash returns evm transfers by action hash
func (*Server) GetEvmTransfersByBlockHeight ¶ added in v1.0.0
func (api *Server) GetEvmTransfersByBlockHeight(ctx context.Context, in *iotexapi.GetEvmTransfersByBlockHeightRequest) (*iotexapi.GetEvmTransfersByBlockHeightResponse, error)
GetEvmTransfersByBlockHeight returns evm transfers by block height
func (*Server) GetLogs ¶ added in v0.7.1
func (api *Server) GetLogs( ctx context.Context, in *iotexapi.GetLogsRequest, ) (*iotexapi.GetLogsResponse, error)
GetLogs get logs filtered by contract address and topics
func (*Server) GetRawBlocks ¶ added in v0.6.0
func (api *Server) GetRawBlocks( ctx context.Context, in *iotexapi.GetRawBlocksRequest, ) (*iotexapi.GetRawBlocksResponse, error)
GetRawBlocks gets raw block data
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) GetReceiptByActionHash ¶ added in v0.11.0
GetReceiptByActionHash returns receipt by action hash
func (*Server) GetServerMeta ¶
func (api *Server) GetServerMeta(ctx context.Context, in *iotexapi.GetServerMetaRequest) (*iotexapi.GetServerMetaResponse, error)
GetServerMeta gets the server metadata
func (*Server) GetTransactionLogByActionHash ¶ added in v1.1.0
func (api *Server) GetTransactionLogByActionHash( ctx context.Context, in *iotexapi.GetTransactionLogByActionHashRequest) (*iotexapi.GetTransactionLogByActionHashResponse, error)
GetTransactionLogByActionHash returns transaction log by action hash
func (*Server) GetTransactionLogByBlockHeight ¶ added in v1.1.0
func (api *Server) GetTransactionLogByBlockHeight( ctx context.Context, in *iotexapi.GetTransactionLogByBlockHeightRequest) (*iotexapi.GetTransactionLogByBlockHeightResponse, error)
GetTransactionLogByBlockHeight returns transaction log by block height
func (*Server) ReadContract ¶
func (api *Server) ReadContract(ctx context.Context, in *iotexapi.ReadContractRequest) (res *iotexapi.ReadContractResponse, err error)
ReadContract reads the state in a contract address specified by the slot
func (*Server) ReadContractStorage ¶ added in v1.6.1
func (api *Server) ReadContractStorage(ctx context.Context, in *iotexapi.ReadContractStorageRequest) (*iotexapi.ReadContractStorageResponse, error)
ReadContractStorage reads contract's storage
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) (*iotexapi.SendActionResponse, error)
SendAction is the API to send an action to blockchain.
func (*Server) StreamBlocks ¶ added in v0.6.0
func (api *Server) StreamBlocks(in *iotexapi.StreamBlocksRequest, stream iotexapi.APIService_StreamBlocksServer) error
StreamBlocks streams blocks
func (*Server) StreamLogs ¶ added in v0.7.1
func (api *Server) StreamLogs(in *iotexapi.StreamLogsRequest, stream iotexapi.APIService_StreamLogsServer) error
StreamLogs streams logs that match the filter condition
func (*Server) SuggestGasPrice ¶
func (api *Server) SuggestGasPrice(ctx context.Context, in *iotexapi.SuggestGasPriceRequest) (*iotexapi.SuggestGasPriceResponse, error)
SuggestGasPrice suggests gas price
type ServerV2 ¶ added in v1.6.3
type ServerV2 struct { GrpcServer *GRPCServer // contains filtered or unexported fields }
ServerV2 provides api for user to interact with blockchain data
func NewServerV2 ¶ added in v1.6.3
func NewServerV2( cfg config.Config, chain blockchain.Blockchain, bs blocksync.BlockSync, sf factory.Factory, dao blockdao.BlockDAO, indexer blockindex.Indexer, bfIndexer blockindex.BloomFilterIndexer, actPool actpool.ActPool, registry *protocol.Registry, opts ...Option, ) (*ServerV2, error)
NewServerV2 creates a new server with coreService and GRPC Server
type ServiceClient ¶ added in v0.6.0
type ServiceClient interface { // get the address detail of an address GetAccount(ctx context.Context, in *iotexapi.GetAccountRequest, opts ...grpc.CallOption) (*iotexapi.GetAccountResponse, error) // get action(s) by: // 1. start index and action count // 2. action hash // 3. address with start index and action count // 4. get unconfirmed actions by address with start index and action count // 5. block hash with start index and action count GetActions(ctx context.Context, in *iotexapi.GetActionsRequest, opts ...grpc.CallOption) (*iotexapi.GetActionsResponse, error) // get block metadata(s) by: // 1. start index and block count // 2. block hash GetBlockMetas(ctx context.Context, in *iotexapi.GetBlockMetasRequest, opts ...grpc.CallOption) (*iotexapi.GetBlockMetasResponse, error) // get chain metadata GetChainMeta(ctx context.Context, in *iotexapi.GetChainMetaRequest, opts ...grpc.CallOption) (*iotexapi.GetChainMetaResponse, error) // get server version GetServerMeta(ctx context.Context, in *iotexapi.GetServerMetaRequest, opts ...grpc.CallOption) (*iotexapi.GetServerMetaResponse, error) // sendAction SendAction(ctx context.Context, in *iotexapi.SendActionRequest, opts ...grpc.CallOption) (*iotexapi.SendActionResponse, error) // get receipt by action Hash GetReceiptByAction(ctx context.Context, in *iotexapi.GetReceiptByActionRequest, opts ...grpc.CallOption) (*iotexapi.GetReceiptByActionResponse, error) // TODO: read contract ReadContract(ctx context.Context, in *iotexapi.ReadContractRequest, opts ...grpc.CallOption) (*iotexapi.ReadContractResponse, error) // suggest gas price SuggestGasPrice(ctx context.Context, in *iotexapi.SuggestGasPriceRequest, opts ...grpc.CallOption) (*iotexapi.SuggestGasPriceResponse, error) // estimate gas for action EstimateGasForAction(ctx context.Context, in *iotexapi.EstimateGasForActionRequest, opts ...grpc.CallOption) (*iotexapi.EstimateGasForActionResponse, error) // estimate gas for action and transfer not sealed EstimateActionGasConsumption(ctx context.Context, in *iotexapi.EstimateActionGasConsumptionRequest, opts ...grpc.CallOption) (*iotexapi.EstimateActionGasConsumptionResponse, error) // read state from blockchain ReadState(ctx context.Context, in *iotexapi.ReadStateRequest, opts ...grpc.CallOption) (*iotexapi.ReadStateResponse, error) // get epoch metadata GetEpochMeta(ctx context.Context, in *iotexapi.GetEpochMetaRequest, opts ...grpc.CallOption) (*iotexapi.GetEpochMetaResponse, error) // get raw blocks data GetRawBlocks(ctx context.Context, in *iotexapi.GetRawBlocksRequest, opts ...grpc.CallOption) (*iotexapi.GetRawBlocksResponse, error) // get logs filtered by contract address and topics GetLogs(ctx context.Context, in *iotexapi.GetLogsRequest, opts ...grpc.CallOption) (*iotexapi.GetLogsResponse, error) // deprecated GetEvmTransfersByActionHash(ctx context.Context, in *iotexapi.GetEvmTransfersByActionHashRequest, opts ...grpc.CallOption) (*iotexapi.GetEvmTransfersByActionHashResponse, error) // deprecated GetEvmTransfersByBlockHeight(ctx context.Context, in *iotexapi.GetEvmTransfersByBlockHeightRequest, opts ...grpc.CallOption) (*iotexapi.GetEvmTransfersByBlockHeightResponse, error) // get transaction log by action hash GetTransactionLogByActionHash(ctx context.Context, in *iotexapi.GetTransactionLogByActionHashRequest, opts ...grpc.CallOption) (*iotexapi.GetTransactionLogByActionHashResponse, error) // get transaction log by block height GetTransactionLogByBlockHeight(ctx context.Context, in *iotexapi.GetTransactionLogByBlockHeightRequest, opts ...grpc.CallOption) (*iotexapi.GetTransactionLogByBlockHeightResponse, error) // get block info in stream StreamBlocks(ctx context.Context, in *iotexapi.StreamBlocksRequest, opts ...grpc.CallOption) (iotexapi.APIService_StreamBlocksClient, error) // get filtered logs in stream StreamLogs(ctx context.Context, in *iotexapi.StreamLogsRequest, opts ...grpc.CallOption) (iotexapi.APIService_StreamLogsClient, error) // get native election buckets GetElectionBuckets(ctx context.Context, in *iotexapi.GetElectionBucketsRequest, opts ...grpc.CallOption) (*iotexapi.GetElectionBucketsResponse, error) // get actions from act pool GetActPoolActions(ctx context.Context, in *iotexapi.GetActPoolActionsRequest, opts ...grpc.CallOption) (*iotexapi.GetActPoolActionsResponse, error) // read contract storage ReadContractStorage(ctx context.Context, in *iotexapi.ReadContractStorageRequest, opts ...grpc.CallOption) (*iotexapi.ReadContractStorageResponse, error) }
ServiceClient is the api service client interface corresponding to the one in github.com/iotexproject/iotex-proto. This interface is used by mockgen for test purposes. Remember to update it whenever definitions in api.proto change.
type StreamBlocksServer ¶ added in v1.1.0
type StreamBlocksServer interface { Send(*iotexapi.StreamBlocksResponse) error grpc.ServerStream }
StreamBlocksServer defines the interface of a rpc stream server
type Web3Server ¶ added in v1.6.3
type Web3Server struct {
// contains filtered or unexported fields
}
Web3Server contains web3 server and the pointer to api coreservice
func NewWeb3Server ¶ added in v1.6.3
func NewWeb3Server(core *coreService, httpPort int, cacheURL string) *Web3Server
NewWeb3Server creates a new web3 server
func (*Web3Server) ServeHTTP ¶ added in v1.6.3
func (svr *Web3Server) ServeHTTP(w http.ResponseWriter, req *http.Request)
func (*Web3Server) Start ¶ added in v1.6.3
func (svr *Web3Server) Start() error
Start starts the API server
func (*Web3Server) Stop ¶ added in v1.6.3
func (svr *Web3Server) Stop() error
Stop stops the API server