Documentation ¶
Index ¶
- Constants
- Variables
- func DecodeLeafNode(node []byte) ([]byte, error)
- func DoCall(ctx context.Context, b *Backend, args CallArgs, ...) (*core.ExecutionResult, error)
- func IsLeaf(elements []interface{}) (bool, error)
- func RPCMarshalBlock(block *types.Block, inclTx bool, fullTx bool, config *params.ChainConfig) map[string]interface{}
- func RPCMarshalBlockWithUncleHashes(block *types.Block, uncleHashes []common.Hash, inclTx bool, fullTx bool, ...) (map[string]interface{}, error)
- func RPCMarshalHeader(head *types.Header) map[string]interface{}
- func SignerForTx(tx *types.Transaction) types.Signer
- type APIConfig
- type AccountResult
- type Backend
- func (b *Backend) BlockByHash(ctx context.Context, hash common.Hash) (*types.Block, error)
- func (b *Backend) BlockByNumber(ctx context.Context, blockNumber rpc.BlockNumber) (*types.Block, error)
- func (b *Backend) BlockByNumberOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (*types.Block, error)
- func (b *Backend) BloomStatus() (uint64, uint64)
- func (b *Backend) ChainConfig() *params.ChainConfig
- func (b *Backend) ChainDb() ethdb.Database
- func (b *Backend) Close() error
- func (b *Backend) CurrentBlock() (*types.Block, error)
- func (b *Backend) CurrentHeader() *types.Header
- func (b *Backend) Engine() consensus.Engine
- func (b *Backend) GetAccountByHash(ctx context.Context, address common.Address, hash common.Hash) (*types.StateAccount, error)
- func (b *Backend) GetAccountByNumber(ctx context.Context, address common.Address, blockNumber rpc.BlockNumber) (*types.StateAccount, error)
- func (b *Backend) GetAccountByNumberOrHash(ctx context.Context, address common.Address, ...) (*types.StateAccount, error)
- func (b *Backend) GetBody(ctx context.Context, hash common.Hash, number rpc.BlockNumber) (*types.Body, error)
- func (b *Backend) GetCanonicalHash(number uint64) (common.Hash, error)
- func (b *Backend) GetCanonicalHeader(number uint64) (string, []byte, error)
- func (b *Backend) GetCanonicalHeaderAndHash(number uint64) (string, []byte, error)
- func (b *Backend) GetCodeByHash(ctx context.Context, address common.Address, hash common.Hash) ([]byte, error)
- func (b *Backend) GetCodeByNumber(ctx context.Context, address common.Address, blockNumber rpc.BlockNumber) ([]byte, error)
- func (b *Backend) GetCodeByNumberOrHash(ctx context.Context, address common.Address, ...) ([]byte, error)
- func (b *Backend) GetEVM(ctx context.Context, msg *core.Message, state vm.StateDB, header *types.Header) (*vm.EVM, func() error, error)
- func (b *Backend) GetHeader(hash common.Hash, height uint64) *types.Header
- func (b *Backend) GetHeaderByBlockHash(tx *sqlx.Tx, hash common.Hash) (*types.Header, error)
- func (b *Backend) GetLogs(ctx context.Context, hash common.Hash, number uint64) ([][]*types.Log, error)
- func (b *Backend) GetReceipts(ctx context.Context, hash common.Hash) (types.Receipts, error)
- func (b *Backend) GetReceiptsByBlockHash(tx *sqlx.Tx, hash common.Hash) (types.Receipts, error)
- func (b *Backend) GetReceiptsByBlockHashAndNumber(tx *sqlx.Tx, hash common.Hash, number uint64) (types.Receipts, error)
- func (b *Backend) GetSlice(path string, depth int, root common.Hash, storage bool) (*GetSliceResponse, error)
- func (b *Backend) GetStorageByHash(ctx context.Context, address common.Address, key, hash common.Hash) (hexutil.Bytes, error)
- func (b *Backend) GetStorageByNumber(ctx context.Context, address common.Address, key common.Hash, ...) (hexutil.Bytes, error)
- func (b *Backend) GetStorageByNumberOrHash(ctx context.Context, address common.Address, key common.Hash, ...) (hexutil.Bytes, error)
- func (b *Backend) GetTd(blockHash common.Hash) (*big.Int, error)
- func (b *Backend) GetTransaction(ctx context.Context, txHash common.Hash) (bool, *types.Transaction, common.Hash, uint64, uint64, error)
- func (b *Backend) GetTransactionsByBlockHash(tx *sqlx.Tx, hash common.Hash) (types.Transactions, error)
- func (b *Backend) GetTransactionsByBlockHashAndNumber(tx *sqlx.Tx, hash common.Hash, number uint64) (types.Transactions, error)
- func (b *Backend) GetUnclesByBlockHash(tx *sqlx.Tx, hash common.Hash) ([]*types.Header, error)
- func (b *Backend) GetUnclesByBlockHashAndNumber(tx *sqlx.Tx, hash common.Hash, number uint64) ([]*types.Header, error)
- func (b *Backend) GetWithdrawals(tx *sqlx.Tx, hash common.Hash, number uint64) (types.Withdrawals, error)
- func (b *Backend) HeaderByHash(ctx context.Context, hash common.Hash) (*types.Header, error)
- func (b *Backend) HeaderByNumber(ctx context.Context, blockNumber rpc.BlockNumber) (*types.Header, error)
- func (b *Backend) HeaderByNumberOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (*types.Header, error)
- func (b *Backend) IPLDDirectStateDBAndHeaderByNumberOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (*ipld_direct_state.StateDB, *types.Header, error)
- func (b *Backend) IPLDTrieStateDBAndHeaderByNumberOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (*ipld_trie_state.StateDB, *types.Header, error)
- func (b *Backend) NormalizeBlockNumber(blockNumber rpc.BlockNumber) (int64, error)
- func (b *Backend) PendingBlockAndReceipts() (*types.Block, types.Receipts)
- func (b *Backend) RPCGasCap() uint64
- func (b *Backend) ServiceFilter(ctx context.Context, session *bloombits.MatcherSession)
- func (b *Backend) SubscribeChainEvent(ch chan<- core.ChainEvent) event.Subscription
- func (b *Backend) SubscribeLogsEvent(ch chan<- []*types.Log) event.Subscription
- func (b *Backend) SubscribeNewTxsEvent(chan<- core.NewTxsEvent) event.Subscription
- func (b *Backend) SubscribePendingLogsEvent(ch chan<- []*types.Log) event.Subscription
- func (b *Backend) SubscribeRemovedLogsEvent(ch chan<- core.RemovedLogsEvent) event.Subscription
- func (b *Backend) ValidateTrie(stateRoot common.Hash) error
- type CallArgs
- type Config
- type ConvertedPayload
- type GetSliceResponse
- type GetSliceResponseAccount
- type GetSliceResponseMetadata
- type GetSliceResponseTrieNodes
- type HeaderCIDRecord
- type IPLDModelRecord
- type LogResult
- type NodeType
- type OverrideAccount
- type PublicEthAPI
- func (pea *PublicEthAPI) BlockNumber() hexutil.Uint64
- func (pea *PublicEthAPI) Call(ctx context.Context, args CallArgs, blockNrOrHash rpc.BlockNumberOrHash, ...) (hexutil.Bytes, error)
- func (pea *PublicEthAPI) ChainId() *hexutil.Big
- func (pea *PublicEthAPI) CreateAccessList(ctx context.Context, args TransactionArgs, ...) (*accessListResult, error)
- func (pea *PublicEthAPI) EstimateGas(ctx context.Context, args TransactionArgs, ...) (hexutil.Uint64, error)
- func (pea *PublicEthAPI) FeeHistory(ctx context.Context, blockCount int, lastBlock rpc.BlockNumber, ...) (*feeHistoryResult, error)
- func (pea *PublicEthAPI) GasPrice(ctx context.Context) (*hexutil.Big, error)
- func (pea *PublicEthAPI) GetBalance(ctx context.Context, address common.Address, ...) (*hexutil.Big, error)
- func (pea *PublicEthAPI) GetBlockByHash(ctx context.Context, hash common.Hash, fullTx bool) (map[string]interface{}, error)
- func (pea *PublicEthAPI) GetBlockByNumber(ctx context.Context, number rpc.BlockNumber, fullTx bool) (map[string]interface{}, error)
- func (pea *PublicEthAPI) GetBlockTransactionCountByHash(ctx context.Context, blockHash common.Hash) *hexutil.Uint
- func (pea *PublicEthAPI) GetBlockTransactionCountByNumber(ctx context.Context, blockNr rpc.BlockNumber) *hexutil.Uint
- func (pea *PublicEthAPI) GetCode(ctx context.Context, address common.Address, ...) (hexutil.Bytes, error)
- func (pea *PublicEthAPI) GetHeaderByHash(ctx context.Context, hash common.Hash) map[string]interface{}
- func (pea *PublicEthAPI) GetHeaderByNumber(ctx context.Context, number rpc.BlockNumber) (map[string]interface{}, error)
- func (pea *PublicEthAPI) GetLogs(ctx context.Context, crit filters.FilterCriteria) ([]*types.Log, error)
- func (pea *PublicEthAPI) GetProof(ctx context.Context, address common.Address, storageKeys []string, ...) (*AccountResult, error)
- func (pea *PublicEthAPI) GetRawTransactionByBlockHashAndIndex(ctx context.Context, blockHash common.Hash, index hexutil.Uint) hexutil.Bytes
- func (pea *PublicEthAPI) GetRawTransactionByBlockNumberAndIndex(ctx context.Context, blockNr rpc.BlockNumber, index hexutil.Uint) hexutil.Bytes
- func (pea *PublicEthAPI) GetRawTransactionByHash(ctx context.Context, hash common.Hash) (hexutil.Bytes, error)
- func (pea *PublicEthAPI) GetSlice(ctx context.Context, path string, depth int, root common.Hash, storage bool) (*GetSliceResponse, error)
- func (pea *PublicEthAPI) GetStorageAt(ctx context.Context, address common.Address, key string, ...) (hexutil.Bytes, error)
- func (pea *PublicEthAPI) GetTransactionByBlockHashAndIndex(ctx context.Context, blockHash common.Hash, index hexutil.Uint) *RPCTransaction
- func (pea *PublicEthAPI) GetTransactionByBlockNumberAndIndex(ctx context.Context, blockNr rpc.BlockNumber, index hexutil.Uint) *RPCTransaction
- func (pea *PublicEthAPI) GetTransactionByHash(ctx context.Context, hash common.Hash) (*RPCTransaction, error)
- func (pea *PublicEthAPI) GetTransactionCount(ctx context.Context, address common.Address, ...) (*hexutil.Uint64, error)
- func (pea *PublicEthAPI) GetTransactionReceipt(ctx context.Context, hash common.Hash) (map[string]interface{}, error)
- func (pea *PublicEthAPI) GetUncleByBlockHashAndIndex(ctx context.Context, blockHash common.Hash, index hexutil.Uint) (map[string]interface{}, error)
- func (pea *PublicEthAPI) GetUncleByBlockNumberAndIndex(ctx context.Context, blockNr rpc.BlockNumber, index hexutil.Uint) (map[string]interface{}, error)
- func (pea *PublicEthAPI) GetUncleCountByBlockHash(ctx context.Context, blockHash common.Hash) *hexutil.Uint
- func (pea *PublicEthAPI) GetUncleCountByBlockNumber(ctx context.Context, blockNr rpc.BlockNumber) *hexutil.Uint
- func (pea *PublicEthAPI) MaxPriorityFeePerGas(ctx context.Context) (*hexutil.Big, error)
- type RPCReceipt
- type RPCTransaction
- type ReceiptFilter
- type RequiresProxyError
- type Retriever
- func (r *Retriever) RetrieveAccountByAddressAndBlockHash(address common.Address, hash common.Hash) (StateAccountRecord, error)
- func (r *Retriever) RetrieveBlockNumberByHash(tx *sqlx.Tx, blockHash common.Hash) (uint64, error)
- func (r *Retriever) RetrieveFilteredGQLLogs(tx *sqlx.Tx, rctFilter ReceiptFilter, blockHash *common.Hash, ...) ([]LogResult, error)
- func (r *Retriever) RetrieveFilteredLogsForBlock(db *sqlx.DB, rctFilter ReceiptFilter, blockHash *common.Hash) ([]LogResult, error)
- func (r *Retriever) RetrieveFilteredLogsForBlockRange(db *sqlx.DB, rctFilter ReceiptFilter, startBlockNumber int64, ...) ([]LogResult, error)
- func (r *Retriever) RetrieveFirstBlockNumber() (int64, error)
- func (r *Retriever) RetrieveHeaderAndTxCIDsByBlockHash(blockHash common.Hash, blockNumber *big.Int) (HeaderCIDRecord, error)
- func (r *Retriever) RetrieveHeaderAndTxCIDsByBlockNumber(blockNumber int64) ([]HeaderCIDRecord, error)
- func (r *Retriever) RetrieveHeaderByHash(hash common.Hash) (string, []byte, error)
- func (r *Retriever) RetrieveHeaderByHash2(tx *sqlx.Tx, hash common.Hash) (string, []byte, error)
- func (r *Retriever) RetrieveLastBlockNumber() (int64, error)
- func (r *Retriever) RetrieveReceipts(tx *sqlx.Tx, hash common.Hash, number uint64) ([]string, [][]byte, []common.Hash, error)
- func (r *Retriever) RetrieveReceiptsByBlockHash(tx *sqlx.Tx, hash common.Hash) ([]string, [][]byte, []common.Hash, error)
- func (r *Retriever) RetrieveStorageAndRLP(address common.Address, key, hash common.Hash) (string, []byte, error)
- func (r *Retriever) RetrieveStorageAtByAddressAndStorageSlotAndBlockHash(address common.Address, key, hash common.Hash) ([]byte, error)
- func (r *Retriever) RetrieveTransactions(tx *sqlx.Tx, hash common.Hash, number uint64) ([]string, [][]byte, error)
- func (r *Retriever) RetrieveTransactionsByBlockHash(tx *sqlx.Tx, hash common.Hash) ([]string, [][]byte, error)
- func (r *Retriever) RetrieveTxCIDByHash(txHash string, blockNumber *big.Int) (TransactionCIDRecord, error)
- func (r *Retriever) RetrieveUncles(tx *sqlx.Tx, hash common.Hash, number uint64) (string, []byte, error)
- func (r *Retriever) RetrieveUnclesByBlockHash(tx *sqlx.Tx, hash common.Hash) (string, []byte, error)
- func (r *Retriever) RetrieveWithdrawals(tx *sqlx.Tx, hash common.Hash, number uint64) ([]string, [][]byte, error)
- type StateAccountRecord
- type StateNode
- type StateOverride
- type StorageNode
- type StorageResult
- type TransactionArgs
- type TransactionCIDRecord
Constants ¶
const ( RetrieveHeaderByHashPgStr = `` /* 228-byte string literal not displayed */ RetrieveUnclesPgStr = `` /* 540-byte string literal not displayed */ RetrieveUnclesByBlockHashPgStr = `` /* 496-byte string literal not displayed */ RetrieveTransactionsPgStr = `` /* 450-byte string literal not displayed */ RetrieveTransactionsByBlockHashPgStr = `` /* 412-byte string literal not displayed */ RetrieveReceiptsPgStr = `` /* 651-byte string literal not displayed */ RetrieveReceiptsByBlockHashPgStr = `` /* 616-byte string literal not displayed */ RetrieveWithdrawalsPgStr = `` /* 533-byte string literal not displayed */ RetrieveAccountByLeafKeyAndBlockHashPgStr = `` /* 487-byte string literal not displayed */ RetrieveFilteredGQLLogs = `` /* 706-byte string literal not displayed */ RetrieveFilteredLogsRange = `` /* 1256-byte string literal not displayed */ RetrieveFilteredLogsSingle = `` /* 1028-byte string literal not displayed */ RetrieveStorageLeafByAddressHashAndLeafKeyAndBlockHashPgStr = `` /* 657-byte string literal not displayed */ RetrieveStorageAndRLPByAddressHashAndLeafKeyAndBlockHashPgStr = `` /* 784-byte string literal not displayed */ RetrieveCanonicalBlockHashByNumber = `SELECT block_hash FROM eth.header_cids WHERE block_number = $1 AND canonical` RetrieveCanonicalHeaderByNumber = `` /* 230-byte string literal not displayed */ RetrieveCanonicalHeaderAndHashByNumber = `` /* 243-byte string literal not displayed */ RetrieveTD = `SELECT CAST(td as TEXT) FROM eth.header_cids WHERE header_cids.block_hash = $1` RetrieveRPCTransaction = `` /* 452-byte string literal not displayed */ RetrieveCodeHashByLeafKeyAndBlockHash = `` /* 400-byte string literal not displayed */ RetrieveCodeByKey = `SELECT data FROM ipld.blocks WHERE key = $1` )
const APIName = "eth"
APIName is the namespace for the watcher's eth api
const APIVersion = "0.0.1"
APIVersion is the version of the watcher's eth api
const (
StateDBGroupCacheName = "statedb"
)
Variables ¶
var EmptyNodeValue = make([]byte, common.HashLength)
Functions ¶
func DecodeLeafNode ¶
DecodeLeafNode decodes the leaf node data
func DoCall ¶
func DoCall(ctx context.Context, b *Backend, args CallArgs, blockNrOrHash rpc.BlockNumberOrHash, overrides *StateOverride, timeout time.Duration, globalGasCap uint64) (*core.ExecutionResult, error)
func RPCMarshalBlock ¶
func RPCMarshalBlock(block *types.Block, inclTx bool, fullTx bool, config *params.ChainConfig) map[string]interface{}
RPCMarshalBlock converts the given block to the RPC output which depends on fullTx. If inclTx is true transactions are returned. When fullTx is true the returned block contains full transaction details, otherwise it will only contain transaction hashes.
func RPCMarshalBlockWithUncleHashes ¶
func RPCMarshalBlockWithUncleHashes(block *types.Block, uncleHashes []common.Hash, inclTx bool, fullTx bool, config *params.ChainConfig) (map[string]interface{}, error)
RPCMarshalBlockWithUncleHashes marshals the block with the provided uncle hashes
func RPCMarshalHeader ¶
RPCMarshalHeader converts the given header to the RPC output.
func SignerForTx ¶
func SignerForTx(tx *types.Transaction) types.Signer
SignerForTx returns an appropriate Signer for this Transaction
Types ¶
type APIConfig ¶
type APIConfig struct { // Proxy node for forwarding cache misses SupportsStateDiff bool // Whether the remote node supports the statediff_writeStateDiffAt endpoint, if it does we can fill the local cache when we hit a miss ForwardEthCalls bool // if true, forward eth_call calls directly to the configured proxy node ForwardGetStorageAt bool // if true, forward eth_getStorageAt calls directly to the configured proxy node ProxyOnError bool // turn on regular proxy fall-through on errors; needed to test difference between direct and indirect fall-through GetLogsBlockLimit int64 // the maximum size of the block range to use in GetLogs StateDiffTimeout time.Duration }
type AccountResult ¶
type AccountResult struct { Address common.Address `json:"address"` AccountProof []string `json:"accountProof"` Balance *hexutil.Big `json:"balance"` CodeHash common.Hash `json:"codeHash"` Nonce hexutil.Uint64 `json:"nonce"` StorageHash common.Hash `json:"storageHash"` StorageProof []StorageResult `json:"storageProof"` }
AccountResult struct for GetProof
type Backend ¶
type Backend struct { // underlying postgres db DB *sqlx.DB // postgres db interfaces Retriever *Retriever // ethereum interfaces EthDB ethdb.Database // We use this state.Database for eth_call and any place we don't need trie access IpldDirectStateDatabase ipld_direct_state.Database // We use this where state must be accessed by trie IpldTrieStateDatabase ipld_trie_state.Database Config *Config }
Backend handles all interactions with IPLD/SQL-backed Ethereum state. Note that this does not contain a geth state.StateDatabase, as it is not compatible with the IPFS v0 blockstore nor the leaf-key indexed SQL schema.
func (*Backend) BlockByHash ¶
BlockByHash returns the requested block
func (*Backend) BlockByNumber ¶
func (b *Backend) BlockByNumber(ctx context.Context, blockNumber rpc.BlockNumber) (*types.Block, error)
BlockByNumber returns the requested canonical block
func (*Backend) BlockByNumberOrHash ¶
func (b *Backend) BlockByNumberOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (*types.Block, error)
BlockByNumberOrHash returns block by number or hash
func (*Backend) BloomStatus ¶
func (*Backend) ChainConfig ¶
func (b *Backend) ChainConfig() *params.ChainConfig
ChainConfig returns the active chain configuration.
func (*Backend) CurrentBlock ¶
CurrentBlock returns the current block
func (*Backend) CurrentHeader ¶
CurrentHeader returns the current block's header
func (*Backend) GetAccountByHash ¶
func (b *Backend) GetAccountByHash(ctx context.Context, address common.Address, hash common.Hash) (*types.StateAccount, error)
GetAccountByHash returns the account object for the provided address at the block with the provided hash
func (*Backend) GetAccountByNumber ¶
func (b *Backend) GetAccountByNumber(ctx context.Context, address common.Address, blockNumber rpc.BlockNumber) (*types.StateAccount, error)
GetAccountByNumber returns the account object for the provided address at the canonical block at the provided height
func (*Backend) GetAccountByNumberOrHash ¶
func (b *Backend) GetAccountByNumberOrHash(ctx context.Context, address common.Address, blockNrOrHash rpc.BlockNumberOrHash) (*types.StateAccount, error)
GetAccountByNumberOrHash returns the account object for the provided address at the block corresponding to the provided number or hash
func (*Backend) GetBody ¶
func (b *Backend) GetBody(ctx context.Context, hash common.Hash, number rpc.BlockNumber) (*types.Body, error)
GetBody returns the the body for the provided block hash and number
func (*Backend) GetCanonicalHash ¶
GetCanonicalHash gets the canonical hash for the provided number, if there is one
func (*Backend) GetCanonicalHeader ¶
GetCanonicalHeader gets the canonical header for the provided number, if there is one
func (*Backend) GetCanonicalHeaderAndHash ¶
GetCanonicalHeader gets the canonical hash and header for the provided number, if they exist
func (*Backend) GetCodeByHash ¶
func (b *Backend) GetCodeByHash(ctx context.Context, address common.Address, hash common.Hash) ([]byte, error)
GetCodeByHash returns the byte code for the contract deployed at the provided address at the block with the provided hash
func (*Backend) GetCodeByNumber ¶
func (b *Backend) GetCodeByNumber(ctx context.Context, address common.Address, blockNumber rpc.BlockNumber) ([]byte, error)
GetCodeByNumber returns the byte code for the contract deployed at the provided address at the canonical block with the provided block number
func (*Backend) GetCodeByNumberOrHash ¶
func (b *Backend) GetCodeByNumberOrHash(ctx context.Context, address common.Address, blockNrOrHash rpc.BlockNumberOrHash) ([]byte, error)
GetCodeByNumberOrHash returns the byte code for the contract deployed at the provided address at the block with the provided hash or block number
func (*Backend) GetEVM ¶
func (b *Backend) GetEVM(ctx context.Context, msg *core.Message, state vm.StateDB, header *types.Header) (*vm.EVM, func() error, error)
GetEVM constructs and returns a vm.EVM
func (*Backend) GetHeaderByBlockHash ¶
GetHeaderByBlockHash retrieves header for a provided block hash
func (*Backend) GetLogs ¶
func (b *Backend) GetLogs(ctx context.Context, hash common.Hash, number uint64) ([][]*types.Log, error)
GetLogs returns all the logs for the given block hash
func (*Backend) GetReceipts ¶
GetReceipts retrieves receipts for provided block hash
func (*Backend) GetReceiptsByBlockHash ¶
GetReceiptsByBlockHash retrieves receipts for a provided block hash
func (*Backend) GetReceiptsByBlockHashAndNumber ¶
func (b *Backend) GetReceiptsByBlockHashAndNumber(tx *sqlx.Tx, hash common.Hash, number uint64) (types.Receipts, error)
GetReceiptsByBlockHashAndNumber retrieves receipts for a provided block hash and number
func (*Backend) GetStorageByHash ¶
func (b *Backend) GetStorageByHash(ctx context.Context, address common.Address, key, hash common.Hash) (hexutil.Bytes, error)
GetStorageByHash returns the storage value for the provided contract address an storage key at the block corresponding to the provided hash
func (*Backend) GetStorageByNumber ¶
func (b *Backend) GetStorageByNumber(ctx context.Context, address common.Address, key common.Hash, blockNumber rpc.BlockNumber) (hexutil.Bytes, error)
GetStorageByNumber returns the storage value for the provided contract address an storage key at the block corresponding to the provided number
func (*Backend) GetStorageByNumberOrHash ¶
func (b *Backend) GetStorageByNumberOrHash(ctx context.Context, address common.Address, key common.Hash, blockNrOrHash rpc.BlockNumberOrHash) (hexutil.Bytes, error)
GetStorageByNumberOrHash returns the storage value for the provided contract address an storage key at the block corresponding to the provided number or hash
func (*Backend) GetTransaction ¶
func (b *Backend) GetTransaction(ctx context.Context, txHash common.Hash) (bool, *types.Transaction, common.Hash, uint64, uint64, error)
GetTransaction retrieves a tx by hash It also returns the blockhash, blocknumber, and tx index associated with the transaction
func (*Backend) GetTransactionsByBlockHash ¶
func (b *Backend) GetTransactionsByBlockHash(tx *sqlx.Tx, hash common.Hash) (types.Transactions, error)
GetTransactionsByBlockHash retrieves transactions for a provided block hash
func (*Backend) GetTransactionsByBlockHashAndNumber ¶
func (b *Backend) GetTransactionsByBlockHashAndNumber(tx *sqlx.Tx, hash common.Hash, number uint64) (types.Transactions, error)
GetTransactionsByBlockHashAndNumber retrieves transactions for a provided block hash and number
func (*Backend) GetUnclesByBlockHash ¶
GetUnclesByBlockHash retrieves uncles for a provided block hash
func (*Backend) GetUnclesByBlockHashAndNumber ¶
func (b *Backend) GetUnclesByBlockHashAndNumber(tx *sqlx.Tx, hash common.Hash, number uint64) ([]*types.Header, error)
GetUnclesByBlockHashAndNumber retrieves uncles for a provided block hash and number
func (*Backend) GetWithdrawals ¶
func (b *Backend) GetWithdrawals(tx *sqlx.Tx, hash common.Hash, number uint64) (types.Withdrawals, error)
GetWithdrawals retrieves transactions for a provided block hash and number
func (*Backend) HeaderByHash ¶
HeaderByHash gets the header for the provided block hash
func (*Backend) HeaderByNumber ¶
func (b *Backend) HeaderByNumber(ctx context.Context, blockNumber rpc.BlockNumber) (*types.Header, error)
HeaderByNumber gets the canonical header for the provided block number
func (*Backend) HeaderByNumberOrHash ¶
func (b *Backend) HeaderByNumberOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (*types.Header, error)
HeaderByNumberOrHash gets the header for the provided block hash or number
func (*Backend) IPLDDirectStateDBAndHeaderByNumberOrHash ¶
func (b *Backend) IPLDDirectStateDBAndHeaderByNumberOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (*ipld_direct_state.StateDB, *types.Header, error)
IPLDStateDBAndHeaderByNumberOrHash returns the statedb and header for the provided block number or hash
func (*Backend) IPLDTrieStateDBAndHeaderByNumberOrHash ¶
func (b *Backend) IPLDTrieStateDBAndHeaderByNumberOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (*ipld_trie_state.StateDB, *types.Header, error)
IPLDStateDBAndHeaderByNumberOrHash returns the statedb and header for the provided block number or hash
func (*Backend) NormalizeBlockNumber ¶
func (b *Backend) NormalizeBlockNumber(blockNumber rpc.BlockNumber) (int64, error)
func (*Backend) PendingBlockAndReceipts ¶
func (*Backend) ServiceFilter ¶
func (b *Backend) ServiceFilter(ctx context.Context, session *bloombits.MatcherSession)
func (*Backend) SubscribeChainEvent ¶
func (b *Backend) SubscribeChainEvent(ch chan<- core.ChainEvent) event.Subscription
func (*Backend) SubscribeLogsEvent ¶
func (b *Backend) SubscribeLogsEvent(ch chan<- []*types.Log) event.Subscription
func (*Backend) SubscribeNewTxsEvent ¶
func (b *Backend) SubscribeNewTxsEvent(chan<- core.NewTxsEvent) event.Subscription
func (*Backend) SubscribePendingLogsEvent ¶
func (b *Backend) SubscribePendingLogsEvent(ch chan<- []*types.Log) event.Subscription
func (*Backend) SubscribeRemovedLogsEvent ¶
func (b *Backend) SubscribeRemovedLogsEvent(ch chan<- core.RemovedLogsEvent) event.Subscription
type CallArgs ¶
type CallArgs struct { From *common.Address `json:"from"` To *common.Address `json:"to"` Gas *hexutil.Uint64 `json:"gas"` GasPrice *hexutil.Big `json:"gasPrice"` MaxFeePerGas *hexutil.Big `json:"maxFeePerGas"` MaxPriorityFeePerGas *hexutil.Big `json:"maxPriorityFeePerGas"` Value *hexutil.Big `json:"value"` Data *hexutil.Bytes `json:"data"` AccessList *types.AccessList `json:"accessList,omitempty"` Input *hexutil.Bytes `json:"input"` }
CallArgs represents the arguments for a call.
type Config ¶
type Config struct { ChainConfig *params.ChainConfig VMConfig vm.Config RPCGasCap *big.Int GroupCacheConfig *shared.GroupCacheConfig }
type ConvertedPayload ¶
type ConvertedPayload struct { TotalDifficulty *big.Int Block *types.Block TxMetaData []models.TxModel Receipts types.Receipts ReceiptMetaData []models.ReceiptModel StateNodes []sdtypes.StateLeafNode StorageNodes map[string][]sdtypes.StorageLeafNode }
ConvertedPayload is a custom type which packages raw ETH data for publishing to IPFS and filtering to subscribers Returned by PayloadConverter Passed to IPLDPublisher and ResponseFilterer
type GetSliceResponse ¶
type GetSliceResponse struct { SliceID string `json:"sliceId"` MetaData GetSliceResponseMetadata `json:"metadata"` TrieNodes GetSliceResponseTrieNodes `json:"trieNodes"` Leaves map[string]GetSliceResponseAccount `json:"leaves"` // key: Keccak256Hash(address) in hex (leafKey) }
GetSliceResponse holds response for the eth_getSlice method
type GetSliceResponseAccount ¶
type HeaderCIDRecord ¶
type HeaderCIDRecord struct { CID string `gorm:"column:cid"` BlockHash string `gorm:"primaryKey"` BlockNumber string `gorm:"primaryKey"` ParentHash string Timestamp uint64 StateRoot string TotalDifficulty string `gorm:"column:td"` TxRoot string RctRoot string `gorm:"column:receipt_root"` UnclesHash string Bloom []byte // gorm doesn't check if foreign key exists in database. // It is required to eager load relations using preload. TransactionCIDs []TransactionCIDRecord `gorm:"foreignKey:HeaderID,BlockNumber;references:BlockHash,BlockNumber"` IPLD IPLDModelRecord `gorm:"foreignKey:CID,BlockNumber;references:Key,BlockNumber"` }
func (HeaderCIDRecord) TableName ¶
func (HeaderCIDRecord) TableName() string
TableName overrides the table name used by HeaderCIDRecord
type IPLDModelRecord ¶
func (IPLDModelRecord) TableName ¶
func (IPLDModelRecord) TableName() string
TableName overrides the table name used by IPLD
type LogResult ¶
type LogResult struct { LeafCID string `db:"cid"` ReceiptID string `db:"rct_id"` Address string `db:"address"` Index int64 `db:"index"` Data []byte `db:"log_data"` Topic0 string `db:"topic0"` Topic1 string `db:"topic1"` Topic2 string `db:"topic2"` Topic3 string `db:"topic3"` LogLeafData []byte `db:"data"` RctCID string `db:"rct_cid"` RctStatus uint64 `db:"post_status"` BlockNumber string `db:"block_number"` BlockHash string `db:"block_hash"` TxnIndex int64 `db:"txn_index"` TxHash string `db:"tx_hash"` }
LogResult represent a log.
type NodeType ¶
type NodeType string
NodeType for explicitly setting type of node
func CheckKeyType ¶
CheckKeyType checks what type of key we have
type OverrideAccount ¶
type OverrideAccount struct { Nonce *hexutil.Uint64 `json:"nonce"` Code *hexutil.Bytes `json:"code"` Balance **hexutil.Big `json:"balance"` State *map[common.Hash]common.Hash `json:"state"` StateDiff *map[common.Hash]common.Hash `json:"stateDiff"` }
OverrideAccount indicates the overriding fields of account during the execution of a message call. Note, state and stateDiff can't be specified at the same time. If state is set, message execution will only use the data in the given state. Otherwise if statDiff is set, all diff will be applied first and then execute the call message.
type PublicEthAPI ¶
type PublicEthAPI struct { // Local db backend B *Backend // contains filtered or unexported fields }
PublicEthAPI is the eth namespace API
func NewPublicEthAPI ¶
NewPublicEthAPI creates a new PublicEthAPI with the provided underlying Backend
func (*PublicEthAPI) BlockNumber ¶
func (pea *PublicEthAPI) BlockNumber() hexutil.Uint64
BlockNumber returns the block number of the chain head.
func (*PublicEthAPI) Call ¶
func (pea *PublicEthAPI) Call(ctx context.Context, args CallArgs, blockNrOrHash rpc.BlockNumberOrHash, overrides *StateOverride) (hexutil.Bytes, error)
Call executes the given transaction on the state for the given block number.
Additionally, the caller can specify a batch of contract for fields overriding.
Note, this function doesn't make and changes in the state/blockchain and is useful to execute and retrieve values.
func (*PublicEthAPI) ChainId ¶
func (pea *PublicEthAPI) ChainId() *hexutil.Big
ChainId is the EIP-155 replay-protection chain id for the current ethereum chain config.
func (*PublicEthAPI) CreateAccessList ¶
func (pea *PublicEthAPI) CreateAccessList(ctx context.Context, args TransactionArgs, blockNrOrHash *rpc.BlockNumberOrHash) (*accessListResult, error)
CreateAccessList creates a EIP-2930 type AccessList for the given transaction. Reexec and BlockNrOrHash can be specified to create the accessList on top of a certain state.
func (*PublicEthAPI) EstimateGas ¶
func (pea *PublicEthAPI) EstimateGas(ctx context.Context, args TransactionArgs, blockNrOrHash *rpc.BlockNumberOrHash) (hexutil.Uint64, error)
EstimateGas returns an estimate of the amount of gas needed to execute the given transaction against the current pending block.
func (*PublicEthAPI) FeeHistory ¶
func (pea *PublicEthAPI) FeeHistory(ctx context.Context, blockCount int, lastBlock rpc.BlockNumber, rewardPercentiles []float64) (*feeHistoryResult, error)
FeeHistory returns the fee market history.
func (*PublicEthAPI) GasPrice ¶
GasPrice returns a suggestion for a gas price for legacy transactions.
func (*PublicEthAPI) GetBalance ¶
func (pea *PublicEthAPI) GetBalance(ctx context.Context, address common.Address, blockNrOrHash rpc.BlockNumberOrHash) (*hexutil.Big, error)
GetBalance returns the amount of wei for the given address in the state of the given block number. The rpc.LatestBlockNumber and rpc.PendingBlockNumber meta block numbers are also allowed.
func (*PublicEthAPI) GetBlockByHash ¶
func (pea *PublicEthAPI) GetBlockByHash(ctx context.Context, hash common.Hash, fullTx bool) (map[string]interface{}, error)
GetBlockByHash returns the requested block. When fullTx is true all transactions in the block are returned in full detail, otherwise only the transaction hash is returned.
func (*PublicEthAPI) GetBlockByNumber ¶
func (pea *PublicEthAPI) GetBlockByNumber(ctx context.Context, number rpc.BlockNumber, fullTx bool) (map[string]interface{}, error)
GetBlockByNumber returns the requested canonical block.
- When blockNr is -1 the chain head is returned.
- We cannot support pending block calls since we do not have an active miner
- When fullTx is true all transactions in the block are returned, otherwise only the transaction hash is returned.
func (*PublicEthAPI) GetBlockTransactionCountByHash ¶
func (pea *PublicEthAPI) GetBlockTransactionCountByHash(ctx context.Context, blockHash common.Hash) *hexutil.Uint
GetBlockTransactionCountByHash returns the number of transactions in the block with the given hash.
func (*PublicEthAPI) GetBlockTransactionCountByNumber ¶
func (pea *PublicEthAPI) GetBlockTransactionCountByNumber(ctx context.Context, blockNr rpc.BlockNumber) *hexutil.Uint
GetBlockTransactionCountByNumber returns the number of transactions in the block with the given block number.
func (*PublicEthAPI) GetCode ¶
func (pea *PublicEthAPI) GetCode(ctx context.Context, address common.Address, blockNrOrHash rpc.BlockNumberOrHash) (hexutil.Bytes, error)
GetCode returns the code stored at the given address in the state for the given block number.
func (*PublicEthAPI) GetHeaderByHash ¶
func (pea *PublicEthAPI) GetHeaderByHash(ctx context.Context, hash common.Hash) map[string]interface{}
GetHeaderByHash returns the requested header by hash.
func (*PublicEthAPI) GetHeaderByNumber ¶
func (pea *PublicEthAPI) GetHeaderByNumber(ctx context.Context, number rpc.BlockNumber) (map[string]interface{}, error)
GetHeaderByNumber returns the requested canonical block header. * When blockNr is -1 the chain head is returned. * We cannot support pending block calls since we do not have an active miner
func (*PublicEthAPI) GetLogs ¶
func (pea *PublicEthAPI) GetLogs(ctx context.Context, crit filters.FilterCriteria) ([]*types.Log, error)
GetLogs returns logs matching the given argument that are stored within the state.
func (*PublicEthAPI) GetProof ¶
func (pea *PublicEthAPI) GetProof(ctx context.Context, address common.Address, storageKeys []string, blockNrOrHash rpc.BlockNumberOrHash) (*AccountResult, error)
GetProof returns the Merkle-proof for a given account and optionally some storage keys.
func (*PublicEthAPI) GetRawTransactionByBlockHashAndIndex ¶
func (pea *PublicEthAPI) GetRawTransactionByBlockHashAndIndex(ctx context.Context, blockHash common.Hash, index hexutil.Uint) hexutil.Bytes
GetRawTransactionByBlockHashAndIndex returns the bytes of the transaction for the given block hash and index.
func (*PublicEthAPI) GetRawTransactionByBlockNumberAndIndex ¶
func (pea *PublicEthAPI) GetRawTransactionByBlockNumberAndIndex(ctx context.Context, blockNr rpc.BlockNumber, index hexutil.Uint) hexutil.Bytes
GetRawTransactionByBlockNumberAndIndex returns the bytes of the transaction for the given block number and index.
func (*PublicEthAPI) GetRawTransactionByHash ¶
func (pea *PublicEthAPI) GetRawTransactionByHash(ctx context.Context, hash common.Hash) (hexutil.Bytes, error)
GetRawTransactionByHash returns the bytes of the transaction for the given hash.
func (*PublicEthAPI) GetSlice ¶
func (pea *PublicEthAPI) GetSlice(ctx context.Context, path string, depth int, root common.Hash, storage bool) (*GetSliceResponse, error)
GetSlice returns a slice of state or storage nodes from a provided root to a provided path and past it to a certain depth
func (*PublicEthAPI) GetStorageAt ¶
func (pea *PublicEthAPI) GetStorageAt(ctx context.Context, address common.Address, key string, blockNrOrHash rpc.BlockNumberOrHash) (hexutil.Bytes, error)
GetStorageAt returns the storage from the state at the given address, key and block number. The rpc.LatestBlockNumber and rpc.PendingBlockNumber meta block numbers are also allowed.
func (*PublicEthAPI) GetTransactionByBlockHashAndIndex ¶
func (pea *PublicEthAPI) GetTransactionByBlockHashAndIndex(ctx context.Context, blockHash common.Hash, index hexutil.Uint) *RPCTransaction
GetTransactionByBlockHashAndIndex returns the transaction for the given block hash and index.
func (*PublicEthAPI) GetTransactionByBlockNumberAndIndex ¶
func (pea *PublicEthAPI) GetTransactionByBlockNumberAndIndex(ctx context.Context, blockNr rpc.BlockNumber, index hexutil.Uint) *RPCTransaction
GetTransactionByBlockNumberAndIndex returns the transaction for the given block number and index.
func (*PublicEthAPI) GetTransactionByHash ¶
func (pea *PublicEthAPI) GetTransactionByHash(ctx context.Context, hash common.Hash) (*RPCTransaction, error)
GetTransactionByHash returns the transaction for the given hash eth ipld-eth-server cannot currently handle pending/tx_pool txs
func (*PublicEthAPI) GetTransactionCount ¶
func (pea *PublicEthAPI) GetTransactionCount(ctx context.Context, address common.Address, blockNrOrHash rpc.BlockNumberOrHash) (*hexutil.Uint64, error)
GetTransactionCount returns the number of transactions the given address has sent for the given block number
func (*PublicEthAPI) GetTransactionReceipt ¶
func (pea *PublicEthAPI) GetTransactionReceipt(ctx context.Context, hash common.Hash) (map[string]interface{}, error)
GetTransactionReceipt returns the transaction receipt for the given transaction hash.
func (*PublicEthAPI) GetUncleByBlockHashAndIndex ¶
func (pea *PublicEthAPI) GetUncleByBlockHashAndIndex(ctx context.Context, blockHash common.Hash, index hexutil.Uint) (map[string]interface{}, error)
GetUncleByBlockHashAndIndex returns the uncle block for the given block hash and index. When fullTx is true all transactions in the block are returned in full detail, otherwise only the transaction hash is returned.
func (*PublicEthAPI) GetUncleByBlockNumberAndIndex ¶
func (pea *PublicEthAPI) GetUncleByBlockNumberAndIndex(ctx context.Context, blockNr rpc.BlockNumber, index hexutil.Uint) (map[string]interface{}, error)
GetUncleByBlockNumberAndIndex returns the uncle block for the given block hash and index.
func (*PublicEthAPI) GetUncleCountByBlockHash ¶
func (pea *PublicEthAPI) GetUncleCountByBlockHash(ctx context.Context, blockHash common.Hash) *hexutil.Uint
GetUncleCountByBlockHash returns number of uncles in the block for the given block hash
func (*PublicEthAPI) GetUncleCountByBlockNumber ¶
func (pea *PublicEthAPI) GetUncleCountByBlockNumber(ctx context.Context, blockNr rpc.BlockNumber) *hexutil.Uint
GetUncleCountByBlockNumber returns number of uncles in the block for the given block number
func (*PublicEthAPI) MaxPriorityFeePerGas ¶
MaxPriorityFeePerGas returns a suggestion for a gas tip cap for dynamic fee transactions.
type RPCReceipt ¶
type RPCReceipt struct { BlockHash *common.Hash `json:"blockHash"` BlockNumber *hexutil.Big `json:"blockNumber"` TransactionHash *common.Hash `json:"transactionHash"` TransactionIndex *hexutil.Uint64 `json:"transactionIndex"` From common.Address `json:"from"` To *common.Address `json:"to"` GasUsed hexutil.Uint64 `json:"gasUsed"` CumulativeGsUsed hexutil.Uint64 `json:"cumulativeGasUsed"` ContractAddress *common.Address `json:"contractAddress"` Logs []*types.Log `json:"logs"` Bloom types.Bloom `json:"logsBloom"` Root []byte `json:"root"` Status uint64 `json:"status"` }
RPCReceipt represents a receipt that will serialize to the RPC representation of a receipt
type RPCTransaction ¶
type RPCTransaction struct { BlockHash *common.Hash `json:"blockHash"` BlockNumber *hexutil.Big `json:"blockNumber"` From common.Address `json:"from"` Gas hexutil.Uint64 `json:"gas"` GasPrice *hexutil.Big `json:"gasPrice"` GasFeeCap *hexutil.Big `json:"maxFeePerGas,omitempty"` GasTipCap *hexutil.Big `json:"maxPriorityFeePerGas,omitempty"` MaxFeePerBlobGas *hexutil.Big `json:"maxFeePerBlobGas,omitempty"` Hash common.Hash `json:"hash"` Input hexutil.Bytes `json:"input"` Nonce hexutil.Uint64 `json:"nonce"` To *common.Address `json:"to"` TransactionIndex *hexutil.Uint64 `json:"transactionIndex"` Value *hexutil.Big `json:"value"` Type hexutil.Uint64 `json:"type"` Accesses *types.AccessList `json:"accessList,omitempty"` ChainID *hexutil.Big `json:"chainId,omitempty"` BlobVersionedHashes []common.Hash `json:"blobVersionedHashes,omitempty"` V *hexutil.Big `json:"v"` R *hexutil.Big `json:"r"` S *hexutil.Big `json:"s"` YParity *hexutil.Uint64 `json:"yParity,omitempty"` }
RPCTransaction represents a transaction that will serialize to the RPC representation of a transaction Note: copied from go-ethereum/internal/ethapi
func NewRPCTransaction ¶
func NewRPCTransaction(tx *types.Transaction, blockHash common.Hash, blockNumber uint64, blockTime uint64, index uint64, baseFee *big.Int, config *params.ChainConfig) *RPCTransaction
NewRPCTransaction returns a transaction that will serialize to the RPC representation, with the given location metadata set (if available).
func NewRPCTransactionFromBlockHash ¶
func NewRPCTransactionFromBlockHash(b *types.Block, hash common.Hash, config *params.ChainConfig) *RPCTransaction
newRPCTransactionFromBlockHash returns a transaction that will serialize to the RPC representation.
type ReceiptFilter ¶
type ReceiptFilter struct { Off bool // TODO: change this so that we filter for receipts first and we always return the corresponding transaction MatchTxs bool // turn on to retrieve receipts that pair with retrieved transactions LogAddresses []string // receipt contains logs from the provided addresses Topics [][]string }
ReceiptFilter contains filter settings for receipts
type RequiresProxyError ¶
type RequiresProxyError struct {
// contains filtered or unexported fields
}
func (RequiresProxyError) Error ¶
func (e RequiresProxyError) Error() string
func (RequiresProxyError) SetMethod ¶
func (e RequiresProxyError) SetMethod(method string)
type Retriever ¶
type Retriever struct {
// contains filtered or unexported fields
}
Retriever is used for fetching
func NewRetriever ¶
NewRetriever returns a pointer to a new Retriever which supports the Retriever interface
func (*Retriever) RetrieveAccountByAddressAndBlockHash ¶
func (r *Retriever) RetrieveAccountByAddressAndBlockHash(address common.Address, hash common.Hash) (StateAccountRecord, error)
RetrieveAccountByAddressAndBlockHash returns the cid and rlp bytes for the account corresponding to the provided address and block hash TODO: ensure this handles deleted accounts appropriately
func (*Retriever) RetrieveBlockNumberByHash ¶
RetrieveBlockNumberByHash returns the block number for the given block hash
func (*Retriever) RetrieveFilteredGQLLogs ¶
func (r *Retriever) RetrieveFilteredGQLLogs(tx *sqlx.Tx, rctFilter ReceiptFilter, blockHash *common.Hash, blockNumber *big.Int) ([]LogResult, error)
RetrieveFilteredGQLLogs retrieves and returns all the log CIDs provided blockHash that conform to the provided filter parameters.
func (*Retriever) RetrieveFilteredLogsForBlock ¶
func (r *Retriever) RetrieveFilteredLogsForBlock(db *sqlx.DB, rctFilter ReceiptFilter, blockHash *common.Hash) ([]LogResult, error)
RetrieveFilteredLogsForBlock retrieves and returns all the log CIDs for the block that conform to the provided filter parameters.
func (*Retriever) RetrieveFilteredLogsForBlockRange ¶
func (r *Retriever) RetrieveFilteredLogsForBlockRange(db *sqlx.DB, rctFilter ReceiptFilter, startBlockNumber int64, stopBlockNumber int64) ([]LogResult, error)
RetrieveFilteredLogsForBlockRange retrieves and returns all the log CIDs for the blocks in the range that conform to the provided filter parameters.
func (*Retriever) RetrieveFirstBlockNumber ¶
RetrieveFirstBlockNumber is used to retrieve the first block number in the db
func (*Retriever) RetrieveHeaderAndTxCIDsByBlockHash ¶
func (r *Retriever) RetrieveHeaderAndTxCIDsByBlockHash(blockHash common.Hash, blockNumber *big.Int) (HeaderCIDRecord, error)
RetrieveHeaderAndTxCIDsByBlockHash retrieves header CID and their associated tx CIDs by block hash (and optionally block number)
func (*Retriever) RetrieveHeaderAndTxCIDsByBlockNumber ¶
func (r *Retriever) RetrieveHeaderAndTxCIDsByBlockNumber(blockNumber int64) ([]HeaderCIDRecord, error)
RetrieveHeaderAndTxCIDsByBlockNumber retrieves header CIDs and their associated tx CIDs by block number
func (*Retriever) RetrieveHeaderByHash ¶
RetrieveHeaderByHash returns the cid and rlp bytes for the header corresponding to the provided block hash
func (*Retriever) RetrieveHeaderByHash2 ¶
RetrieveHeaderByHash2 returns the cid and rlp bytes for the header corresponding to the provided block hash using a sqlx.Tx
func (*Retriever) RetrieveLastBlockNumber ¶
RetrieveLastBlockNumber is used to retrieve the latest block number in the db
func (*Retriever) RetrieveReceipts ¶
func (r *Retriever) RetrieveReceipts(tx *sqlx.Tx, hash common.Hash, number uint64) ([]string, [][]byte, []common.Hash, error)
RetrieveReceipts returns the cids and rlp bytes for the receipts corresponding to the provided block hash, number. cid returned corresponds to the leaf node data which contains the receipt.
func (*Retriever) RetrieveReceiptsByBlockHash ¶
func (r *Retriever) RetrieveReceiptsByBlockHash(tx *sqlx.Tx, hash common.Hash) ([]string, [][]byte, []common.Hash, error)
RetrieveReceiptsByBlockHash returns the cids and rlp bytes for the receipts corresponding to the provided block hash. cid returned corresponds to the leaf node data which contains the receipt.
func (*Retriever) RetrieveStorageAndRLP ¶
func (r *Retriever) RetrieveStorageAndRLP(address common.Address, key, hash common.Hash) (string, []byte, error)
RetrieveStorageAndRLP returns the cid and rlp bytes for the storage value corresponding to the provided address, storage slot, and block hash
func (*Retriever) RetrieveStorageAtByAddressAndStorageSlotAndBlockHash ¶
func (r *Retriever) RetrieveStorageAtByAddressAndStorageSlotAndBlockHash(address common.Address, key, hash common.Hash) ([]byte, error)
RetrieveStorageAtByAddressAndStorageSlotAndBlockHash returns the cid and rlp bytes for the storage value corresponding to the provided address, storage slot, and block hash
func (*Retriever) RetrieveTransactions ¶
func (r *Retriever) RetrieveTransactions(tx *sqlx.Tx, hash common.Hash, number uint64) ([]string, [][]byte, error)
RetrieveTransactions returns the cids and rlp bytes for the transactions corresponding to the provided block hash, number
func (*Retriever) RetrieveTransactionsByBlockHash ¶
func (r *Retriever) RetrieveTransactionsByBlockHash(tx *sqlx.Tx, hash common.Hash) ([]string, [][]byte, error)
RetrieveTransactionsByBlockHash returns the cids and rlp bytes for the transactions corresponding to the provided block hash
func (*Retriever) RetrieveTxCIDByHash ¶
func (r *Retriever) RetrieveTxCIDByHash(txHash string, blockNumber *big.Int) (TransactionCIDRecord, error)
RetrieveTxCIDByHash returns the tx for the given tx hash (and optionally block number)
func (*Retriever) RetrieveUncles ¶
func (r *Retriever) RetrieveUncles(tx *sqlx.Tx, hash common.Hash, number uint64) (string, []byte, error)
RetrieveUncles returns the cid and rlp bytes for the uncle list corresponding to the provided block hash, number (of non-omner root block)
func (*Retriever) RetrieveUnclesByBlockHash ¶
func (r *Retriever) RetrieveUnclesByBlockHash(tx *sqlx.Tx, hash common.Hash) (string, []byte, error)
RetrieveUnclesByBlockHash returns the cid and rlp bytes for the uncle list corresponding to the provided block hash (of non-omner root block)
func (*Retriever) RetrieveWithdrawals ¶
func (r *Retriever) RetrieveWithdrawals(tx *sqlx.Tx, hash common.Hash, number uint64) ([]string, [][]byte, error)
RetrieveWithdrawals returns the CIDs and RLP bytes for the withdrawals corresponding to the provided block hash, number. Returned CIDs correspond to the leaf node data which contains the withdrawal object.
type StateAccountRecord ¶
type StateNode ¶
type StateNode struct { NodeType NodeType `json:"nodeType" gencodec:"required"` Path []byte `json:"path" gencodec:"required"` NodeValue []byte `json:"value" gencodec:"required"` StorageNodes []StorageNode `json:"storage"` LeafKey []byte `json:"leafKey"` }
StateNode holds the data for a single state diff node
func ResolveNode ¶
func ResolveNodeIt ¶
ResolveNodeIt return the state diff node pointed by the iterator.
type StateOverride ¶
type StateOverride map[common.Address]OverrideAccount
StateOverride is the collection of overridden accounts.
func (*StateOverride) Apply ¶
func (diff *StateOverride) Apply(state *ipld_direct_state.StateDB) error
Apply overrides the fields of specified accounts into the given state.
type StorageNode ¶
type StorageNode struct { NodeType NodeType `json:"nodeType" gencodec:"required"` Path []byte `json:"path" gencodec:"required"` NodeValue []byte `json:"value" gencodec:"required"` LeafKey []byte `json:"leafKey"` }
StorageNode holds the data for a single storage diff node
type StorageResult ¶
type StorageResult struct { Key string `json:"key"` Value *hexutil.Big `json:"value"` Proof []string `json:"proof"` }
StorageResult for GetProof
type TransactionArgs ¶
type TransactionArgs struct { From *common.Address `json:"from"` To *common.Address `json:"to"` Gas *hexutil.Uint64 `json:"gas"` GasPrice *hexutil.Big `json:"gasPrice"` MaxFeePerGas *hexutil.Big `json:"maxFeePerGas"` MaxPriorityFeePerGas *hexutil.Big `json:"maxPriorityFeePerGas"` Value *hexutil.Big `json:"value"` Nonce *hexutil.Uint64 `json:"nonce"` // We accept "data" and "input" for backwards-compatibility reasons. // "input" is the newer name and should be preferred by clients. // Issue detail: https://github.com/ethereum/go-ethereum/issues/15628 Data *hexutil.Bytes `json:"data"` Input *hexutil.Bytes `json:"input"` // Introduced by AccessListTxType transaction. AccessList *types.AccessList `json:"accessList,omitempty"` ChainID *hexutil.Big `json:"chainId,omitempty"` }
TransactionArgs represents the arguments to construct a new transaction or a message call.
type TransactionCIDRecord ¶
type TransactionCIDRecord struct { CID string `gorm:"column:cid"` TxHash string `gorm:"primaryKey"` BlockNumber string `gorm:"primaryKey"` HeaderID string `gorm:"column:header_id"` Index int64 Src string Dst string IPLD IPLDModelRecord `gorm:"foreignKey:CID,BlockNumber;references:Key,BlockNumber"` }
func (TransactionCIDRecord) TableName ¶
func (TransactionCIDRecord) TableName() string
TableName overrides the table name used by TransactionCIDRecord