Commit 8824f6b0 by lei

1

parent a61d5385
...@@ -17,7 +17,7 @@ from aredis import StrictRedis, ConnectionPool ...@@ -17,7 +17,7 @@ from aredis import StrictRedis, ConnectionPool
from web3._utils.abi import get_abi_output_types, map_abi_data from web3._utils.abi import get_abi_output_types, map_abi_data
from web3._utils.normalizers import BASE_RETURN_NORMALIZERS from web3._utils.normalizers import BASE_RETURN_NORMALIZERS
uni256Max = 2**256 uni256Max = 2 ** 256
class RedisConnSingleton(object): class RedisConnSingleton(object):
...@@ -31,7 +31,8 @@ class RedisConnSingleton(object): ...@@ -31,7 +31,8 @@ class RedisConnSingleton(object):
:param kwargs: :param kwargs:
""" """
if cls._instance is None: if cls._instance is None:
cls._instance = redis.ConnectionPool(max_connections=1000, host='114.132.50.141', port=6379, db=0, password='lhj123456') cls._instance = redis.ConnectionPool(max_connections=1000, host='42.194.143.229', port=6379, db=0,
password='a123456,a')
return cls._instance return cls._instance
...@@ -46,7 +47,8 @@ class RedisConnectionPoolSingleton(object): ...@@ -46,7 +47,8 @@ class RedisConnectionPoolSingleton(object):
:param kwargs: :param kwargs:
""" """
if cls._instance is None: if cls._instance is None:
cls._instance = ConnectionPool(max_connections=1000, host='114.132.50.141', port=6379, db=0, password='lhj123456') cls._instance = ConnectionPool(max_connections=1000, host='42.194.143.229', port=6379, db=0,
password='a123456,a')
return cls._instance return cls._instance
...@@ -190,13 +192,15 @@ class RedisCon: ...@@ -190,13 +192,15 @@ class RedisCon:
class Helper: class Helper:
"""公共基础类""" """公共基础类"""
@staticmethod @staticmethod
def getProxyLst(): def getProxyLst():
"""获取代理列表""" """获取代理列表"""
proxy_lst = list() proxy_lst = list()
for i in range(5): for i in range(5):
try: try:
response = requests.get("https://proxy.webshare.io/api/v2/proxy/list/download/pgewrawzvvqtzwdzjfdfswvkwcjasmofoucnfyyq/-/any/username/direct/-/").text response = requests.get(
"https://proxy.webshare.io/api/v2/proxy/list/download/pgewrawzvvqtzwdzjfdfswvkwcjasmofoucnfyyq/-/any/username/direct/-/").text
a = response.split('\r\n') a = response.split('\r\n')
proxy_lst = a[:-1] proxy_lst = a[:-1]
proxy_lst = list(map(lambda x: x.split(":"), proxy_lst)) proxy_lst = list(map(lambda x: x.split(":"), proxy_lst))
...@@ -1100,7 +1104,8 @@ class Helper: ...@@ -1100,7 +1104,8 @@ class Helper:
return amountIn, amountOut return amountIn, amountOut
@staticmethod @staticmethod
async def get_usd_price_V2(p_token, p_token_d, p_token_symbol, price, usd_token, uToken, redisKey, Router, uDecimals, web_async): async def get_usd_price_V2(p_token, p_token_d, p_token_symbol, price, usd_token, uToken, redisKey, Router,
uDecimals, web_async):
""" """
get usd price get usd price
...@@ -1124,7 +1129,8 @@ class Helper: ...@@ -1124,7 +1129,8 @@ class Helper:
return usd_price return usd_price
@staticmethod @staticmethod
async def get_token_detail(p_token, p_token_d, p_token_symbol, pool_address, usd_token, wToken, wDecimals, uToken, uDecimals, redisKey, Router, swapType, p_amount, web_async): async def get_token_detail(p_token, p_token_d, p_token_symbol, pool_address, usd_token, wToken, wDecimals, uToken,
uDecimals, redisKey, Router, swapType, p_amount, web_async):
""" """
get token info get token info
...@@ -1212,7 +1218,8 @@ class Helper: ...@@ -1212,7 +1218,8 @@ class Helper:
await Helper.task_list('chain:holderQueue', json.dumps(data_)) await Helper.task_list('chain:holderQueue', json.dumps(data_))
else: else:
await Helper.task_list('chain:holderQueue', json.dumps(data_)) await Helper.task_list('chain:holderQueue', json.dumps(data_))
await Helper.redis_data(data, token_detail, ts_, redisKey, public_token, chainId, stable, search_table, web_async) await Helper.redis_data(data, token_detail, ts_, redisKey, public_token, chainId, stable, search_table,
web_async)
@staticmethod @staticmethod
def get_time(): def get_time():
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment