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?
2 Answers
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.
-
Doesn't explain how to parse internal transactions (i.e. message calls). Commented Jul 10, 2019 at 15:50
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.