Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use 'qscc/GetBlockByHash' in peer CLI and Java gateway? #4994

Open
1164926307 opened this issue Sep 26, 2024 · 2 comments
Open

How to use 'qscc/GetBlockByHash' in peer CLI and Java gateway? #4994

1164926307 opened this issue Sep 26, 2024 · 2 comments

Comments

@1164926307
Copy link

I failed to use qscc/GetBlockByHash on the Java gateway and peer CLI, and I couldn't find any relevant information on the network. But I can use 'blockchain explorer' to retrieve the correct information.
{A4ZO2HHSLAH62I failed to use qscc/GetBlockByHash on the Java gateway and peer CLI, and I couldn't find any relevant information on the network. But I can use 'blockchain explorer' to retrieve the correct information. {KB7V~R
H%7TNSORU7JV@V{S9YLQM9V
KS@_64QU38IDXP}C65T9 LQ

@Rezacb0413
Copy link

I failed to use qscc/GetBlockByHash on the Java gateway and peer CLI, and I couldn't find any relevant information on the network. But I can use 'blockchain explorer' to retrieve the correct information.
{A4ZO2HHSLAH62I failed to use qscc/GetBlockByHash on the Java gateway and peer CLI, and I couldn't find any relevant information on the network. But I can use 'blockchain explorer' to retrieve the correct information. {KB7V~R
H%7TNSORU7JV@V{S9YLQM9V
KS@_64QU38IDXP}C65T9 LQ

@samuelvenzi
Copy link

Hi, you cannot send the hash string directly. You need to decode it into bytes representing the hexadecimal, cast it to string and send it. Something like this:

String blockHash = "your_hex_string_here";  // Replace with your actual hex string
byte[] hashBytes = HexFormat.of().parseHex(blockHash);

Let me know whether you are able to get the block by hash that way. I am interested in this because I am running into problems with the same function, as outlined in #5003.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants