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

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

Open
SWS-5007 opened this issue Jan 17, 2023 · 4 comments
Open

Comments

@SWS-5007
Copy link

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
Copy link
Member

arjanz commented Jan 17, 2023

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
Copy link
Author

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
Copy link
Member

arjanz commented Jan 17, 2023

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
Copy link
Author

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?

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