0

I am trying to use the get_block JSON RPC endpoint documented here: https://www.getmonero.org/resources/developer-guides/daemon-rpc.html#get_block

The trouble I'm having is that when I call it, the returned data structure has an empty array at result.json.tx_hashes. The documentation suggests that the tx_hashes field should have an array of all the tx hashes included in the block. But whatever block I search for, the array is empty. I've tried this with multiple independent nodes (my own plus a couple of public ones).

To take an example from the block explorer, if I query the get_transactions endpoint for TXID 88169753514b6732bb28cf73e4dd58b9f0a2863d5851f43110ff10e6879f3254, the returned data shows that this TX is included in the block at height 2631608. But if I call the get_block endpoint for height 2631608, then the tx_hashes array is empty.

Is this a known issue in the monerod RPC interface? Or am I just doing something wrong?

1 Answer 1

1

It's there and working (I verified on multiple nodes):

curl -sd '{"jsonrpc":"2.0","id":"0","method":"getblock","params":{"height":2631608}}' \
    http://node.supportxmr.com:18081/json_rpc | jq .result.tx_hashes
[                                                                    
   "88169753514b6732bb28cf73e4dd58b9f0a2863d5851f43110ff10e6879f3254",
   ...
   "3f8a44ad64e88c0b6e0a1c81e297a675dd28926740ef0d085b21186bc240df01"
]

If you don't see it, try another node.

1
  • 1
    Never mind, problem was just me being dumb. Didn't have the "height" argument in the "Params" sub-object, just had it in the main json body. Apologies.
    – Nick W.
    May 30, 2022 at 5:33

Your Answer

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

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