Is data layer supposed to work with the simulator?

I have the simulator set up and working with nfts and stuff, but I can’t seem to get any data layer commands to work. I’ve tried starting data layer, closing my chia node, and a bunch of other things, but I still get this error.

Exception from 'data': {'error': "ConnectionKey(host='localhost', port=9256, is_ssl=True, ssl=<ssl.SSLContext object at 0x000001C171C20AC0>, proxy=None, proxy_auth=None, proxy_headers_hash=None)", 'success': False}

I haven’t seen any reference to it in any of the documentation, so I don’t know if I’m wasting my time trying to get it to work.

Can you also check your logs and copy/paste any errors/exceptions?

2022-10-08T13:48:09.772 full_node full_node_server        : INFO     Connection closed: 127.0.0.1, node id: a68a3ebd3f869d05214e387bbeefde6a4ff40311ae51088ed99833b0338ec6a9
2022-10-08T13:48:09.773 full_node chia.full_node.full_node: INFO     peer disconnected {'host': '127.0.0.1', 'port': 12535}
2022-10-08T13:48:09.772 wallet wallet_server              : INFO     Connection closed: 127.0.0.1, node id: 336af14120855ad341ad8e40f3866c97dd47b4ef5ad3f23239281846a8008691
2022-10-08T13:48:11.958 wallet wallet                     : INFO     Reconnecting to peer {'host': '127.0.0.1', 'port': 54358}
2022-10-08T13:48:11.966 wallet wallet_server              : INFO     Connected with full_node {'host': '127.0.0.1', 'port': 54358}
2022-10-08T13:48:30.425 daemon chia.daemon.server         : INFO     ConnectionClosed. Closing websocket with Unknown
2022-10-08T13:48:32.075 daemon chia.daemon.server         : INFO     ConnectionClosed. Closing websocket with Unknown
2022-10-08T13:48:34.183 full_node full_node               : INFO     chia-blockchain version: 1.6.0
2022-10-08T13:48:34.184 full_node full_node_server        : INFO     Service capabilities: [(1, '1'), (2, '1'), (3, '1')]
2022-10-08T13:48:35.255 full_node full_node               : ERROR    full_node: already running
2022-10-08T13:49:28.024 data_layer chia.rpc.util          : WARNING  Error while handling message: Traceback (most recent call last):
  File "C:\Users\gaerax\anaconda3\envs\sprig\lib\site-packages\aiohttp\connector.py", line 986, in _wrap_create_connection
    return await self._loop.create_connection(*args, **kwargs)  # type: ignore[return-value]  # noqa
  File "C:\Users\gaerax\anaconda3\envs\sprig\lib\asyncio\base_events.py", line 1081, in create_connection
    transport, protocol = await self._create_connection_transport(
  File "C:\Users\gaerax\anaconda3\envs\sprig\lib\asyncio\base_events.py", line 1111, in _create_connection_transport
    await waiter
  File "C:\Users\gaerax\anaconda3\envs\sprig\lib\asyncio\sslproto.py", line 528, in data_received
    ssldata, appdata = self._sslpipe.feed_ssldata(data)
  File "C:\Users\gaerax\anaconda3\envs\sprig\lib\asyncio\sslproto.py", line 188, in feed_ssldata
    self._sslobj.do_handshake()
  File "C:\Users\gaerax\anaconda3\envs\sprig\lib\ssl.py", line 944, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate signature failure (_ssl.c:1129)

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

Traceback (most recent call last):
  File "C:\Users\gaerax\anaconda3\envs\sprig\lib\site-packages\chia\rpc\util.py", line 16, in inner
    res_object = await f(request_data)
  File "C:\Users\gaerax\anaconda3\envs\sprig\lib\site-packages\chia\rpc\data_layer_rpc_api.py", line 106, in create_data_store
    txs, value = await self.service.create_store(uint64(fee))
  File "C:\Users\gaerax\anaconda3\envs\sprig\lib\site-packages\chia\data_layer\data_layer.py", line 119, in create_store
    txs, tree_id = await self.wallet_rpc.create_new_dl(root, fee)
  File "C:\Users\gaerax\anaconda3\envs\sprig\lib\site-packages\chia\rpc\wallet_rpc_client.py", line 718, in create_new_dl
    response = await self.fetch("create_new_dl", request)
  File "C:\Users\gaerax\anaconda3\envs\sprig\lib\site-packages\chia\rpc\rpc_client.py", line 45, in fetch
    async with self.session.post(self.url + path, json=request_json, ssl_context=self.ssl_context) as response:
  File "C:\Users\gaerax\anaconda3\envs\sprig\lib\site-packages\aiohttp\client.py", line 1138, in __aenter__
    self._resp = await self._coro
  File "C:\Users\gaerax\anaconda3\envs\sprig\lib\site-packages\aiohttp\client.py", line 535, in _request
    conn = await self._connector.connect(
  File "C:\Users\gaerax\anaconda3\envs\sprig\lib\site-packages\aiohttp\connector.py", line 542, in connect
    proto = await self._create_connection(req, traces, timeout)
  File "C:\Users\gaerax\anaconda3\envs\sprig\lib\site-packages\aiohttp\connector.py", line 907, in _create_connection
    _, proto = await self._create_direct_connection(req, traces, timeout)
  File "C:\Users\gaerax\anaconda3\envs\sprig\lib\site-packages\aiohttp\connector.py", line 1206, in _create_direct_connection
    raise last_exc
  File "C:\Users\gaerax\anaconda3\envs\sprig\lib\site-packages\aiohttp\connector.py", line 1175, in _create_direct_connection
    transp, proto = await self._wrap_create_connection(
  File "C:\Users\gaerax\anaconda3\envs\sprig\lib\site-packages\aiohttp\connector.py", line 988, in _wrap_create_connection
    raise ClientConnectorCertificateError(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorCertificateError: Cannot connect to host localhost:9256 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate signature failure (_ssl.c:1129)')]

2022-10-08T13:50:02.938 daemon chia.daemon.server         : INFO     ConnectionClosed. Closing websocket with Unknown
2022-10-08T13:50:11.853 daemon chia.daemon.server         : INFO     Service chia_wallet already registered
2022-10-08T13:50:11.856 daemon chia.daemon.server         : INFO     sending CTRL_BREAK_EVENT signal to chia_data_layer
2022-10-08T13:50:11.857 data_layer data_layer             : INFO     got signal 21
2022-10-08T13:50:11.858 data_layer data_layer             : INFO     Cancelling reconnect task
2022-10-08T13:50:11.859 data_layer data_layer             : INFO     Closing connections
2022-10-08T13:50:11.860 data_layer data_layer             : INFO     Calling service stop callback
2022-10-08T13:50:11.860 data_layer data_layer             : INFO     Closing RPC server
2022-10-08T13:50:11.861 data_layer data_layer             : INFO     Waiting for socket to be closed (if opened)
2022-10-08T13:50:11.861 data_layer data_layer             : INFO     Waiting for ChiaServer to be closed
2022-10-08T13:50:11.863 data_layer data_layer             : INFO     Waiting for RPC server
2022-10-08T13:50:11.864 daemon chia.daemon.server         : INFO     ConnectionClosed. Closing websocket with chia_data_layer
2022-10-08T13:50:13.870 data_layer data_layer             : INFO     Closed RPC server
2022-10-08T13:50:13.871 data_layer data_layer             : INFO     Waiting for service _await_closed callback
2022-10-08T13:50:13.873 data_layer data_layer             : INFO     Service data_layer at port 8561 fully closed
2022-10-08T13:50:14.036 data_layer asyncio                : ERROR    Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x000001C171BE6B50>
2022-10-08T13:50:14.375 daemon chia.daemon.server         : INFO     process chia_data_layer returned 120
2022-10-08T13:50:14.414 daemon chia.daemon.server         : INFO     ConnectionClosed. Closing websocket with Unknown
2022-10-08T13:50:15.488 data_layer data_layer             : INFO     chia-blockchain version: 1.6.0
2022-10-08T13:50:15.489 data_layer data_layer_server      : INFO     Service capabilities: [(1, '1'), (2, '1'), (3, '1')]
2022-10-08T13:50:15.524 data_layer data_layer_server      : INFO     Started listening on port: 8561
2022-10-08T13:50:15.525 data_layer data_layer             : INFO     Started data_layer service on network_id: testnet10
2022-10-08T13:50:15.536 daemon chia.daemon.server         : INFO     Register service {'service': 'chia_data_layer'}
2022-10-08T13:50:15.537 daemon chia.daemon.server         : INFO     registered for service chia_data_layer
2022-10-08T13:50:15.538 daemon chia.daemon.server         : INFO     {'success': True}
2022-10-08T13:50:23.935 data_layer chia.rpc.util          : WARNING  Error while handling message: Traceback (most recent call last):
  File "C:\Users\gaerax\anaconda3\envs\sprig\lib\site-packages\aiohttp\connector.py", line 986, in _wrap_create_connection
    return await self._loop.create_connection(*args, **kwargs)  # type: ignore[return-value]  # noqa
  File "C:\Users\gaerax\anaconda3\envs\sprig\lib\asyncio\base_events.py", line 1081, in create_connection
    transport, protocol = await self._create_connection_transport(
  File "C:\Users\gaerax\anaconda3\envs\sprig\lib\asyncio\base_events.py", line 1111, in _create_connection_transport
    await waiter
  File "C:\Users\gaerax\anaconda3\envs\sprig\lib\asyncio\sslproto.py", line 528, in data_received
    ssldata, appdata = self._sslpipe.feed_ssldata(data)
  File "C:\Users\gaerax\anaconda3\envs\sprig\lib\asyncio\sslproto.py", line 188, in feed_ssldata
    self._sslobj.do_handshake()
  File "C:\Users\gaerax\anaconda3\envs\sprig\lib\ssl.py", line 944, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate signature failure (_ssl.c:1129)

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

Traceback (most recent call last):
  File "C:\Users\gaerax\anaconda3\envs\sprig\lib\site-packages\chia\rpc\util.py", line 16, in inner
    res_object = await f(request_data)
  File "C:\Users\gaerax\anaconda3\envs\sprig\lib\site-packages\chia\rpc\data_layer_rpc_api.py", line 106, in create_data_store
    txs, value = await self.service.create_store(uint64(fee))
  File "C:\Users\gaerax\anaconda3\envs\sprig\lib\site-packages\chia\data_layer\data_layer.py", line 119, in create_store
    txs, tree_id = await self.wallet_rpc.create_new_dl(root, fee)
  File "C:\Users\gaerax\anaconda3\envs\sprig\lib\site-packages\chia\rpc\wallet_rpc_client.py", line 718, in create_new_dl
    response = await self.fetch("create_new_dl", request)
  File "C:\Users\gaerax\anaconda3\envs\sprig\lib\site-packages\chia\rpc\rpc_client.py", line 45, in fetch
    async with self.session.post(self.url + path, json=request_json, ssl_context=self.ssl_context) as response:
  File "C:\Users\gaerax\anaconda3\envs\sprig\lib\site-packages\aiohttp\client.py", line 1138, in __aenter__
    self._resp = await self._coro
  File "C:\Users\gaerax\anaconda3\envs\sprig\lib\site-packages\aiohttp\client.py", line 535, in _request
    conn = await self._connector.connect(
  File "C:\Users\gaerax\anaconda3\envs\sprig\lib\site-packages\aiohttp\connector.py", line 542, in connect
    proto = await self._create_connection(req, traces, timeout)
  File "C:\Users\gaerax\anaconda3\envs\sprig\lib\site-packages\aiohttp\connector.py", line 907, in _create_connection
    _, proto = await self._create_direct_connection(req, traces, timeout)
  File "C:\Users\gaerax\anaconda3\envs\sprig\lib\site-packages\aiohttp\connector.py", line 1206, in _create_direct_connection
    raise last_exc
  File "C:\Users\gaerax\anaconda3\envs\sprig\lib\site-packages\aiohttp\connector.py", line 1175, in _create_direct_connection
    transp, proto = await self._wrap_create_connection(
  File "C:\Users\gaerax\anaconda3\envs\sprig\lib\site-packages\aiohttp\connector.py", line 988, in _wrap_create_connection
    raise ClientConnectorCertificateError(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorCertificateError: Cannot connect to host localhost:9256 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate signature failure (_ssl.c:1129)')]


some more info, idk if relevant.

This is running on my main machine, which has a full node running, and I have had datalayer working on mainnet. I have tried turning off that datalayer, as well as closing all chia processes, but it still gives the same error.

I have tried removing the certificates for datalayer, it recreates them, but still doesn’t work.

Tried deleting the whole simulator folder and re followed the simulator user guide, but still getting the same error.

I don’t see it mentioned in the documentation, so there might still be some issues.

The DataLayer requires a chia wallet, but the (simulator) wallet is not run in the standard port, 9256. So you have to find the wallet port and update it in your config.yaml.

Thanks for the help, I should have thought of that. Unfortunately, that hasn’t helped. I updated the config with the correct wallet port (19284), but it is still giving me the same error. (but now with the new port.)

I just try again with a fresh simulator, and this seems to work for me. I also need to restart the data layer after updating the config file.