btcd icon indicating copy to clipboard operation
btcd copied to clipboard

rpcclient: no way to set 'verbosity' parameter on GetBlock rpc call

Open Avionic23 opened this issue 1 year ago • 5 comments

Avionic23 avatar Jan 04 '24 10:01 Avionic23

Hey @Avionic23 , I would like to pick up on this issue. Any progress on your end?

joseguru avatar Mar 05 '24 05:03 joseguru

@Avionic23 Just went through the docs and I found GetBlockVerbose function which returns a data structure from the server with information about a block given its hash. I think this should help

joseguru avatar Mar 06 '24 12:03 joseguru

Hey @joseguru. Sorry, I was busy, couldn't respond you. There is a possibility to set verbose parameter '3' for block rpc and the response data structure is different from '2' (the input of the transaction includes previous PK script with all related info). I didn't find any related function with '3' verbosity in btcd package, so I implemented it on my own

Avionic23 avatar Mar 06 '24 12:03 Avionic23

Screenshot 2024-03-06 at 17 11 19

Avionic23 avatar Mar 06 '24 15:03 Avionic23

@joseguru As you can see the '2' parameter is hard-coded in RPC request for GetBlockVerboseTx function. For GetBlockVerbose function the '1' parameter is passed. Also, there is a possibility to pass '3' parameter, but I assume you cannot find that in the documentation.

Avionic23 avatar Mar 06 '24 15:03 Avionic23