Closed muhmad-f-k closed 3 years ago
Hello, i am not able to run proxy at all, can i ask you what distro are you using?
ubuntu 20.04
I am using ubuntu 20.04 too, but can't run it what python version are you using 3.7.2 ?
yes. What you gonna do with it? dosnt work, you will never get hashrate when pow hit. If you good with python let me know.
no, i am python noob i have this error when running it:
jacob@jacobsserver:/320gb/Zilliqa-Mining-Proxy$ python3.7 start.py
Traceback (most recent call last):
File "start.py", line 24, in
IF you dont have any coding skills dont waste you time. yeah this mongoen thing pain in the ass,
Did you have the same problem?
yeah, I dont remember how i got around this issue, have it on my node for months. its not issue its dependice issue. something not right on your os.
package mongoengine.connection version 0.22.1 don't have "MongoEngineConnectionError"
File connection.py
from pymongo import MongoClient, ReadPreference, uri_parser
from pymongo.database import _check_name
__all__ = [
"DEFAULT_CONNECTION_NAME",
"DEFAULT_DATABASE_NAME",
"ConnectionFailure",
"connect",
"disconnect",
"disconnect_all",
"get_connection",
"get_db",
"register_connection",
]
DEFAULT_CONNECTION_NAME = "default"
DEFAULT_DATABASE_NAME = "test"
DEFAULT_HOST = "localhost"
DEFAULT_PORT = 27017
_connection_settings = {}
_connections = {}
_dbs = {}
READ_PREFERENCE = ReadPreference.PRIMARY
class ConnectionFailure(Exception):
FIX!!! Changein it "MongoEngineConnectionError" on "ConnectionFailure" in file Zilliqa-Mining-Proxy/zilpool/database/basemodel.py line 27: from mongoengine.connection import get_db, ConnectionFailure line 45: except ConnectionFailure:
File basemodel.py
import logging
from functools import wraps
from inspect import isclass
from cachetools import cached, TTLCache
from mongoengine import connect, Document, OperationError
from mongoengine.connection import get_db, ConnectionFailure
from zilpool.common.local import LocalProxy
db = LocalProxy(get_db)
def connect_to_db(config=None):
""" connect_to_db at the begin of app initializing
:param config: loaded config dict
:return: None
"""
uri = config.database["uri"]
logging.critical(f"Connecting to {uri}")
try:
connect(host=uri)
logging.critical("Database connected!")
except ConnectionFailure:
logging.fatal("Failed connect to MongoDB!")
raise
@mitagmio Hi. The problem proxy dont get real top price anyway from NH:D but thank you for the fix. (if not full_orders: return 2.98)
def get_top_price(self, top_n=1, excluded_orders=None, min_limit_speed=0.0, min_accepted_speed=0.0, max_price=None): pubAPI = public_api(self.host)
full_orders = pubAPI.get_active_orders2(self.config["location"])
logging.info(f"full orders: {full_orders}")
if not full_orders:
return 2.98
if excluded_orders is None:
excluded_orders = []
full_orders = [order for order in full_orders if order["type"] == 'STANDARD' and order["id"] not in excluded_orders]
orders = [order for order in full_orders if float(order["speedLimit"]) >= min_limit_speed
and float(order["acceptedCurrentSpeed"]) >= min_accepted_speed]
Hi. @ShengguangXiao Proxy stop keep order in the top when block 00 comes. And proxy to slow to get latest top price (always lose miners on block 00) since wont keep checking top price... Can figur out why.. Can you take a a look at NH py.