In a private blockchain, is it possible to list the transactions based on from and to parameters in a transaction.
Is it possible to check the latest transaction from or to an address?
Also, is it possible to check the time of a specific transaction?
Since all this data is in the blockchain, can we do this through the javacsript console in geth?
Best Answer
Take a look at
web3.ETH.filter
Parameters
String|Object - The string "latest" or "pending" to watch for changes in the latest block or pending transactions respectively. Or a filter options object as follows:
String|Object
- The string"latest"
or"pending"
to watch for changes in the latest block or pending transactions respectively. Or a filter options object as follows:fromBlock
:Number|String
- The number of the earliest block (latest
may be given to mean the most recent andpending
currently mining, block). By defaultlatest
.toBlock
:Number|String
- The number of the latest block (latest
may be given to mean the most recent andpending
currently mining, block). By defaultlatest
.address
:String
- An address or a list of addresses to only get logs from particular account(s).topics
:Array of Strings
- An array of values which must each appear in the log entries. The order is important, if you want to leave topics out usenull
, e.g.[null, '0x00...']
. You can also pass another array for each topic with options for that topic e.g.[null, ['option1', 'option2']]
EG:
Link for the script (not filter) to get the transactions to/from an account.
Issue in the Go-ethereum github to implement this functionality (
eth.listTransactions
) by default.Latest update from Ethereum Developers: