I want read transations data "input" field from ethereum to file.How can i do it?thanks.
Asked
Active
Viewed 291 times
0
-
Geth uses LevelDB as storage, you can look at several similar questions https://ethereum.stackexchange.com/questions/2479/what-is-the-composition-of-the-blockchain-database, https://ethereum.stackexchange.com/questions/31628/how-open-local-ethereum-chain-leveldb-using-nodejs-levelup-package how to interpret that data. IMHO the best source of information about that is the go-ethereum source code. – Ismael Dec 22 '17 at 18:41
2 Answers
0
You can do that by creating a node script and using web3.js in it. Create an instance of the contract and using that instance use call the get methods. Then write that data to the database or make/open a file and write it there. Hope it helps. :)
Kashish Khullar
- 1,563
- 3
- 14
- 26
0
Given a transaction hash, you can call eth_getTransactionByHash on any node. Here's an example of getting the input from a transaction via Etherscan's proxy API:
$ http get 'https://api.etherscan.io/api?module=proxy&action=eth_getTransactionByHash&txhash=0x71027a0605ac52827e3a13700898cc54cb6a69e320dca637a82ada30497c45be&apikey=YourApiKeyToken' | jq -r .result.input 0x0a3b0a4f000000000000000000000000d485137c45a968e7fee9249485ff07493c574d71
user19510
- 27,999
- 2
- 30
- 48