Skip to content

feat: added hemi btc block rpc calls#69

Open
ClaytonNorthey92 wants to merge 5 commits intohemifrom
clayton/expose-bitcoin
Open

feat: added hemi btc block rpc calls#69
ClaytonNorthey92 wants to merge 5 commits intohemifrom
clayton/expose-bitcoin

Conversation

@ClaytonNorthey92
Copy link

@ClaytonNorthey92 ClaytonNorthey92 commented Jan 23, 2026

added two new endpoints:

  • hemi_getBtcBlockByHash
  • hemi_getBtcBlockHeaderByHash

added tests

fixes #68

examples:

curl http://localhost:18546   -X POST   -H "Content-Type: application/json"   --data '{"id": 1, "jsonrpc": "2.0", "method": "hemi_getBtcBlockByHash", "params": ["0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206"]}'

{"jsonrpc":"2.0","id":1,"result":{"Header":{"Version":1,"PrevBlock":"0000000000000000000000000000000000000000000000000000000000000000","MerkleRoot":"4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b","Timestamp":"2011-02-02T23:16:42Z","Bits":545259519,"Nonce":2},"Transactions":[{"Version":1,"TxIn":[{"PreviousOutPoint":{"Hash":"0000000000000000000000000000000000000000000000000000000000000000","Index":4294967295},"SignatureScript":"BP//AB0BBEVUaGUgVGltZXMgMDMvSmFuLzIwMDkgQ2hhbmNlbGxvciBvbiBicmluayBvZiBzZWNvbmQgYmFpbG91dCBmb3IgYmFua3M=","Witness":null,"Sequence":4294967295}],"TxOut":[{"Value":5000000000,"PkScript":"QQRniv2w/lVIJxln8aZxMLcQXNaoKOA5CaZ5YuDqH2Hetkn2vD9M7zjE81UE5R7BEt5cOE33uguNV4pMcCtr8R1frA=="}],"LockTime":0}]}}
curl http://localhost:18546   -X POST   -H "Content-Type: application/json"   --data '{"id": 1, "jsonrpc": "2.0", "method": "hemi_getBtcBlockHeaderByHash", "params": ["0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206"]}'

{"jsonrpc":"2.0","id":1,"result":{"Version":1,"PrevBlock":"0000000000000000000000000000000000000000000000000000000000000000","MerkleRoot":"4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b","Timestamp":"2011-02-02T23:16:42Z","Bits":545259519,"Nonce":2}}

added two new endpoints:
* hemi_getBtcBlockByHash
* hemi_getBtcBlockHeaderByHash

added tests

fixes #68
@ClaytonNorthey92 ClaytonNorthey92 changed the title Clayton/expose bitcoin feat: added hemi btc block rpc calls Jan 23, 2026
@ClaytonNorthey92 ClaytonNorthey92 marked this pull request as ready for review January 23, 2026 22:59
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

Successfully merging this pull request may close these issues.

feat: expose endpoints to get bitcoin block info

1 participant