1

I want to iterate (from a Python program) over all the outputs of all the transactions on the blockchain. Is there any RCP command or something like that, that returns a structure of transactions as is and not their hashes?

Thank you all!

2

https://getmonero.org/resources/developer-guides/daemon-rpc.html

Documents all the API methods you would need.

You would first use get_block_count then iterate calling get_block, then calling get_transactions with the returned tx_hashes from get_block.

  • It's great, thanks! Do you know how to see transaction's outputs? because get_transactions doesn't show me outputs (amount and key), the only output related data is "output_indices'. – adsl Oct 16 '18 at 12:11
  • Add "decode_as_json":true to the request. – jtgrassie Oct 16 '18 at 13:04
  • I'v done that, but when I do nothing is showing up. this is the code that show me json: response = requests.post( "localhost:28081/gettransactions", data=json.dumps({"txs_hashes": all_tx_hashes}), headers=headers) print(response.content) and this code show nothing: response = requests.post( "localhost:28081/gettransactions", data=json.dumps({"txs_hashes": all_tx_hashes,"decode_as_json":'true'}), headers=headers) print(response.content) – adsl Oct 16 '18 at 13:20
  • curl -X POST http://127.0.0.1:28081/get_transactions -d '{"txs_hashes":["80ba003b5115a66e3aa77b6e6d4c8d5ef71e8a9806b4a9a1c69dc4c3f325251e"],"decode_as_json":true}' -H 'Content-Type: application/json works fine for me. – jtgrassie Oct 16 '18 at 13:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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