Following answer (https://ethereum.stackexchange.com/a/9437/4575) [ 1 ] guide us to call debug_trace through using geth:
As documented in debug.traceTransaction(...), you can only access this API call using the geth JavaScript console or the JSON-RPC API. There is no web3 API that I know of. There are some unofficial extension web3 APIs, but I don't know if debug.traceTransaction is supported by these. Looks like you have to use JSON-RPC to access this data.
but I was wondering is it possible to call debug_Transaction inside nodejs ?
I tried the steps on https://ethereum.stackexchange.com/a/9462/4575 [ 2 ] but it seems does not work for me and this answer seems contradict with the previous answer I have lined on [ 1 ].
var web3 = new Web3();
web3.setProvider(new web3.providers.HttpProvider('http://localhost:8545'));
web3.currentProvider.sendAsync({
method: "debug_traceTransaction",
params: ['<transaction_id>', {}],
jsonrpc: "2.0",
id: "2"
}, function (err, result) {
console.log( result );
});
Output result:
{ jsonrpc: '2.0',
id: '2',
error:
{ code: -32601,
message: 'The method debug_traceTransaction does not exist/is not available' } }
Thank you for your valuable time and help.
geth, and I appreciated your answer. My question is about (I just wanted to double check) , does your answer means that am I require to usegethsince it is not possible to calldebug_traceTransactionthroughnodejsor other applications? The reason I need to calldebug_traceTransactionis related to your answer to check transaction status. [http://ethereum.stackexchange.com/a/6011/4575] – alper Dec 19 '16 at 13:39--rpcapi ...debugoption, it seems that your nodejs call todebug_traceTransactionis getting togethvia JSON-RPC butgethis returning the message that thedebug_traceTransactioncall is unavailable. So theoretically you should be able to accessdebug_traceTransactionvia nodejs. Am I missing something else? – BokkyPooBah Dec 19 '16 at 13:46gethworks as you recommended and it works thatgethreturns me thedebug_traceTransactioninformation. So the issue might be related to the way I am callingdebug_traceTransactioninsidenodejs, wherenodejsunable to find/calldebug_traceTransactionfunction. – alper Dec 19 '16 at 13:53debug_traceTransaction. – BokkyPooBah Dec 19 '16 at 14:04Error: The method admin_datadir does not exist/is not available.– alper Dec 19 '16 at 14:29adminto the--rpcapioption? – BokkyPooBah Dec 19 '16 at 14:35