Documentation ¶
Index ¶
- func Accounts(clientCtx client.Context) ([]common.Address, error)
- func DefaultGethNodeConfig() *node.Config
- func GetAPIs(clientCtx client.Context, wsClient *rpcclient.WSClient, logger log.Logger, ...) []rpc.API
- func NewNode(config *node.Config) (types.NetworkingStack, error)
- type ArtelaService
- type BackendImpl
- func (b *BackendImpl) Accounts() []common.Address
- func (b *BackendImpl) ArtBlockByNumber(_ context.Context, number rpc.BlockNumber) (*rpctypes.Block, error)
- func (b *BackendImpl) BaseFee(blockRes *tmrpctypes.ResultBlockResults) (*big.Int, error)
- func (b *BackendImpl) BlockBloom(blockRes *tmrpctypes.ResultBlockResults) (ethtypes.Bloom, error)
- func (b *BackendImpl) BlockByHash(_ context.Context, hash common.Hash) (*rpctypes.Block, error)
- func (b *BackendImpl) BlockByNumber(_ context.Context, number rpc.BlockNumber) (*ethtypes.Block, error)
- func (b *BackendImpl) BlockByNumberOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (*rpctypes.Block, error)
- func (b *BackendImpl) BlockFromCosmosBlock(resBlock *tmrpctypes.ResultBlock, blockRes *tmrpctypes.ResultBlockResults) (*rpctypes.Block, error)
- func (b *BackendImpl) BlockNumber() (hexutil.Uint64, error)
- func (b *BackendImpl) BlockTimeByNumber(blockNum int64) (uint64, error)
- func (b *BackendImpl) BloomStatus() (uint64, uint64)
- func (b *BackendImpl) ChainConfig() *params.ChainConfig
- func (b *BackendImpl) ChainDb() ethdb.Database
- func (b *BackendImpl) ClientVersion() string
- func (b *BackendImpl) CosmosBlockByHash(blockHash common.Hash) (*tmrpctypes.ResultBlock, error)
- func (b *BackendImpl) CosmosBlockByNumber(blockNum rpc.BlockNumber) (*tmrpctypes.ResultBlock, error)
- func (b *BackendImpl) CosmosBlockResultByNumber(height *int64) (*tmrpctypes.ResultBlockResults, error)
- func (b *BackendImpl) CurrentBlock() *rpctypes.Block
- func (b *BackendImpl) CurrentHeader() *ethtypes.Header
- func (b *BackendImpl) DoCall(args ethapi.TransactionArgs, blockNrOrHash rpc.BlockNumberOrHash) (*txs.MsgEthereumTxResponse, error)
- func (b *BackendImpl) Engine() consensus.Engine
- func (b *BackendImpl) EstimateGas(ctx context.Context, args ethapi.TransactionArgs, ...) (hexutil.Uint64, error)
- func (b *BackendImpl) EthMsgsFromCosmosBlock(resBlock *tmrpctypes.ResultBlock, blockRes *tmrpctypes.ResultBlockResults) []*txs.MsgEthereumTx
- func (b *BackendImpl) ExtRPCEnabled() bool
- func (b *BackendImpl) FeeHistory(blockCount uint64, lastBlock rpc.BlockNumber, rewardPercentiles []float64) (*rpctypes.FeeHistoryResult, error)
- func (b *BackendImpl) GasPrice(ctx context.Context) (*hexutil.Big, error)
- func (b *BackendImpl) GetBalance(address common.Address, blockNrOrHash rpc.BlockNumberOrHash) (*hexutil.Big, error)
- func (b *BackendImpl) GetBlockByNumber(blockNum rpc.BlockNumber, fullTx bool) (map[string]interface{}, error)
- func (b *BackendImpl) GetBody(ctx context.Context, hash common.Hash, number rpc.BlockNumber) (*ethtypes.Body, error)
- func (b *BackendImpl) GetCode(address common.Address, blockNrOrHash rpc.BlockNumberOrHash) (hexutil.Bytes, error)
- func (b *BackendImpl) GetEVM(ctx context.Context, msg *core.Message, state *state.StateDB, ...) (*vm.EVM, func() error)
- func (b *BackendImpl) GetLogs(_ context.Context, blockHash common.Hash, number uint64) ([][]*ethtypes.Log, error)
- func (b *BackendImpl) GetPoolNonce(_ context.Context, addr common.Address) (uint64, error)
- func (b *BackendImpl) GetPoolTransaction(txHash common.Hash) *ethtypes.Transaction
- func (b *BackendImpl) GetPoolTransactions() (ctypes.Transactions, error)
- func (b *BackendImpl) GetReceipts(_ context.Context, hash common.Hash) (types.Receipts, error)
- func (b *BackendImpl) GetSender(msg *txs.MsgEthereumTx, chainID *big.Int) (from common.Address, err error)
- func (b *BackendImpl) GetStorageAt(address common.Address, key string, blockNrOrHash rpc.BlockNumberOrHash) (hexutil.Bytes, error)
- func (b *BackendImpl) GetTd(_ context.Context, hash common.Hash) *big.Int
- func (b *BackendImpl) GetTransaction(ctx context.Context, txHash common.Hash) (*ethapi.RPCTransaction, error)
- func (b *BackendImpl) GetTransactionCount(address common.Address, blockNrOrHash rpc.BlockNumberOrHash) (*hexutil.Uint64, error)
- func (b *BackendImpl) GetTransactionReceipt(ctx context.Context, hash common.Hash) (map[string]interface{}, error)
- func (b *BackendImpl) GetTxByEthHash(hash common.Hash) (*types.TxResult, error)
- func (b *BackendImpl) GlobalMinGasPrice() (sdktypes.Dec, error)
- func (b *BackendImpl) HeaderByHash(_ context.Context, hash common.Hash) (*ethtypes.Header, error)
- func (b *BackendImpl) HeaderByNumber(_ context.Context, number rpc.BlockNumber) (*ethtypes.Header, error)
- func (b *BackendImpl) HeaderByNumberOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (*ethtypes.Header, error)
- func (b *BackendImpl) ImportRawKey(privkey, password string) (common.Address, error)
- func (b *BackendImpl) Listening() bool
- func (b *BackendImpl) NewAccount(password string) (common.AddressEIP55, error)
- func (b *BackendImpl) PeerCount() hexutil.Uint
- func (b *BackendImpl) PendingBlockAndReceipts() (*ethtypes.Block, types.Receipts)
- func (b *BackendImpl) PendingTransactions() ([]*sdktypes.Tx, error)
- func (b *BackendImpl) RPCBlockRangeCap() int32
- func (b *BackendImpl) RPCEVMTimeout() time.Duration
- func (b *BackendImpl) RPCFilterCap() int32
- func (b *BackendImpl) RPCGasCap() uint64
- func (b *BackendImpl) RPCLogsCap() int32
- func (b *BackendImpl) RPCMinGasPrice() int64
- func (b *BackendImpl) RPCTxFeeCap() float64
- func (b *BackendImpl) SendTx(ctx context.Context, signedTx *ethtypes.Transaction) error
- func (b *BackendImpl) ServiceFilter(_ context.Context, _ *bloombits.MatcherSession)
- func (b *BackendImpl) SetHead(_ uint64)
- func (b *BackendImpl) Sign(address common.Address, data hexutil.Bytes) (hexutil.Bytes, error)
- func (b *BackendImpl) SignTransaction(args *ethapi2.TransactionArgs) (*ethtypes.Transaction, error)
- func (b *BackendImpl) StateAndHeaderByNumber(ctx context.Context, number rpc.BlockNumber) (*state.StateDB, *ethtypes.Header, error)
- func (b *BackendImpl) StateAndHeaderByNumberOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (*state.StateDB, *ethtypes.Header, error)
- func (b *BackendImpl) Stats() (int, int)
- func (b *BackendImpl) SubscribeChainEvent(ch chan<- core.ChainEvent) event.Subscription
- func (b *BackendImpl) SubscribeChainHeadEvent(ch chan<- core.ChainHeadEvent) event.Subscription
- func (b *BackendImpl) SubscribeChainSideEvent(ch chan<- core.ChainSideEvent) event.Subscription
- func (b *BackendImpl) SubscribeLogsEvent(ch chan<- []*ethtypes.Log) event.Subscription
- func (b *BackendImpl) SubscribeNewTxsEvent(ch chan<- core.NewTxsEvent) event.Subscription
- func (b *BackendImpl) SubscribePendingLogsEvent(ch chan<- []*ethtypes.Log) event.Subscription
- func (b *BackendImpl) SubscribeRemovedLogsEvent(ch chan<- core.RemovedLogsEvent) event.Subscription
- func (b *BackendImpl) SuggestGasTipCap(baseFee *big.Int) (*big.Int, error)
- func (b *BackendImpl) SyncProgress() ethereum.SyncProgress
- func (b *BackendImpl) TxPoolContent() (map[common.Address]ctypes.Transactions, map[common.Address]ctypes.Transactions)
- func (b *BackendImpl) TxPoolContentFrom(addr common.Address) (ctypes.Transactions, ctypes.Transactions)
- func (b *BackendImpl) UnprotectedAllowed() bool
- func (b *BackendImpl) Version() string
- type Config
- type Node
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultGethNodeConfig ¶
DefaultConfig returns the default configuration for the provider.
Types ¶
type ArtelaService ¶
type ArtelaService struct {
// contains filtered or unexported fields
}
func NewArtelaService ¶
func (*ArtelaService) APIs ¶
func (art *ArtelaService) APIs() []rpc.API
func (*ArtelaService) Shutdown ¶
func (art *ArtelaService) Shutdown() error
func (*ArtelaService) Start ¶
func (art *ArtelaService) Start() error
Start start the ethereum JsonRPC service
type BackendImpl ¶
type BackendImpl struct {
// contains filtered or unexported fields
}
backend represents the backend for the JSON-RPC service.
func NewBackend ¶
func NewBackend( ctx *server.Context, clientCtx client.Context, artela *ArtelaService, extRPCEnabled bool, cfg *Config, logger log.Logger, ) *BackendImpl
NewBackend create the backend instance
func (*BackendImpl) Accounts ¶
func (b *BackendImpl) Accounts() []common.Address
func (*BackendImpl) ArtBlockByNumber ¶
func (b *BackendImpl) ArtBlockByNumber(_ context.Context, number rpc.BlockNumber) (*rpctypes.Block, error)
func (*BackendImpl) BaseFee ¶
func (b *BackendImpl) BaseFee(blockRes *tmrpctypes.ResultBlockResults) (*big.Int, error)
func (*BackendImpl) BlockBloom ¶
func (b *BackendImpl) BlockBloom(blockRes *tmrpctypes.ResultBlockResults) (ethtypes.Bloom, error)
func (*BackendImpl) BlockByHash ¶
func (*BackendImpl) BlockByNumber ¶
func (b *BackendImpl) BlockByNumber(_ context.Context, number rpc.BlockNumber) (*ethtypes.Block, error)
func (*BackendImpl) BlockByNumberOrHash ¶
func (b *BackendImpl) BlockByNumberOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (*rpctypes.Block, error)
func (*BackendImpl) BlockFromCosmosBlock ¶
func (b *BackendImpl) BlockFromCosmosBlock(resBlock *tmrpctypes.ResultBlock, blockRes *tmrpctypes.ResultBlockResults) (*rpctypes.Block, error)
func (*BackendImpl) BlockNumber ¶
func (b *BackendImpl) BlockNumber() (hexutil.Uint64, error)
func (*BackendImpl) BlockTimeByNumber ¶
func (b *BackendImpl) BlockTimeByNumber(blockNum int64) (uint64, error)
func (*BackendImpl) BloomStatus ¶
func (b *BackendImpl) BloomStatus() (uint64, uint64)
func (*BackendImpl) ChainConfig ¶
func (b *BackendImpl) ChainConfig() *params.ChainConfig
func (*BackendImpl) ChainDb ¶
func (b *BackendImpl) ChainDb() ethdb.Database
func (*BackendImpl) ClientVersion ¶
func (b *BackendImpl) ClientVersion() string
ClientVersion returns the current client version.
func (*BackendImpl) CosmosBlockByHash ¶
func (b *BackendImpl) CosmosBlockByHash(blockHash common.Hash) (*tmrpctypes.ResultBlock, error)
func (*BackendImpl) CosmosBlockByNumber ¶
func (b *BackendImpl) CosmosBlockByNumber(blockNum rpc.BlockNumber) (*tmrpctypes.ResultBlock, error)
func (*BackendImpl) CosmosBlockResultByNumber ¶
func (b *BackendImpl) CosmosBlockResultByNumber(height *int64) (*tmrpctypes.ResultBlockResults, error)
func (*BackendImpl) CurrentBlock ¶
func (b *BackendImpl) CurrentBlock() *rpctypes.Block
func (*BackendImpl) CurrentHeader ¶
func (b *BackendImpl) CurrentHeader() *ethtypes.Header
func (*BackendImpl) DoCall ¶
func (b *BackendImpl) DoCall(args ethapi.TransactionArgs, blockNrOrHash rpc.BlockNumberOrHash) (*txs.MsgEthereumTxResponse, error)
func (*BackendImpl) Engine ¶
func (b *BackendImpl) Engine() consensus.Engine
func (*BackendImpl) EstimateGas ¶
func (b *BackendImpl) EstimateGas(ctx context.Context, args ethapi.TransactionArgs, blockNrOrHash *rpc.BlockNumberOrHash) (hexutil.Uint64, error)
func (*BackendImpl) EthMsgsFromCosmosBlock ¶
func (b *BackendImpl) EthMsgsFromCosmosBlock(resBlock *tmrpctypes.ResultBlock, blockRes *tmrpctypes.ResultBlockResults) []*txs.MsgEthereumTx
func (*BackendImpl) ExtRPCEnabled ¶
func (b *BackendImpl) ExtRPCEnabled() bool
func (*BackendImpl) FeeHistory ¶
func (b *BackendImpl) FeeHistory(blockCount uint64, lastBlock rpc.BlockNumber, rewardPercentiles []float64, ) (*rpctypes.FeeHistoryResult, error)
func (*BackendImpl) GetBalance ¶
func (b *BackendImpl) GetBalance(address common.Address, blockNrOrHash rpc.BlockNumberOrHash) (*hexutil.Big, error)
func (*BackendImpl) GetBlockByNumber ¶
func (b *BackendImpl) GetBlockByNumber(blockNum rpc.BlockNumber, fullTx bool) (map[string]interface{}, error)
func (*BackendImpl) GetBody ¶
func (b *BackendImpl) GetBody(ctx context.Context, hash common.Hash, number rpc.BlockNumber, ) (*ethtypes.Body, error)
GetBody retrieves the block body.
func (*BackendImpl) GetCode ¶
func (b *BackendImpl) GetCode(address common.Address, blockNrOrHash rpc.BlockNumberOrHash) (hexutil.Bytes, error)
func (*BackendImpl) GetLogs ¶
func (b *BackendImpl) GetLogs( _ context.Context, blockHash common.Hash, number uint64, ) ([][]*ethtypes.Log, error)
GetLogs returns the logs.
func (*BackendImpl) GetPoolNonce ¶
func (*BackendImpl) GetPoolTransaction ¶
func (b *BackendImpl) GetPoolTransaction(txHash common.Hash) *ethtypes.Transaction
func (*BackendImpl) GetPoolTransactions ¶
func (b *BackendImpl) GetPoolTransactions() (ctypes.Transactions, error)
func (*BackendImpl) GetReceipts ¶
GetReceipts get receipts by block hash
func (*BackendImpl) GetSender ¶
func (b *BackendImpl) GetSender(msg *txs.MsgEthereumTx, chainID *big.Int) (from common.Address, err error)
GetSender extracts the sender address from the signature values using the latest signer for the given chainID.
func (*BackendImpl) GetStorageAt ¶
func (b *BackendImpl) GetStorageAt(address common.Address, key string, blockNrOrHash rpc.BlockNumberOrHash) (hexutil.Bytes, error)
GetStorageAt returns the contract storage at the given address, block number, and key.
func (*BackendImpl) GetTransaction ¶
func (b *BackendImpl) GetTransaction(ctx context.Context, txHash common.Hash) (*ethapi.RPCTransaction, error)
func (*BackendImpl) GetTransactionCount ¶
func (b *BackendImpl) GetTransactionCount(address common.Address, blockNrOrHash rpc.BlockNumberOrHash) (*hexutil.Uint64, error)
func (*BackendImpl) GetTransactionReceipt ¶
func (b *BackendImpl) GetTransactionReceipt(ctx context.Context, hash common.Hash) (map[string]interface{}, error)
GetTransactionReceipt get receipt by transaction hash
func (*BackendImpl) GetTxByEthHash ¶
func (*BackendImpl) GlobalMinGasPrice ¶
func (b *BackendImpl) GlobalMinGasPrice() (sdktypes.Dec, error)
GlobalMinGasPrice returns MinGasPrice param from FeeMarket
func (*BackendImpl) HeaderByHash ¶
func (*BackendImpl) HeaderByNumber ¶
func (b *BackendImpl) HeaderByNumber(_ context.Context, number rpc.BlockNumber) (*ethtypes.Header, error)
func (*BackendImpl) HeaderByNumberOrHash ¶
func (b *BackendImpl) HeaderByNumberOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash, ) (*ethtypes.Header, error)
func (*BackendImpl) ImportRawKey ¶
func (b *BackendImpl) ImportRawKey(privkey, password string) (common.Address, error)
func (*BackendImpl) Listening ¶
func (b *BackendImpl) Listening() bool
func (*BackendImpl) NewAccount ¶
func (b *BackendImpl) NewAccount(password string) (common.AddressEIP55, error)
func (*BackendImpl) PeerCount ¶
func (b *BackendImpl) PeerCount() hexutil.Uint
func (*BackendImpl) PendingBlockAndReceipts ¶
func (b *BackendImpl) PendingBlockAndReceipts() (*ethtypes.Block, types.Receipts)
func (*BackendImpl) PendingTransactions ¶
func (b *BackendImpl) PendingTransactions() ([]*sdktypes.Tx, error)
func (*BackendImpl) RPCBlockRangeCap ¶
func (b *BackendImpl) RPCBlockRangeCap() int32
RPCBlockRangeCap defines the max block range allowed for `eth_getLogs` query.
func (*BackendImpl) RPCEVMTimeout ¶
func (b *BackendImpl) RPCEVMTimeout() time.Duration
func (*BackendImpl) RPCFilterCap ¶
func (b *BackendImpl) RPCFilterCap() int32
RPCFilterCap is the limit for total number of filters that can be created
func (*BackendImpl) RPCGasCap ¶
func (b *BackendImpl) RPCGasCap() uint64
func (*BackendImpl) RPCLogsCap ¶
func (b *BackendImpl) RPCLogsCap() int32
RPCLogsCap defines the max number of results can be returned from single `eth_getLogs` query.
func (*BackendImpl) RPCMinGasPrice ¶
func (b *BackendImpl) RPCMinGasPrice() int64
func (*BackendImpl) RPCTxFeeCap ¶
func (b *BackendImpl) RPCTxFeeCap() float64
func (*BackendImpl) SendTx ¶
func (b *BackendImpl) SendTx(ctx context.Context, signedTx *ethtypes.Transaction) error
func (*BackendImpl) ServiceFilter ¶
func (b *BackendImpl) ServiceFilter(_ context.Context, _ *bloombits.MatcherSession)
func (*BackendImpl) SetHead ¶
func (b *BackendImpl) SetHead(_ uint64)
func (*BackendImpl) Sign ¶
Sign signs the provided data using the private key of address via Geth's signature standard.
func (*BackendImpl) SignTransaction ¶
func (b *BackendImpl) SignTransaction(args *ethapi2.TransactionArgs) (*ethtypes.Transaction, error)
func (*BackendImpl) StateAndHeaderByNumber ¶
func (b *BackendImpl) StateAndHeaderByNumber( ctx context.Context, number rpc.BlockNumber, ) (*state.StateDB, *ethtypes.Header, error)
func (*BackendImpl) StateAndHeaderByNumberOrHash ¶
func (b *BackendImpl) StateAndHeaderByNumberOrHash( ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash, ) (*state.StateDB, *ethtypes.Header, error)
func (*BackendImpl) Stats ¶
func (b *BackendImpl) Stats() (int, int)
func (*BackendImpl) SubscribeChainEvent ¶
func (b *BackendImpl) SubscribeChainEvent(ch chan<- core.ChainEvent) event.Subscription
func (*BackendImpl) SubscribeChainHeadEvent ¶
func (b *BackendImpl) SubscribeChainHeadEvent(ch chan<- core.ChainHeadEvent) event.Subscription
func (*BackendImpl) SubscribeChainSideEvent ¶
func (b *BackendImpl) SubscribeChainSideEvent(ch chan<- core.ChainSideEvent) event.Subscription
func (*BackendImpl) SubscribeLogsEvent ¶
func (b *BackendImpl) SubscribeLogsEvent(ch chan<- []*ethtypes.Log) event.Subscription
func (*BackendImpl) SubscribeNewTxsEvent ¶
func (b *BackendImpl) SubscribeNewTxsEvent(ch chan<- core.NewTxsEvent) event.Subscription
func (*BackendImpl) SubscribePendingLogsEvent ¶
func (b *BackendImpl) SubscribePendingLogsEvent(ch chan<- []*ethtypes.Log) event.Subscription
func (*BackendImpl) SubscribeRemovedLogsEvent ¶
func (b *BackendImpl) SubscribeRemovedLogsEvent(ch chan<- core.RemovedLogsEvent) event.Subscription
func (*BackendImpl) SuggestGasTipCap ¶
func (*BackendImpl) SyncProgress ¶
func (b *BackendImpl) SyncProgress() ethereum.SyncProgress
func (*BackendImpl) TxPoolContent ¶
func (b *BackendImpl) TxPoolContent() ( map[common.Address]ctypes.Transactions, map[common.Address]ctypes.Transactions, )
func (*BackendImpl) TxPoolContentFrom ¶
func (b *BackendImpl) TxPoolContentFrom(addr common.Address) ( ctypes.Transactions, ctypes.Transactions, )
func (*BackendImpl) UnprotectedAllowed ¶
func (b *BackendImpl) UnprotectedAllowed() bool
func (*BackendImpl) Version ¶
func (b *BackendImpl) Version() string
Version returns the current ethereum protocol version.
type Config ¶
type Config struct { // AppCfg preserve the server config AppCfg *config.Config // Gas Price Oracle config. GPO *gasprice.Config // RPCGasCap is the global gas cap for eth-call variants. RPCGasCap uint64 `toml:""` // RPCEVMTimeout is the global timeout for eth-call. RPCEVMTimeout time.Duration `toml:""` // RPCTxFeeCap is the global transaction fee(price * gaslimit) cap for // send-transaction variants. The unit is ether. RPCTxFeeCap float64 `toml:""` }
Config represents the configurable parameters for Polaris.
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig returns the default JSON-RPC config.
func LoadConfigFromFilePath ¶
LoadConfigFromFilePath reads in a Polaris config file from the fileystem.