mirror of
https://git.wownero.com/wowlet/wowlet-backend.git
synced 2024-08-15 01:03:13 +00:00
Feather-ws rewrite;
- Move recurring tasks into their own class; inherits from `FeatherTask` - CCS proposals: Don't use API, it's broken - webcrawl instead until it is fixed. - Switch to hypercorn as the ASGI server, *with* support for multiple workers. You can now run feather-ws with, for example, `--workers 6`. See `Dockerfile`. - Introduce support for various coins under `BlockheightTask` - Introduce support for various Reddit communities under `RedditTask` - Introduced weightvoting whilst validating third-party RPC blockheights - where nodes are filtered based on what other nodes are commonly reporting. - Current blockheights are fetched from various block explorers and weightvoting is done to eliminate outliers under `BlockheightTask`. - Don't filter/remove bad nodes from the rpc_nodes list; correctly label them as disabled/bad nodes. - Multiple Feather instances (each for it's own coin) can now run on one machine, using only one Redis instance, as each coins has it's own Redis database index. - Configuration options inside `settings.py` can now be controlled via environment variables. - Better logging through custom log formatting and correct usage of `app.logger.*` - Fixed a bug where one task could overlap with itself if the previous one did not finish yet. This was particularly noticable inside the `RPCNodeCheckTask` where the high timeout (for Tor nodes) could cause the task to run *longer* than the recurring task interval. - Introduced a `docker-compose.yml` to combine the Feather container with Redis and Tor containers. - Blocking IO operations are now done via `aiofiles`
This commit is contained in:
parent
cb4087dd25
commit
42bb0c832e
24 changed files with 1250 additions and 671 deletions
|
@ -2,29 +2,33 @@
|
|||
# Copyright (c) 2020, The Monero Project.
|
||||
# Copyright (c) 2020, dsc@xmr.pm
|
||||
|
||||
debug = False
|
||||
host = "127.0.0.1"
|
||||
port = 1337
|
||||
redis_password = None
|
||||
redis_address = "redis://localhost"
|
||||
tor_socks = "socks5://127.0.0.1:9050"
|
||||
rpc_url = "http://127.0.0.1:18089"
|
||||
xmrchain = "https://stagenet.xmrchain.net"
|
||||
import os
|
||||
cwd = os.path.dirname(os.path.realpath(__file__))
|
||||
|
||||
crypto_name = "monero"
|
||||
crypto_symbol = "xmr"
|
||||
crypto_block_date_start = "20140418"
|
||||
|
||||
urls = {
|
||||
"xmrig": "https://api.github.com/repos/xmrig/xmrig/releases",
|
||||
"reddit": "https://www.reddit.com/r/monero/top.json?limit=100",
|
||||
"ccs": "https://ccs.getmonero.org",
|
||||
"fiat_rates": "https://api.exchangeratesapi.io/latest?base=USD",
|
||||
"crypto_rates": "https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd",
|
||||
"crypto_wow_rates": "https://api.coingecko.com/api/v3/simple/price?ids=wownero&vs_currencies=usd"
|
||||
def bool_env(val):
|
||||
return val is True or (isinstance(val, str) and (val.lower() == 'true' or val == '1'))
|
||||
|
||||
|
||||
DEBUG = bool_env(os.environ.get("FEATHER_DEBUG", False))
|
||||
HOST = os.environ.get("FEATHER_HOST", "127.0.0.1")
|
||||
PORT = int(os.environ.get("FEATHER_PORT", 1337))
|
||||
|
||||
REDIS_ADDRESS = os.environ.get("FEATHER_REDIS_ADDRESS", "redis://localhost")
|
||||
REDIS_PASSWORD = os.environ.get("FEATHER_REDIS_PASSWORD")
|
||||
|
||||
COIN_NAME = os.environ.get("FEATHER_COIN_NAME", "monero").lower() # as per coingecko
|
||||
COIN_SYMBOL = os.environ.get("FEATHER_COIN_SYMBOL", "xmr").lower() # as per coingecko
|
||||
COIN_GENESIS_DATE = os.environ.get("FEATHER_COIN_GENESIS_DATE", "20140418")
|
||||
COIN_MODE = os.environ.get("FEATHER_COIN_MODE", "mainnet").lower()
|
||||
|
||||
TOR_SOCKS_PROXY = os.environ.get("FEATHER_TOR_SOCKS_PROXY", "socks5://127.0.0.1:9050")
|
||||
|
||||
# while fetching USD price from coingecko, also include these extra coins:
|
||||
CRYPTO_RATES_COINS_EXTRA = {
|
||||
"wownero": "wow",
|
||||
"aeon": "aeon",
|
||||
"turtlecoin": "trtl",
|
||||
"haven": "xhv",
|
||||
"loki": "loki"
|
||||
}
|
||||
|
||||
if debug:
|
||||
urls["xmrto_rates"] = "https://test.xmr.to/api/v3/xmr2btc/order_parameter_query/"
|
||||
else:
|
||||
urls["xmrto_rates"] = "https://xmr.to/api/v3/xmr2btc/order_parameter_query/"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue