Documentation ¶
Index ¶
- Variables
- type NodeApiResolver
- func (nar *NodeApiResolver) ComputeTransactionGasLimit(tx *transaction.Transaction) (uint64, error)
- func (nar *NodeApiResolver) ExecuteSCQuery(query *process.SCQuery) (*vmcommon.VMOutput, error)
- func (nar *NodeApiResolver) IsInterfaceNil() bool
- func (nar *NodeApiResolver) StatusMetrics() StatusMetricsHandler
- type SCQueryService
- type StatusMetricsHandler
- type TransactionCostHandler
Constants ¶
This section is empty.
Variables ¶
var ErrNilSCQueryService = errors.New("nil SC query service")
ErrNilSCQueryService signals that a nil SC query service has been provided
var ErrNilStatusMetrics = errors.New("nil status metrics handler")
ErrNilStatusMetrics signals that a nil status metrics was provided
var ErrNilTransactionCostHandler = errors.New("nil transaction cost handler")
ErrNilTransactionCostHandler signals that a nil transaction cost handler was provided
Functions ¶
This section is empty.
Types ¶
type NodeApiResolver ¶
type NodeApiResolver struct {
// contains filtered or unexported fields
}
NodeApiResolver can resolve API requests
func NewNodeApiResolver ¶
func NewNodeApiResolver( scQueryService SCQueryService, statusMetricsHandler StatusMetricsHandler, txCostHandler TransactionCostHandler, ) (*NodeApiResolver, error)
NewNodeApiResolver creates a new NodeApiResolver instance
func (*NodeApiResolver) ComputeTransactionGasLimit ¶
func (nar *NodeApiResolver) ComputeTransactionGasLimit(tx *transaction.Transaction) (uint64, error)
ComputeTransactionGasLimit will calculate how many gas a transaction will consume
func (*NodeApiResolver) ExecuteSCQuery ¶
ExecuteSCQuery retrieves data stored in a SC account through a VM
func (*NodeApiResolver) IsInterfaceNil ¶
func (nar *NodeApiResolver) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*NodeApiResolver) StatusMetrics ¶
func (nar *NodeApiResolver) StatusMetrics() StatusMetricsHandler
StatusMetrics returns an implementation of the StatusMetricsHandler interface
type SCQueryService ¶
type SCQueryService interface { ExecuteQuery(query *process.SCQuery) (*vmcommon.VMOutput, error) ComputeScCallGasLimit(tx *transaction.Transaction) (uint64, error) IsInterfaceNil() bool }
SCQueryService defines how data should be get from a SC account
type StatusMetricsHandler ¶
type StatusMetricsHandler interface { StatusMetricsMapWithoutP2P() map[string]interface{} StatusP2pMetricsMap() map[string]interface{} StatusMetricsWithoutP2PPrometheusString() string EconomicsMetrics() map[string]interface{} ConfigMetrics() map[string]interface{} NetworkMetrics() map[string]interface{} IsInterfaceNil() bool }
StatusMetricsHandler is the interface that defines what a node details handler/provider should do
type TransactionCostHandler ¶
type TransactionCostHandler interface { ComputeTransactionGasLimit(tx *transaction.Transaction) (uint64, error) IsInterfaceNil() bool }
TransactionCostHandler defines the actions which should be handler by a transaction cost estimator