monitor

package
v0.1.5-tenderly Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 5, 2026 License: GPL-3.0, LGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Fixed chain name
	CHAIN_NAME = "X Layer"

	// Fixed business name
	BUSINESS_NAME = "X Layer"

	// Fixed chain ID
	CHAIN_ID = "196"

	// RPC service name
	RPC_SERVICE_NAME = "okx-defi-xlayer-rpcpay-pro"

	// Sequencer service name
	SEQ_SERVICE_NAME = "okx-defi-xlayer-egseqz-pro"
)
View Source
const (
	// DepositTxType is the transaction type for deposit transactions (system transactions)
	DepositTxType = 0x7E

	// Number of log entries to write before forcing a flush
	FLUSH_INTERVAL_WRITES = 100

	// Time interval between flushes (in seconds)
	FLUSH_INTERVAL_SECONDS = 1
)

Variables

This section is empty.

Functions

func CloseTraceLogger

func CloseTraceLogger()

CloseTraceLogger closes the trace logger

func Flush

func Flush()

Flush forces a flush of the trace file

func InitTraceLogger

func InitTraceLogger(enabled bool, logPath string)

InitTraceLogger initializes the global trace logger When enabled is true, logPath should be provided (default path is set if not specified). All trace logs are written to file only, not to console.

func LogBlock

func LogBlock(blockHash string, blockNumber uint64, processID TransactionProcessId)

LogBlock logs a block event at current time point This matches the reth implementation: log_block(block_hash, block_number, process_id)

func LogBlockWithTimestamp

func LogBlockWithTimestamp(blockHash string, blockNumber uint64, processID TransactionProcessId, timestampMs uint64)

LogBlockWithTimestamp logs a block event with a specific timestamp This matches the reth implementation: log_block_with_timestamp(block_hash, block_number, process_id, timestamp_ms)

func LogTransaction

func LogTransaction(txHash string, processID TransactionProcessId, blockNumber uint64)

LogTransaction logs a transaction event at current time point This matches the reth implementation: log_transaction(tx_hash, process_id, block_number)

Types

type TraceLogger

type TraceLogger struct {
	// contains filtered or unexported fields
}

TraceLogger handles transaction trace logging

type TransactionProcessId

type TransactionProcessId uint64

TransactionProcessId represents different stages in the transaction lifecycle These IDs match the reth implementation for consistency

const (
	// RPC node: Transaction received and ready to forward
	RpcReceiveTxEnd TransactionProcessId = 15010

	// Sequencer node: Transaction received and added to pool
	SeqReceiveTxEnd TransactionProcessId = 15030

	// Sequencer node: Block building started
	SeqBlockBuildStart TransactionProcessId = 15032

	// Sequencer node: Transaction execution completed
	SeqTxExecutionEnd TransactionProcessId = 15034

	// Sequencer node: Block building completed
	SeqBlockBuildEnd TransactionProcessId = 15036

	// Sequencer node: Block sending started
	SeqBlockSendStart TransactionProcessId = 15042

	// RPC node: Block received from sequencer
	RpcBlockReceiveEnd TransactionProcessId = 15060

	// RPC node: Block insertion completed
	RpcBlockInsertEnd TransactionProcessId = 15062
)

func (TransactionProcessId) ServiceName

func (p TransactionProcessId) ServiceName() string

ServiceName returns the service name based on the process ID

func (TransactionProcessId) String

func (p TransactionProcessId) String() string

String returns the string representation of the process ID

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL