veighna-global/vnpy_binance

vnpy3.3,连接binance,显示rest api启动成功,但无法连接 ,出现以下错误

haisu888 opened this issue · 2 comments

RestClient on error----------
[2022-10-08T19:43:36.835613]: Unhandled RestClient Error:<class 'aiohttp.client_exceptions.ClientConnectorError'>
request:request : GET /fapi/v1/account?timestamp=1665229395667&signature=15fd86122833e9f870bdd907f452deffb071eb88a19b6d12d82cd1f70a276e84 because terminated:
headers: {'Content-Type': 'application/x-www-form-urlencoded', 'Accept': 'application/json', 'X-MBX-APIKEY': 'IrzglKFMoV0Xm64nmffMPrVNPBYi8aQ30c7zjFcEZCNEjEfsYm7BZ69AkL9a1bYe', 'Connection': 'close'}
params: {}
data: {}
response:

Exception trace:
Traceback (most recent call last):
File "C:\veighna_studio\lib\site-packages\aiohttp\connector.py", line 969, in _wrap_create_connection
return await self._loop.create_connection(*args, **kwargs) # type: ignore # noqa
File "C:\veighna_studio\lib\asyncio\base_events.py", line 1055, in create_connection
raise exceptions[0]
File "C:\veighna_studio\lib\asyncio\base_events.py", line 1040, in create_connection
sock = await self._connect_sock(
File "C:\veighna_studio\lib\asyncio\base_events.py", line 954, in _connect_sock
await self.sock_connect(sock, address)
File "C:\veighna_studio\lib\asyncio\proactor_events.py", line 704, in sock_connect
return await self._proactor.connect(sock, address)
File "C:\veighna_studio\lib\asyncio\windows_events.py", line 817, in _poll
value = callback(transferred, key, ov)
File "C:\veighna_studio\lib\asyncio\windows_events.py", line 604, in finish_connect
ov.getresult()
OSError: [WinError 121] 信号灯超时时间已到

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "C:\veighna_studio\lib\site-packages\vnpy_rest\rest_client.py", line 256, in _process_request
response: Response = await self._get_response(request)
File "C:\veighna_studio\lib\site-packages\vnpy_rest\rest_client.py", line 238, in _get_response
cr: ClientResponse = await self.session.request(
File "C:\veighna_studio\lib\site-packages\aiohttp\client.py", line 520, in _request
conn = await self._connector.connect(
File "C:\veighna_studio\lib\site-packages\aiohttp\connector.py", line 535, in connect
proto = await self._create_connection(req, traces, timeout)
File "C:\veighna_studio\lib\site-packages\aiohttp\connector.py", line 892, in _create_connection
_, proto = await self._create_direct_connection(req, traces, timeout)
File "C:\veighna_studio\lib\site-packages\aiohttp\connector.py", line 1051, in _create_direct_connection
raise last_exc
File "C:\veighna_studio\lib\site-packages\aiohttp\connector.py", line 1020, in _create_direct_connection
transp, proto = await self._wrap_create_connection(
File "C:\veighna_studio\lib\site-packages\aiohttp\connector.py", line 975, in _wrap_create_connection
raise client_error(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host fapi.binance.com:443 ssl:default [信号灯超时时间 已到]

我也有这个问题,"msg":"Signature for this request is not valid." 签名请求无效

这个是国内的网连不上,你得租海外服务器,可以先注册一个testnet的账号