Documentation ¶
Index ¶
- Variables
- func CanonicalHex(input string) string
- func CombinePolygonSystemTransactions(traces []*pbeth.TransactionTrace, blockNum uint64, blockHash []byte) (out []*pbeth.TransactionTrace, systemTransactionHashes hashes)
- func ConcatHex(with0x bool, in ...string) (out string)
- func DecodeHex(input string) ([]byte, error)
- func FromHeader(header *BlockHeader) *pbeth.BlockHeader
- func FromHex(input string, tag string) []byte
- func FromInt32(input string, tag string) int32
- func FromUint32(input string, tag string) uint32
- func FromUint64(input string, tag string) uint64
- func Has0xPrefix(input string) bool
- func NormalizeSignaturePoint(value []byte) []byte
- func PrefixedHex(input string) string
- func SanitizeHex(input string) string
- func SplitInBoundedChunks(line string, count int) ([]string, error)
- func SplitInChunks(line string, validCounts ...int) ([]string, error)
- type BlockHeader
- type BloomFilter
- type ConsoleReader
- type Log
Constants ¶
This section is empty.
Variables ¶
var BlockReadCount = metrics.NewCounter("block_read_count", "The number of blocks read by the Console Reader")
var BlockTotalParseTime = metrics.NewCounter("block_total_parse_time", "The total parse time (wall clock) it took to extract all blocks so far")
var TransactionReadCount = metrics.NewCounter("trx_read_count", "The number of transactions read by the Console Reader")
var TrxTotalParseTime = metrics.NewCounter("trx_total_parse_time", "The total parse time (wall clock) it took to extract all transactions so far")
Functions ¶
func CanonicalHex ¶
CanonicalHex receives an input and return it's canonical form, i.e. the single unique well-formed which in our case is an all-lower case version with even number of characters.
The only differences with `SanitizeHexInput` here is an additional call to `strings.ToLower` before returning the result.
func CombinePolygonSystemTransactions ¶ added in v1.1.11
func CombinePolygonSystemTransactions(traces []*pbeth.TransactionTrace, blockNum uint64, blockHash []byte) (out []*pbeth.TransactionTrace, systemTransactionHashes hashes)
CombinePolygonSystemTransactions will identify transactions that are "system transactions" and merge them into a single transaction with a predictive name, like the `bor` client does. It reorders the calls and logs to match expected output from RPC API.
func FromHeader ¶
func FromHeader(header *BlockHeader) *pbeth.BlockHeader
func FromUint32 ¶
func FromUint64 ¶
func Has0xPrefix ¶
func NormalizeSignaturePoint ¶ added in v1.1.11
func PrefixedHex ¶
PrefixedHex is CanonicalHex but with 0x prefix
func SanitizeHex ¶
SanitizeHex removes the prefix `0x` if it exists and ensures there is an even number of characters in the string, padding on the left of the string is it's not the case.
func SplitInBoundedChunks ¶
SplitInBoundedChunks splits the line in `count` chunks and returns the slice `chunks[1:count]` (so exclusive end), but will accumulate all trailing chunks within the last (for free-form strings, or JSON objects)
Types ¶
type BlockHeader ¶
type BlockHeader struct { Hash eth.Hash `json:"hash"` ParentHash eth.Hash `json:"parentHash"` UncleHash eth.Hash `json:"sha3Uncles"` Coinbase eth.Address `json:"miner"` Root eth.Hash `json:"stateRoot"` TxHash eth.Hash `json:"transactionsRoot"` ReceiptHash eth.Hash `json:"receiptsRoot"` Bloom eth.Hex `json:"logsBloom"` Difficulty eth.Hex `json:"difficulty"` Number eth.Uint64 `json:"number"` GasLimit eth.Uint64 `json:"gasLimit"` GasUsed eth.Uint64 `json:"gasUsed"` Time eth.Uint64 `json:"timestamp"` Extra eth.Hex `json:"extraData"` MixDigest eth.Hash `json:"mixHash"` Nonce eth.Uint64 `json:"nonce"` BaseFeePerGas eth.Hex `json:"baseFeePerGas"` WithdrawalsHash eth.Hex `json:"withdrawalsRoot"` TxDependency [][]eth.Uint64 `json:"txDependency"` }
type BloomFilter ¶ added in v1.1.11
type BloomFilter [256]byte
type ConsoleReader ¶
type ConsoleReader struct {
// contains filtered or unexported fields
}
ConsoleReader is what reads the `geth` output directly. It builds up some LogEntry objects. See `LogReader to read those entries .
func NewConsoleReader ¶
func NewConsoleReader(logger *zap.Logger, lines chan string) (*ConsoleReader, error)
func (*ConsoleReader) Close ¶
func (c *ConsoleReader) Close()
func (*ConsoleReader) ProcessData ¶
func (c *ConsoleReader) ProcessData(reader io.Reader) error
func (*ConsoleReader) ReadBlock ¶
func (c *ConsoleReader) ReadBlock() (out *bstream.Block, err error)
func (ConsoleReader) ReadTransaction ¶
func (c ConsoleReader) ReadTransaction() (trace *pbeth.TransactionTrace, err error)