polkascan / harvester

Polkascan Harvester
GNU General Public License v3.0
18 stars 11 forks source link

This Handshake status 200 OK msg means Harvester runs successfully ? #9

Open SWS-5007 opened 1 year ago

SWS-5007 commented 1 year ago

Hi, When I run python app/harvester.py --force-start command at the end of https://github.com/polkascan/harvester readme steps, I am getting logs below on my cmd.

E:\Source\harvester>python app/harvester.py --force-start Traceback (most recent call last): File "E:\Source\harvester\app\harvester.py", line 458, in cli.harvester = Harvester( File "E:\Source\harvester\app\harvester.py", line 75, in init self.substrate = SubstrateInterface( File "C:\Users\Home\AppData\Local\Programs\Python\Python310\lib\site-packages\substrateinterface\base.py", line 627, in init self.connect_websocket() File "C:\Users\Home\AppData\Local\Programs\Python\Python310\lib\site-packages\substrateinterface\base.py", line 663, in connect_websocket self.websocket = create_connection( File "C:\Users\Home\AppData\Local\Programs\Python\Python310\lib\site-packages\websocket_core.py", line 608, in create_connection websock.connect(url, *options) File "C:\Users\Home\AppData\Local\Programs\Python\Python310\lib\site-packages\websocket_core.py", line 253, in connect self.handshake_response = handshake(self.sock, url, addrs, options) File "C:\Users\Home\AppData\Local\Programs\Python\Python310\lib\site-packages\websocket_handshake.py", line 57, in handshake status, resp = _get_resp_headers(sock) File "C:\Users\Home\AppData\Local\Programs\Python\Python310\lib\site-packages\websocket_handshake.py", line 147, in _get_resp_headers raise WebSocketBadStatusException("Handshake status %d %s", status, status_message, resp_headers) websocket._exceptions.WebSocketBadStatusException: Handshake status 200 OK**

So this log means Harvester runs successfully on my local? Please let me know.

arjanz commented 1 year ago

It seems like your Substrate websocket endpoint is incorrect (not the expected 101 handshake). Be sure to use a websocket endpoint and using format like ws://127.0.0.1:9944 or wss://<node_host>.

SWS-5007 commented 1 year ago

You mean, this SUBSTRATE_RPC_URL env? I used this websocket endpoint like below on local_settings.py file. SUBSTRATE_RPC_URL = "wss://sheartoken.com/" What is wrong here?

arjanz commented 1 year ago

You mean, this SUBSTRATE_RPC_URL env? I used this websocket endpoint like below on local_settings.py file. SUBSTRATE_RPC_URL = "wss://sheartoken.com/" What is wrong here?

wss://sheartoken.com doesn't seem to be a valid Substrate RPC endpoint, so that is wrong.. Verified on PolkadotJS: https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fsheartoken.com#/explorer , it's not connecting.

It just seems to be a nginx welcome page served at https://sheartoken.com/, so don't know what you expect here ;)

SWS-5007 commented 1 year ago

I just changed as you said and now I am getting this logs below.

E:\Source\harvester>python app/harvester.py --force-start 2023-01-18 00:48:40 🟢 Job "storage_tasks" started 2023-01-18 00:48:40 🟢 Job "cron" started 2023-01-18 00:48:40 🟢 Job "retrieve_blocks" started 2023-01-18 00:48:45 🔗 Retrieving block #0 from node 2023-01-18 00:48:47 🔗 Retrieving block #1 from node 2023-01-18 00:48:49 🔗 Retrieving block #2 from node 2023-01-18 00:48:52 🔗 Retrieving block #3 from node 2023-01-18 00:48:54 🔗 Retrieving block #4 from node 2023-01-18 00:48:56 🔗 Retrieving block #5 from node ... ...

I think Harvester works well on my local. Right?