janoside / btc-rpc-explorer

Database-free, self-hosted Bitcoin explorer, via RPC to Bitcoin Core.
https://bitcoinexplorer.org
MIT License
1.56k stars 1.17k forks source link

ElectrumX unknown method (Version issue?) #119

Closed badabingbadaboom2 closed 5 years ago

badabingbadaboom2 commented 5 years ago

Hi. I've connected my ElectrumX (following master branch) and there seems to be a versioning problem where btc-rpc-explorer is trying to call unsupported rpc methods.

Can you please either update the ElectrumX usage, or specify in the docs which version of ElectrumX to use and how to get it? It would be greatly appreciated, and being able to use an updated version of ElectrumX is great so that ElectrumX can be used with other apps as well.

Connecting via RPC to node at localhost:8332 Connecting to ElectrumX Server: localhost:8000 Request Error: [object Object] (error json: {"code":-32601,"message":"unknown method \"server.version\""}), method=server.version, params=btc-rpc-explorer-v1.1,1.2 Connected to ElectrumX Server: localhost:8000, versions: {"success":false,"error":{"code":-32601,"message":"unknown method \"server.version\""}} Live with ElectrumX API. Connected via RPC to node. Basic info: version=170100, subversion=/Satoshi:0.17.1/, protocolversion=70015, services=000000000000040d GET / 200 880.728 ms - 27009 GET /css/fonts.css 304 3.737 ms - - GET /css/highlight.min.css 304 2.625 ms - - GET /css/bootstrap.min.css 304 2.198 ms - - GET /css/styling.css 304 2.600 ms - - GET /js/chart.bundle.min.js 304 1.538 ms - - GET /js/jquery.min.js 304 1.254 ms - - GET /js/popper.min.js 304 1.114 ms - - GET /js/bootstrap.min.js 304 1.418 ms - - GET /js/fontawesome.min.js 304 0.472 ms - - GET /js/highlight.min.js 304 0.502 ms - - GET /img/logo/btc.svg 200 2.920 ms - 956 GET /img/logo/lnd-admin.png 200 3.989 ms - 7751 GET /img/logo/btc.png - - ms - - GET /block-height/572474 200 2414.525 ms - 325949 GET /css/fonts.css 304 1.827 ms - - GET /css/highlight.min.css 304 2.102 ms - - GET /css/bootstrap.min.css 304 1.877 ms - - GET /css/styling.css 304 0.900 ms - - GET /img/logo/btc.svg 304 1.311 ms - - GET /img/logo/lnd-admin.png 200 1.959 ms - 7751 GET /js/jquery.min.js 304 2.227 ms - - GET /js/popper.min.js 304 3.308 ms - - GET /font/Source_Code_Pro/SourceCodePro-Bold.woff2 200 10.978 ms - 10392 GET /js/bootstrap.min.js 304 2.751 ms - - GET /js/fontawesome.min.js 304 2.435 ms - - GET /js/highlight.min.js 304 0.783 ms - - GET /img/logo/btc.png - - ms - - Request Error: [object Object] (error json: {"code":-32601,"message":"unknown method \"blockchain.scripthash.get_balance\""}), method=blockchain.scripthash.get_balance, params=3b39455ac753499def7d7add6c95755eee37625bd02abdc3b6e7a296086c426d Request Error: [object Object] (error json: {"code":-32601,"message":"unknown method \"blockchain.scripthash.get_history\""}), method=blockchain.scripthash.get_history, params=3b39455ac753499def7d7add6c95755eee37625bd02abdc3b6e7a296086c426d Error 23t07ug2wghefud: [object Object], error json: {"error":{"code":-32601,"message":"unknown method \"blockchain.scripthash.get_history\""},"server":"localhost"} Error 32197rgh327g2: [object Object], error json: {"error":{"code":-32601,"message":"unknown method \"blockchain.scripthash.get_balance\""},"server":"localhost"} GET /address/1ACAgPuFFidYzPMXbiKptSrwT74Dg8hq2v 200 454.199 ms - 13231 GET /css/fonts.css 304 1.654 ms - - GET /css/highlight.min.css 304 2.157 ms - - GET /css/bootstrap.min.css 304 1.475 ms - - GET /css/styling.css 304 1.429 ms - - GET /js/jquery.min.js 304 1.293 ms - - GET /js/popper.min.js 304 0.863 ms - - GET /js/bootstrap.min.js 304 0.750 ms - - GET /js/fontawesome.min.js 304 0.938 ms - - GET /js/highlight.min.js 304 0.535 ms - - GET /img/logo/btc.svg 304 9.197 ms - - GET /img/logo/lnd-admin.png 304 1.295 ms - -

Edit Tested with version ElectrumX 1.9.2 which supports versions 1.2-1.4.1, and the problem persists. Running RPC Explorer for Bitcoin Connecting via RPC to node at localhost:8332 Connecting to ElectrumX Server: localhost:8000 Request Error: [object Object] (error json: {"code":-32601,"message":"unknown method \"server.version\""}), method=server.version, params=btc-rpc-explorer-v1.1,1.2 Connected to ElectrumX Server: localhost:8000, versions: {"success":false,"error":{"code":-32601,"message":"unknown method \"server.version\""}} Live with ElectrumX API. Connected via RPC to node. Basic info: version=170100, subversion=/Satoshi:0.17.1/, protocolversion=70015, services=000000000000040d Request Error: [object Object] (error json: {"code":-32601,"message":"unknown method \"blockchain.scripthash.get_balance\""}), method=blockchain.scripthash.get_balance, params=3b39455ac753499def7d7add6c95755eee37625bd02abdc3b6e7a296086c426d Request Error: [object Object] (error json: {"code":-32601,"message":"unknown method \"blockchain.scripthash.get_history\""}), method=blockchain.scripthash.get_history, params=3b39455ac753499def7d7add6c95755eee37625bd02abdc3b6e7a296086c426d Error 23t07ug2wghefud: [object Object], error json: {"error":{"code":-32601,"message":"unknown method \"blockchain.scripthash.get_history\""},"server":"localhost"} Error 32197rgh327g2: [object Object], error json: {"error":{"code":-32601,"message":"unknown method \"blockchain.scripthash.get_balance\""},"server":"localhost"} GET /address/1ACAgPuFFidYzPMXbiKptSrwT74Dg8hq2v 200 846.958 ms - 13231 GET /css/fonts.css 304 4.144 ms - - GET /css/highlight.min.css 304 1.742 ms - - GET /css/bootstrap.min.css 304 3.232 ms - - GET /js/popper.min.js 304 3.799 ms - - GET /css/styling.css 304 3.096 ms - - GET /js/jquery.min.js 304 2.825 ms - - GET /js/fontawesome.min.js 304 2.579 ms - - GET /js/bootstrap.min.js 304 2.342 ms - - GET /js/highlight.min.js 304 0.747 ms - - GET /img/logo/btc.svg 200 9.355 ms - 956 GET /img/logo/lnd-admin.png 200 23.771 ms - 7751 GET /img/logo/btc.png - - ms - -

janoside commented 5 years ago

@badabingbadaboom2 When you get a chance, please update to latest code (after 3e8b092) and let me know if your issue is fixed. Old code was requesting version 1.2 of the electrum API which is deprecated. New code requests v1.4.

janoside commented 5 years ago

Feel free to comment here if the issue is still active, but closing for now due to inactivity.