Documentation Index
Fetch the complete documentation index at: https://mintlify.com/buildonviction/victionchain/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Thedebug namespace offers methods for debugging transactions, tracing execution, inspecting state, and diagnosing blockchain issues.
Transaction Tracing
debug_traceTransaction
Returns a detailed trace of a transaction’s execution.Transaction hash (32 bytes, hex encoded)
Trace configuration options
Execution trace with opcode-level details
debug_traceBlockByNumber
Traces all transactions in a block by block number.Block number (hex) or “latest”
Trace configuration (same as debug_traceTransaction)
Array of transaction traces for all transactions in the block
debug_traceBlockByHash
Traces all transactions in a block by block hash.Block hash (32 bytes, hex encoded)
Trace configuration (same as debug_traceTransaction)
debug_traceBlock
Traces all transactions in a raw block.RLP-encoded block data (hex)
Trace configuration
Block Inspection
debug_dumpBlock
Returns the state of all accounts at a given block.Block number (hex) or “latest”, “earliest”, “pending”
State dump containing all account data
debug_printBlock
Returns a human-readable representation of a block.Block number (decimal)
Pretty-printed block information
debug_getBlockRlp
Returns RLP-encoded block data.Block number (decimal)
RLP-encoded block (hex)
State Inspection
debug_storageRangeAt
Returns storage entries for a contract at a specific transaction.Block hash
Transaction index in block
Contract address
Starting storage key (hex)
Maximum number of entries to return
Storage range result
debug_preimage
Returns the preimage of a hash stored in the database.Hash (32 bytes, hex)
Preimage data (hex) or null if not found
debug_getModifiedAccountsByNumber
Returns accounts modified between two blocks.Start block number (decimal)
End block number (decimal, optional)
Array of addresses that were modified
debug_getModifiedAccountsByHash
Returns accounts modified between two blocks (by hash).Start block hash
End block hash (optional)
Bad Blocks
debug_getBadBlocks
Returns a list of recently rejected bad blocks.Array of bad block objects with rejection reasons
Chain Management
debug_setHead
Rewinds the blockchain to a specific block number.Block number to rewind to (hex)
debug_seedHash
Returns the seed hash used for PoW at a given block.Block number (decimal)
Seed hash (hex)
Database Operations
debug_chaindbProperty
Returns LevelDB properties.Property name (e.g., “leveldb.stats”)
Property value
debug_chaindbCompact
Triggers a database compaction.null on success
Database compaction can take significant time and resources. Run during low-traffic periods.
Usage Examples
JavaScript - Transaction Tracing
Python - State Inspection
Call Tracer Example
Performance Considerations
Best Practices
- Use timeouts: Always set reasonable timeouts for trace operations
- Disable unnecessary data: Use
disableStorage,disableMemory,disableStackto reduce overhead - Limit scope: Trace specific transactions rather than entire blocks when possible
- Cache results: Store trace results to avoid recomputation
- Use dedicated nodes: Run debug operations on separate nodes from production RPC
Enabling Debug APIs
To enable debug APIs on a Viction node:Common Use Cases
Transaction Debugging
Trace failed transactions to identify revert reasons and execution flow
Gas Optimization
Analyze opcode execution to optimize gas usage in smart contracts
State Analysis
Inspect contract storage and account states at specific blocks
Security Auditing
Trace contract interactions to verify security properties