Debug

Thor debug functionalities.

The DebugModulearrow-up-right class encapsulates functionality to debug the VeChainThor blockchain.

The module provides methods to interact with the debug end points provided by

Retrieve Storage Range

The retrieveStorageRange method provides information about the storage range of an account, including the nextKey which is a string that can be null, and storage which is an object.

In this example the thorClient connects to the testnet to retrieve the storage range for the coordinates passed as input parameter.

// 1 - Create thor client for testnet
const thorClient = ThorClient.at(TESTNET_URL);

// 2 - Retrieve the storage range.
const result = await thorClient.debug.retrieveStorageRange({
    target: {
        blockId: BlockId.of(
            '0x010e80e3278e234b8a5d1195c376909456b94d1f7cf3cb7bfab1e8998dbcfa8f'
        ),
        transaction: 0,
        clauseIndex: 0
    },
    options: {
        address: Address.of('0x0000000000000000000000000000456E65726779'),
        keyStart: BlockId.of(
            '0x0000000000000000000000000000000000000000000000000000000000000000'
        ),
        maxResult: 10
    }
});

// 3 - Print the result.
console.log(result);
chevron-rightThe result will show the storage.hashtag

Trace Contract Call

The traceContractCall traces the contract call execution.

In this example the thorClient connects to the testnet to trace the contract at the coordinates specified in the input parameter.

chevron-rightThe result shows the trace, here only the first element is shown.hashtag

Trace Transaction Clause

The traceTransactionClause method trace the transactions specified in the clause at the coordinates expressed in the input parameter.

In this example the thorClient connects to the testnet to trace the clause at the coordinates specified in the input parameter.

chevron-rightThe result shows the following.hashtag

Last updated

Was this helpful?