Wowlet can't fetch price history and similar

Started by terrydavis, Feb 06, 2024, 08:52 PM

Previous topic - Next topic

terrydavis

My Wowlet is capable of syncing with both remote and local nodes, but can't seem to fetch the other "metadata". As a consequence I can't see the fiat prices, price history nor any of the forum or Reddit posts in the wallet. How do I fix this?

WOWlet version: beta-8-72a9f8376
Wownero version: unknown-unknown
Wallet height: 602343
Daemon height: 602343
Target height: 602343
Restore height: 569378
Synchronized: True
Remote node: node.suchwow.xyz:34568
Wallet status: Connected
Tor status: Local (assumed to be running)
Websocket URL: redacted
Websocket status: Connecting (oscillates between this and Unconnected)
Network type: MAINNET
Seed type: 25 word
View only: False
Primary only: True
Operating system: Artix Linux
Timestamp: 1707248954

Related error in terminal:
[2024-02-06 20:50:34 C] (:0) WebSocket error:  QAbstractSocket::ConnectionRefusedError
[2024-02-06 20:50:38 C] (:0) WebSocket error:  QAbstractSocket::ConnectionRefusedError
[2024-02-06 20:50:42 C] (:0) WebSocket error:  QAbstractSocket::ConnectionRefusedError

hex_is

It works for sending and receiving but think the server is down for the info or something along those lines.

terrydavis

That could very well be it, looks like that server URL was already changed in https://git.wownero.com/wowlet/wowlet/commit/9c58913ee2377ebaf1e2a3b7e946b57e29d37935. Fortunately this server seems to be open source at https://git.wownero.com/wowlet/wowlet-backend/, perhaps it's possible for someone from the community to host?

terrydavis

I looked into getting the server working, and suffice to say it was tough. Right now I am unable to get the production "edition" to run in Docker, but I was able to use the redis and tor setups provided in the docker-compose.yml to start the development "edition" in a Python virtualenv on my native Artix. Here's the patch:

diff --git a/Dockerfile b/Dockerfile
index 8e26cc1..2d6843e 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,4 +1,4 @@
-FROM python:3.7
+FROM python:3.8
 
 WORKDIR /app
 COPY requirements.txt .
@@ -7,4 +7,4 @@ RUN pip install -r requirements.txt
 COPY . .
 
 EXPOSE 1337
-CMD ["hypercorn", "--access-logfile", "-", "--workers", "1", "--bind", "0.0.0.0:1337", "asgi:app"]
\ No newline at end of file
+CMD ["hypercorn", "--access-logfile", "-", "--workers", "1", "--bind", "0.0.0.0:1337", "asgi:app"]
diff --git a/asgi.py b/asgi.py
index 4d49d01..b770c8c 100644
--- a/asgi.py
+++ b/asgi.py
@@ -2,5 +2,5 @@
 # Copyright (c) 2020, The Monero Project.
 # Copyright (c) 2020, dsc@xmr.pm
 
-from wowlet_backend_backend.factory import create_app
+from wowlet_backend.factory import create_app
 app = create_app()
diff --git a/docker-compose.yml b/docker-compose.yml
index 57ecb1c..05b52ff 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -5,6 +5,8 @@ services:
     container_name: redis
     image: "redis:alpine"
     command: redis-server
+    ports:
+      - "6379:6379"
     environment:
       - REDIS_REPLICATION_MODE=master
   tor-node:
diff --git a/requirements.txt b/requirements.txt
index fb038a9..b5bc14a 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,5 +1,5 @@
 quart
-aioredis>=2.0.0
+redis>=4.2.0rc1
 aiohttp
 aiofiles
 quart_session
diff --git a/wowlet_backend/factory.py b/wowlet_backend/factory.py
index db64261..f4e8ba6 100644
--- a/wowlet_backend/factory.py
+++ b/wowlet_backend/factory.py
@@ -10,7 +10,7 @@ from datetime import datetime
 from asyncio_multisubscriber_queue import MultisubscriberQueue
 from quart import Quart
 from quart_session import Session
-import aioredis
+from redis import asyncio as aioredis
 
 from wowlet_backend.utils import print_banner
 import settings

For anyone who wants to try this out, you'll have to build Wowlet yourself (fortunately there were no problems here, the process is documented in the repo) making sure to edit src/appcontext.h as so:

diff --git a/src/appcontext.h b/src/appcontext.h
index 23a2326..ee00561 100644
--- a/src/appcontext.h
+++ b/src/appcontext.h
@@ -67,8 +67,8 @@ public:
     QString tmpTxDescription;
 
     // https://git.wownero.com/wowlet/wowlet-backend/
