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

Could not connect to local Bitcoin node #89

Open
NicolaPez opened this issue Feb 2, 2021 · 1 comment
Open

Could not connect to local Bitcoin node #89

NicolaPez opened this issue Feb 2, 2021 · 1 comment

Comments

@NicolaPez
Copy link

Hi there,

sometimes ago I developed a machine that validate my ots file, that return true/false if the validation worked well.
Now =I'm tested that code, and i receive this response:

Could not connect to local Bitcoin node
Could not connect to local Bitcoin node
Could not connect to local Bitcoin node
Insight response error: RequestError: Error: getaddrinfo ENOTFOUND btc-bitcore4.trezor.io btc-bitcore4.trezor.io:443
Insight response error: RequestError: Error: getaddrinfo ENOTFOUND btc-bitcore1.trezor.io btc-bitcore1.trezor.io:443
Insight response error: RequestError: Error: getaddrinfo ENOTFOUND btc-bitcore1.trezor.io btc-bitcore1.trezor.io:443
Insight response error: RequestError: Error: getaddrinfo ENOTFOUND btc-bitcore4.trezor.io btc-bitcore4.trezor.io:443
Insight response error: RequestError: Error: getaddrinfo ENOTFOUND btc-bitcore1.trezor.io btc-bitcore1.trezor.io:443
Insight response error: RequestError: Error: getaddrinfo ENOTFOUND btc-bitcore4.trezor.io btc-bitcore4.trezor.io:443
Insight response error: StatusCodeError: 404 - "endpoint does not exist \"/block-index/581162\""
Insight response error: StatusCodeError: 404 - "endpoint does not exist \"/block-index/581162\""
Insight response error: StatusCodeError: 404 - "endpoint does not exist \"/block-index/581162\""
Insight response error: StatusCodeError: 525 - "<html>\r\n<head><title>525 Origin SSL Handshake Error</title></head>\r\n<body bgcolor=\"white\">\r\n<center><h1>525 Origin SSL Handshake Error</h1></center>\r\n<hr><center>cloudflare-nginx</center>\r\n</body>\r\n</html>\r\n"
Insight response error: StatusCodeError: 526 - "<html>\r\n<head><title>526 Origin SSL Certificate Error</title></head>\r\n<body bgcolor=\"white\">\r\n<center><h1>526 Origin SSL Certificate Error</h1></center>\r\n<hr><center>cloudflare-nginx</center>\r\n</body>\r\n</html>\r\n"
Insight response error: StatusCodeError: 526 - "<html>\r\n<head><title>526 Origin SSL Certificate Error</title></head>\r\n<body bgcolor=\"white\">\r\n<center><h1>526 Origin SSL Certificate Error</h1></center>\r\n<hr><center>cloudflare-nginx</center>\r\n</body>\r\n</html>\r\n"
Insight response error: StatusCodeError: 526 - "<html>\r\n<head><title>526 Origin SSL Certificate Error</title></head>\r\n<body bgcolor=\"white\">\r\n<center><h1>526 Origin SSL Certificate Error</h1></center>\r\n<hr><center>cloudflare-nginx</center>\r\n</body>\r\n</html>\r\n"
Insight response error: StatusCodeError: 525 - "<html>\r\n<head><title>525 Origin SSL Handshake Error</title></head>\r\n<body bgcolor=\"white\">\r\n<center><h1>525 Origin SSL Handshake Error</h1></center>\r\n<hr><center>cloudflare-nginx</center>\r\n</body>\r\n</html>\r\n"
Insight response error: StatusCodeError: 404 - "<html>\r\n<head><title>404 Not Found</title></head>\r\n<body bgcolor=\"white\">\r\n<center><h1>404 Not Found</h1></center>\r\n<hr><center>nginx/1.14.0 (Ubuntu)</center>\r\n</body>\r\n</html>\r\n"
Insight response error: StatusCodeError: 404 - "<html>\r\n<head><title>404 Not Found</title></head>\r\n<body bgcolor=\"white\">\r\n<center><h1>404 Not Found</h1></center>\r\n<hr><center>nginx/1.14.0 (Ubuntu)</center>\r\n</body>\r\n</html>\r\n"
Insight response error: StatusCodeError: 404 - "<html>\r\n<head><title>404 Not Found</title></head>\r\n<body bgcolor=\"white\">\r\n<center><h1>404 Not Found</h1></center>\r\n<hr><center>nginx/1.14.0 (Ubuntu)</center>\r\n</body>\r\n</html>\r\n"
Insight response error: StatusCodeError: 525 - "<html>\r\n<head><title>525 Origin SSL Handshake Error</title></head>\r\n<body bgcolor=\"white\">\r\n<center><h1>525 Origin SSL Handshake Error</h1></center>\r\n<hr><center>cloudflare-nginx</center>\r\n</body>\r\n</html>\r\n"
bitcoin block height 581162 not found

If with the same file I try a validation on https://opentimestamps.org all works well, and the response is about the same block that not found on my machine. This is the response of https://opentimestamps.org:

Bitcoin block 581162 attests existence as of 2019-06-17 CEST

My ots-cli.js is 0.4.3 version, and I sure that my code was worked time ago. Do you have some advice to fix it? Thanks to all.

@RCasatta
Copy link
Member

RCasatta commented Feb 3, 2021

OpenTimestamps proof verification needs to check the bitcoin block merkle root at the attested height matches the one committed in the proof.
The best way of doing so is to check against a local running bitcoin node that properly verified the blockchain. However, this is not possible in the browser, so the javascript library implements a "light-client" verification: if it doesn't find or can't connect to a local bitcoin node it asks an online block-explorer (trading security for ease-of-use).

Version 0.4.3 used insight as block explorer that apparently is no longer running. So your options are:

  • use a local bitcoin node
  • upgrade the client version, recent versions use Blockstream block explorer

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

2 participants