0

is that possible to receive all transactions from new block with light node and parse all and even internal transactions with the help of its api?

1
  • What data are you hoping to glean by parsing the internal transactions?
    – foba
    Commented Jul 10, 2019 at 18:58

2 Answers 2

0

You can achieve this with Web3 API and what could you do here is first use:

web3.eth.getBlock('latest')

This will return all the latest block data including transactions array with all the transaction hashes inside this block. Then you can loop the transaction hashes array and use:

web3.eth.getTransaction(transactionHash)

This will return the transaction data including from, to, value and more.

1
  • Doesn't explain how to parse internal transactions (i.e. message calls). Commented Jul 10, 2019 at 15:50
0

As far as I know, you cannot. Some full node clients have functionality (i.e. the Parity Trace module) for parsing transaction message calls, though these are not even standardized in the ETH JSON-RPC protocol. Even with these modules, it is not simple to parse all internal transactions (assuming you mean ETH transfers) from a block.

Parsing internal transactions requires a live EVM to capture all message calls that occur as a result of a transaction. Light clients (in general, as I do not know which one you are using) are not actually processing transactions, but just receiving the required data and verifying that it exists in the blockchain.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.