1

Link to the code I am executing

I am trying to execute this Decentralized File Sharing App and the code runs smoothly but when I click on the "Connect to Block Chain" option I am encountering an Internal Server Error.

In the command Line, it shows

requests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=5111): Max retries exceeded with url: /get_c hain (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000002734F5FDFF0>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it'))

What could be the reason behind it?

  • It seems unlikely you will get many answers this your link point to a github repos with many scripts. Can you post (as text, not an image as mentionned in [how-to-ask](https://stackoverflow.com/help/how-to-ask)) the code attempting the connection to the server ? Can you `ping` the targeted server ? – cbo Oct 07 '22 at 14:39
  • Server.py(main_server) `@app.route('/connect_blockchain') def connect_blockchain(): is_chain_replaced = blockchain.replace_chain() return render_template('connect_blockchain.html', chain=blockchain.chain, nodes=len(blockchain.nodes))` constants.py(client_server_1) `app.config['SERVER_IP'] = '127.0.0.1:5111' app.config['NODE_ADDR'] = {'Host' : '127.0.0.1', 'Port' : 5112}` Can you try to run this code on your local machine – user14799684 Oct 07 '22 at 14:58
  • Please edit your question with those elements so that anyone can easily read it and jump in to help :) – cbo Oct 07 '22 at 14:59
  • It Is it correct that you are testing the code on your machine : `host=127.0.0.1` ? Also the problem seems to be more like "can you have 2 processes that do a similar task (render_template)" --> is it possible that the second process failes because render_template locks some files ? – cbo Oct 07 '22 at 15:04
  • I think I saw this repo in other question today. And problably question was deleted. – furas Oct 07 '22 at 18:21
  • always put code, data and full error message as text (not screenshot, not link) in question (not in comment). It will be more readable and easier to use in answer (simpler to select and copy), and more people will see it - so more people can help you. – furas Oct 07 '22 at 18:22

0 Answers0