Documentation ¶
Index ¶
- Variables
- func MustInitFromViper()
- type CfxCache
- type EthCache
- func (cache *EthCache) Call(client *node.Web3goClient, callRequest types.CallRequest, ...) ([]byte, error)
- func (cache *EthCache) GetBlockNumber(client *node.Web3goClient) (*hexutil.Big, error)
- func (cache *EthCache) GetChainId(client *web3go.Client) (*hexutil.Uint64, error)
- func (cache *EthCache) GetClientVersion(client *web3go.Client) (string, error)
- func (cache *EthCache) GetGasPrice(client *web3go.Client) (*hexutil.Big, error)
- func (cache *EthCache) GetNetVersion(client *web3go.Client) (string, error)
- type EthCacheConfig
- type StatusCache
Constants ¶
This section is empty.
Variables ¶
View Source
var CfxDefault = NewCfx()
Functions ¶
func MustInitFromViper ¶
func MustInitFromViper()
Types ¶
type CfxCache ¶
type CfxCache struct { *StatusCache // contains filtered or unexported fields }
CfxCache memory cache for some core space RPC methods
func (*CfxCache) GetClientVersion ¶
func (cache *CfxCache) GetClientVersion(cfx sdk.ClientOperator) (string, error)
func (*CfxCache) GetGasPrice ¶
type EthCache ¶
type EthCache struct {
// contains filtered or unexported fields
}
EthCache memory cache for some evm space RPC methods
var (
EthDefault *EthCache = newEthCache(newEthCacheConfig())
)
func (*EthCache) Call ¶
func (cache *EthCache) Call(client *node.Web3goClient, callRequest types.CallRequest, blockNum *types.BlockNumberOrHash) ([]byte, error)
func (*EthCache) GetBlockNumber ¶
func (*EthCache) GetChainId ¶
func (*EthCache) GetClientVersion ¶
func (*EthCache) GetGasPrice ¶
type EthCacheConfig ¶
type EthCacheConfig struct { NetVersionExpiration time.Duration `default:"1m"` ClientVersionExpiration time.Duration `default:"1m"` ChainIdExpiration time.Duration `default:"8760h"` BlockNumberExpiration time.Duration `default:"1s"` PriceExpiration time.Duration `default:"3s"` CallCacheExpiration time.Duration `default:"1s"` CallCacheSize int `default:"128"` }
type StatusCache ¶
type StatusCache struct {
// contains filtered or unexported fields
}
StatusCache memory cache for core space status related RPC method suites.
func NewStatusCache ¶
func NewStatusCache() *StatusCache
func (*StatusCache) GetBestBlockHash ¶
func (c *StatusCache) GetBestBlockHash(cfx sdk.ClientOperator) (types.Hash, error)
func (*StatusCache) GetEpochNumber ¶
func (c *StatusCache) GetEpochNumber(cfx sdk.ClientOperator, epoch *types.Epoch) (*hexutil.Big, error)
func (*StatusCache) GetStatus ¶
func (c *StatusCache) GetStatus(cfx sdk.ClientOperator) (types.Status, error)
Click to show internal directories.
Click to hide internal directories.