Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/361.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python/P2P-无法连接到集合服务器_Python_Port_Nodes_P2p_Blockchain - Fatal编程技术网

Python/P2P-无法连接到集合服务器

Python/P2P-无法连接到集合服务器,python,port,nodes,p2p,blockchain,Python,Port,Nodes,P2p,Blockchain,我正在尝试使用python(pyp2p)创建一个P2P节点,但出现以下错误: Eamons-MacBook-Pro:blockchain eamonwhite$ python3 serveralice.py HTTP Error 404: Not Found HTTP Error 404: Not Found HTTP Error 404: Not Found HTTP Error 404: Not Found Traceback (most recent call last): File

我正在尝试使用python(
pyp2p
)创建一个
P2P
节点,但出现以下错误:

Eamons-MacBook-Pro:blockchain eamonwhite$ python3 serveralice.py
HTTP Error 404: Not Found
HTTP Error 404: Not Found
HTTP Error 404: Not Found
HTTP Error 404: Not Found
Traceback (most recent call last):
  File "/Users/eamonwhite/.pyenv/versions/3.6.3/lib/python3.6/site-packages/pyp2p/net.py", line 732, in start
    rendezvous_con = self.rendezvous.server_connect()
  File "/Users/eamonwhite/.pyenv/versions/3.6.3/lib/python3.6/site-packages/pyp2p/rendezvous_client.py", line 92, in server_connect
    con.connect(server["addr"], server["port"])
  File "/Users/eamonwhite/.pyenv/versions/3.6.3/lib/python3.6/site-packages/pyp2p/sock.py", line 189, in connect
    self.s.bind((src_ip, 0))
TypeError: str, bytes or bytearray expected, not NoneType

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "serveralice.py", line 10, in <module>
    alice.start()
  File "/Users/eamonwhite/.pyenv/versions/3.6.3/lib/python3.6/site-packages/pyp2p/net.py", line 735, in start
    raise Exception("Unable to connect to rendezvous server.")
Exception: Unable to connect to rendezvous server.

它一开始就卡在了
网络
功能上,这与
集合
包有关。IP是我网络上的IP,我的端口转发了44444,尽管我不确定是否需要这样做。谢谢。

我对这一点还不熟悉,显然,按照服务器代码的配置方式,它需要一个会合服务器来工作(一个处理所有其他节点的节点)。它位于
pyp2p
包的
net.py
中:

# Bootstrapping + TCP hole punching server.
rendezvous_servers = [
    {
        "addr": "162.243.213.95",
        "port": 8000
    }
]
地址就是问题所在,显然它只是一个占位符IP。然后我意识到我需要自己的会合服务器,我使用了这个代码-


然而,我不得不稍微调试一下这个文件,它最终需要在顶部有
import sys
import time
import re
语句才能工作。现在,我将把它放在我的raspberry pi上,这样它就可以始终处理节点:)

我对这一点不太熟悉,显然,按照服务器代码的配置方式,它需要一个集合服务器来工作(一个处理所有其他节点的节点)。它位于
pyp2p
包的
net.py
中:

# Bootstrapping + TCP hole punching server.
rendezvous_servers = [
    {
        "addr": "162.243.213.95",
        "port": 8000
    }
]
地址就是问题所在,显然它只是一个占位符IP。然后我意识到我需要自己的会合服务器,我使用了这个代码-

然而,我不得不稍微调试一下这个文件,它最终需要在顶部有
import sys
import time
import re
语句才能工作。现在,我将把它放在我的raspberry pi上,以便它始终能够处理节点:)