Closed tolak closed 6 years ago
@tolak I'm sorry but I'm unable to replicate this issue. I've started a new (clean) bitcoin node, did a generate 50, then a curl to http://localhost:18333/rest/chaininfo.json
. Grabbed the bestblockhash
hex, tried executing getBlockByHash(hash)
and the client returned successfully. Then from that call, I grabbed a txid. Requested getTransactionByHash(txid)
and the response was successful again.
Comparing the curl to the client (node) request, both reply equally and to the same endpoints. If you want to double check yourself, run your script with NODE_DEBUG=request node script.js
.
The problem is when i use bitcoin-core api, such as getinfo(), getBalance() and they all work fine. But there are three api can not work. They are getTransactionByHash() , getBlockByHash() and getBlockchainInformation(). They all throw error: "RpcError: Not Found". The txid and the block-hash are all exist and correct. I used "curl" to make a rpc call and all of it returned what i want.
Here is my code