-    QString backendHost = "l3hkasj5nnrh24yzj4acj5dgqlscq56o5xjvvqsftj55fkonqly5aiid.onion";
-    unsigned int backendPort = 80;
+    QString backendHost = "127.0.0.1";
+    unsigned int backendPort = 1337;
     bool backendTLS = false;
     QString backendWSUrl;
     QString backendHTTPUrl;

While it's not as good as the Docker instance of the backend just working, this is still better than nothing as I do now have exchange rates and historical prices in my Wowlet. For reference, here's what happens with the backend in Docker:

[2024-02-13 17:34:52,116] ERROR in app: Exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/redis/asyncio/connection.py", line 304, in connect
    await self.retry.call_with_retry(
  File "/usr/local/lib/python3.8/site-packages/redis/asyncio/retry.py", line 59, in call_with_retry
    return await do()
  File "/usr/local/lib/python3.8/site-packages/redis/asyncio/connection.py", line 766, in _connect
    reader, writer = await asyncio.open_connection(
  File "/usr/local/lib/python3.8/asyncio/streams.py", line 52, in open_connection
    transport, _ = await loop.create_connection(
  File "/usr/local/lib/python3.8/asyncio/base_events.py", line 1033, in create_connection
    raise OSError('Multiple exceptions: {}'.format(
OSError: Multiple exceptions: [Errno 111] Connect call failed ('127.0.0.1', 6379), [Errno 99] Cannot assign requested address

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/quart/app.py", line 1671, in startup
    await self.ensure_async(func)()
  File "/app/wowlet_backend/factory.py", line 108, in startup
    await _setup_nodes(app)
  File "/app/wowlet_backend/factory.py", line 29, in _setup_nodes
    await cache.set('nodes', json.dumps(nodes).encode())
  File "/usr/local/lib/python3.8/site-packages/redis/asyncio/client.py", line 627, in execute_command
    conn = self.connection or await pool.get_connection(command_name, **options)
  File "/usr/local/lib/python3.8/site-packages/redis/asyncio/connection.py", line 1150, in get_connection
    await self.ensure_connection(connection)
  File "/usr/local/lib/python3.8/site-packages/redis/asyncio/connection.py", line 1183, in ensure_connection
    await connection.connect()
  File "/usr/local/lib/python3.8/site-packages/redis/asyncio/connection.py", line 312, in connect
    raise ConnectionError(self._error_message(e))
redis.exceptions.ConnectionError: Error connecting to localhost:6379. Multiple exceptions: [Errno 111] Connect call failed ('127.0.0.1', 6379), [Errno 99] Cannot assign requested address.
Process SpawnProcess-1:

   _______________                        |*\_/*|________
  |  ___________  |     .-.     .-.      ||_/-\_|______  |
  | |           | |    .****. .****.     | |           | |
  | |   0   0   | |    .*****.*****.     | |   0   0   | |
  | |     -     | |     .*********.      | |     -     | |
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/redis/asyncio/connection.py", line 304, in connect
  | |   \___/   | |      .*******.       | |   \___/   | |
    await self.retry.call_with_retry(
  | |___     ___| |       .*****.        | |___________| |
  File "/usr/local/lib/python3.8/site-packages/redis/asyncio/retry.py", line 59, in call_with_retry
  |_____|\_/|_____|        .***.         |_______________|
    return await do()
    _|__|/ \|_|_.............*.............._|________|_
  File "/usr/local/lib/python3.8/site-packages/redis/asyncio/connection.py", line 766, in _connect
   / ********** \                          / ********** \
    reader, writer = await asyncio.open_connection(
 /  ************  \                      /  ************  \
  File "/usr/local/lib/python3.8/asyncio/streams.py", line 52, in open_connection
    transport, _ = await loop.create_connection(
--------------------       xmr          --------------------
  File "/usr/local/lib/python3.8/asyncio/base_events.py", line 1033, in create_connection
    raise OSError('Multiple exceptions: {}'.format(
OSError: Multiple exceptions: [Errno 111] Connect call failed ('127.0.0.1', 6379), [Errno 99] Cannot assign requested address

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/quart/asgi.py", line 320, in __call__
    await self.app.startup()
  File "/usr/local/lib/python3.8/site-packages/quart/app.py", line 1671, in startup
    await self.ensure_async(func)()
  File "/app/wowlet_backend/factory.py", line 108, in startup
    await _setup_nodes(app)
  File "/app/wowlet_backend/factory.py", line 29, in _setup_nodes
    await cache.set('nodes', json.dumps(nodes).encode())
  File "/usr/local/lib/python3.8/site-packages/redis/asyncio/client.py", line 627, in execute_command
    conn = self.connection or await pool.get_connection(command_name, **options)
  File "/usr/local/lib/python3.8/site-packages/redis/asyncio/connection.py", line 1150, in get_connection
    await self.ensure_connection(connection)
  File "/usr/local/lib/python3.8/site-packages/redis/asyncio/connection.py", line 1183, in ensure_connection
    await connection.connect()
  File "/usr/local/lib/python3.8/site-packages/redis/asyncio/connection.py", line 312, in connect
    raise ConnectionError(self._error_message(e))
redis.exceptions.ConnectionError: Error connecting to localhost:6379. Multiple exceptions: [Errno 111] Connect call failed ('127.0.0.1', 6379), [Errno 99] Cannot assign requested address.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/hypercorn/asyncio/run.py", line 233, in _run
    runner.run(main(shutdown_trigger=shutdown_trigger))
  File "/usr/local/lib/python3.8/site-packages/taskgroup/runners.py", line 125, in run
    return self._loop.run_until_complete(task)
  File "/usr/local/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "/usr/local/lib/python3.8/site-packages/taskgroup/tasks.py", line 12, in send
    return self.__context.run(self.__coro.send, v)
  File "/usr/local/lib/python3.8/site-packages/hypercorn/asyncio/run.py", line 87, in worker_serve
    raise exception
  File "/usr/local/lib/python3.8/site-packages/hypercorn/asyncio/lifespan.py", line 43, in handle_lifespan
    await self.app(
  File "/usr/local/lib/python3.8/site-packages/hypercorn/app_wrappers.py", line 34, in __call__
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.8/site-packages/quart/app.py", line 1638, in __call__
    await self.asgi_app(scope, receive, send)
  File "/usr/local/lib/python3.8/site-packages/quart/app.py", line 1664, in asgi_app
    await asgi_handler(receive, send)
  File "/usr/local/lib/python3.8/site-packages/quart/asgi.py", line 322, in __call__
    await send(
  File "/usr/local/lib/python3.8/site-packages/hypercorn/asyncio/lifespan.py", line 101, in asgi_send
    raise LifespanFailureError("startup", message.get("message", ""))
hypercorn.utils.LifespanFailureError: Lifespan failure in startup. 'Error connecting to localhost:6379. Multiple exceptions: [Errno 111] Connect call failed ('127.0.0.1', 6379), [Errno 99] Cannot assign requested address.'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/multiprocessing/process.py", line 315, in _bootstrap
    self.run()
  File "/usr/local/lib/python3.8/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.8/site-packages/hypercorn/asyncio/run.py", line 195, in asyncio_worker
    _run(
  File "/usr/local/lib/python3.8/site-packages/hypercorn/asyncio/run.py", line 233, in _run
    runner.run(main(shutdown_trigger=shutdown_trigger))
  File "/usr/local/lib/python3.8/site-packages/taskgroup/runners.py", line 68, in __exit__
    self.close()
  File "/usr/local/lib/python3.8/site-packages/taskgroup/runners.py", line 78, in close
    loop.run_until_complete(loop.shutdown_default_executor())
AttributeError: '_UnixSelectorEventLoop' object has no attribute 'shutdown_default_executor'

Long-term, I think the backend stuff should be moved into Wowlet itself to prevent issues like this from happening ever again.

nogoer

since you sem to be the most recent post im replying to you with a question. Is this coin still active? On a whim i decided for fun to try and mine this coin and started with trying to setup my own node. After finding way outdated info on that and having no success i just decided to try mining to the deamon which i got working. Now im not sure its even worth this, theres no pools left and after 3 days of mining ive had 0 results(sort of expected), but not sure if thats because of low hash or defunct coin. There seems to be very little current info on how to properly mine or setup a node yet the coin is still listed on exchanges and seems to have mem activity.

Whats the deal currently with mining wownero?

terrydavis

Quote from: nogoer on Feb 15, 2024, 03:07 PMsince you sem to be the most recent post im replying to you with a question. Is this coin still active? On a whim i decided for fun to try and mine this coin and started with trying to setup my own node. After finding way outdated info on that and having no success i just decided to try mining to the deamon which i got working. Now im not sure its even worth this, theres no pools left and after 3 days of mining ive had 0 results(sort of expected), but not sure if thats because of low hash or defunct coin. There seems to be very little current info on how to properly mine or setup a node yet the coin is still listed on exchanges and seems to have mem activity.

Whats the deal currently with mining wownero?

Don't thread hijack please.

There's no pools left because Wownero is solo mine only since Junkie Jeff and you should really avoid mining with the daemon, I compared it with XMRig (both 10 threads, although my CPU can do 20 just fine) and the daemon is 10 times slower than XMRig (~700H/s vs ~7000). For reference, according to https://www.cryptunit.com/coin/WOW?hr=7000 I would get a block every approx. 7 days with XMRig and every approx. 69 days with the daemon.

P. S. I'm not currently mining Wownero myself, these were just short benchmarks.

terrydavis