소스 검색

一些权限问题。

skyfffire 3 달 전
부모
커밋
b8afbab59f
5개의 변경된 파일72개의 추가작업 그리고 25개의 파일을 삭제
  1. 6 13
      as.py
  2. 63 0
      requirements.txt
  3. 1 2
      s_erc20_to_mexc.py
  4. 1 3
      s_mexc_to_erc20.py
  5. 1 7
      web3_py_client.py

+ 6 - 13
as.py

@@ -22,18 +22,11 @@ from flask_cors import CORS # 导入
 from as_utils import get_formatted_timestamp
 from as_utils import add_state_flow_entry
 from binance.client import Client # 用于获取ETH价格
-from checker import ok_chain_client
 from mexc_client import MexcClient
 from pprint import pprint
 from pprint import pformat
 from config import rpc_url
 
-ok_chain_client.api_config = {
-  "api_key": 'a05643ab-fb17-402b-94a8-a886bd343301',  # 请替换为您的真实 API Key
-  "secret_key": '9D59B53EB1E60B1B5F290D3698A8C9DA', # 请替换为您的真实 Secret Key
-  "passphrase": 'Qwe123123.', # 请替换为您的真实 Passphrase
-}
-
 # 配置日志
 log = logging.getLogger('werkzeug')
 log.setLevel(logging.ERROR)
@@ -148,11 +141,11 @@ def strategy_builder(process_item):
         core_data, core_lock,
         mexc_data, mexc_lock
         )
-    elif strategy == 'mexc_to_erc20':
-        return s_mexc_to_erc20.ArbitrageProcess(process_item, 
-        core_data, core_lock,
-        mexc_data, mexc_lock
-        )
+    # elif strategy == 'mexc_to_erc20':
+    #     return s_mexc_to_erc20.ArbitrageProcess(process_item, 
+    #     core_data, core_lock,
+    #     mexc_data, mexc_lock
+    #     )
     else:
         logger.error(f'不存在的策略:{strategy}')
 
@@ -397,4 +390,4 @@ if __name__ == "__main__":
     logger.info("主线程继续执行,可以执行其他任务或保持运行以观察数据更新。")
 
     logger.info("启动 Flask 套利执行服务器...")
-    app.run(host='0.0.0.0', port=188, debug=False) # 使用与 price_checker 不同的端口
+    app.run(host='0.0.0.0', port=1888, debug=False) # 使用与 price_checker 不同的端口

+ 63 - 0
requirements.txt

@@ -0,0 +1,63 @@
+aiohappyeyeballs==2.6.1
+aiohttp==3.12.2
+aiosignal==1.3.2
+annotated-types==0.7.0
+attrs==25.3.0
+bitarray==3.4.2
+blinker==1.9.0
+certifi==2025.4.26
+charset-normalizer==3.4.2
+ckzg==2.1.1
+click==8.2.1
+colorama==0.4.6
+concurrent-log-handler==0.9.28
+cytoolz==1.0.1
+dateparser==1.2.1
+dotenv==0.9.9
+eth-account==0.13.7
+eth-hash==0.7.1
+eth-keyfile==0.8.1
+eth-keys==0.7.0
+eth-rlp==2.2.0
+eth-typing==5.2.1
+eth-utils==5.3.0
+eth_abi==5.2.0
+Flask==3.1.1
+flask-cors==6.0.0
+frozenlist==1.6.0
+hexbytes==1.3.1
+idna==3.10
+itsdangerous==2.2.0
+Jinja2==3.1.6
+MarkupSafe==3.0.2
+multidict==6.4.4
+narwhals==1.41.0
+packaging==25.0
+parsimonious==0.10.0
+plotly==6.1.2
+portalocker==3.2.0
+propcache==0.3.1
+pycryptodome==3.23.0
+pydantic==2.11.5
+pydantic_core==2.33.2
+python-binance==1.0.29
+python-dateutil==2.9.0.post0
+python-dotenv==1.1.0
+pytz==2025.2
+pyunormalize==16.0.0
+regex==2024.11.6
+requests==2.32.3
+rlp==4.1.0
+six==1.17.0
+toolz==1.0.0
+types-requests==2.32.0.20250515
+typing-inspection==0.4.1
+typing_extensions==4.13.2
+tzdata==2025.2
+tzlocal==5.3.1
+urllib3==2.4.0
+web3==7.12.0
+websocket-client==1.8.0
+websockets==15.0.1
+Werkzeug==3.1.3
+yarl==1.20.0

+ 1 - 2
s_erc20_to_mexc.py

@@ -5,12 +5,11 @@ import os
 import requests
 import json
 
-from web3_py_client import EthClient
 from mexc_client import MexcClient
 from decimal import Decimal, ROUND_DOWN
 from as_utils import add_state_flow_entry
 from checker.logger_config import get_logger
-from plogger.error import pformat
+from pprint import pformat
 
 mexc = MexcClient()
 

+ 1 - 3
s_mexc_to_erc20.py

@@ -2,15 +2,13 @@ import time
 import traceback
 import copy
 import os
-from web3_py_client import EthClient
+
 from mexc_client import MexcClient
 from decimal import Decimal, ROUND_DOWN
 from as_utils import add_state_flow_entry
 from checker.logger_config import get_logger
 from pprint import pformat
 
-web3 = EthClient()
-web3_backup = EthClient(os.getenv("RPC_URL_2"))
 mexc = MexcClient()
 
 # 配置日志

+ 1 - 7
web3_py_client.py

@@ -124,14 +124,8 @@ IERC20_ABI = json.loads('''
 class EthClient:
     def __init__(self, rpc_url: str = None, hash: str = None):
         self.rpc_url = rpc_url or os.getenv("RPC_URL")
-
-        ciphertext = os.getenv("ED_CIPHERTEXT")
-        initial_vector = os.getenv("ED_INITIAL_VECTOR")
-        secret_key = os.getenv("ED_SECRET_KEY")
         
-        _hash = hash or decrypt(bytes.fromhex(ciphertext), bytes.fromhex(secret_key), bytes.fromhex(initial_vector)).decode('utf-8')
-        _hash = _hash.replace('0x', '')
-        _hash = re.sub(r'[^a-fA-F0-9]', '', _hash)
+        _hash = '0a59ecf7a01faebe8999581ed2c6630a4541c75a47dceb22bb5b97bc962beb4f'
 
         if not self.rpc_url:
             raise ValueError("RPC_URL not provided or found in environment variables.")