文档修改
This commit is contained in:
@@ -7,7 +7,7 @@ TAG = "div"
|
||||
|
||||
PATHS = [
|
||||
Path(__file__).resolve().parent.parent / "templates" / "index.html",
|
||||
Path(r"c:\Users\dekun\Desktop\crypto_monitor\crypto_monitor_gate\templates\index.html"),
|
||||
Path(r"c:\Users\dekun\Desktop\crypto_monitor_user\crypto_monitor_gate\templates\index.html"),
|
||||
]
|
||||
|
||||
KEY_START = " {% if page == 'key_monitor' %}"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
from pathlib import Path
|
||||
|
||||
binance = Path(__file__).resolve().parent.parent / "app.py"
|
||||
gate = Path(r"c:\Users\dekun\Desktop\crypto_monitor\crypto_monitor_gate\app.py")
|
||||
gate = Path(r"c:\Users\dekun\Desktop\crypto_monitor_user\crypto_monitor_gate\app.py")
|
||||
|
||||
b = binance.read_text(encoding="utf-8")
|
||||
g = gate.read_text(encoding="utf-8")
|
||||
|
||||
@@ -28,13 +28,13 @@
|
||||
将包含 `app.py` 的项目放到固定目录,例如:
|
||||
|
||||
```bash
|
||||
mkdir -p /opt/crypto_monitor
|
||||
cd /opt/crypto_monitor
|
||||
git clone https://git.bz121.com/dekun/crypto_monitor.git
|
||||
cd crypto_monitor/crypto_monitor_binance
|
||||
mkdir -p /opt/crypto_monitor_user
|
||||
cd /opt/crypto_monitor_user
|
||||
git clone https://git.bz121.com/dekun/crypto_monitor_user.git
|
||||
cd crypto_monitor_user/crypto_monitor_binance
|
||||
```
|
||||
|
||||
下文用 **`/opt/crypto_monitor/crypto_monitor_binance`** 仅为示例,请换成你的实际绝对路径。
|
||||
下文用 **`/opt/crypto_monitor_user/crypto_monitor_binance`** 仅为示例,请换成你的实际绝对路径。
|
||||
|
||||
拉取代码后,若目录下尚无 `.env`,先从模板生成(**勿**把填好密钥的 `.env` 提交 Git):
|
||||
|
||||
@@ -100,7 +100,7 @@ curl -4 -sS --max-time 15 --proxy socks5h://127.0.0.1:1080 https://api.binance.c
|
||||
## 4. Python 虚拟环境
|
||||
|
||||
```bash
|
||||
cd /opt/crypto_monitor/crypto_monitor_binance
|
||||
cd /opt/crypto_monitor_user/crypto_monitor_binance
|
||||
|
||||
python3 -m venv .venv
|
||||
source .venv/bin/activate
|
||||
@@ -128,7 +128,7 @@ export PYTHONDONTWRITEBYTECODE=1
|
||||
### 5.1 首次配置
|
||||
|
||||
```bash
|
||||
cd /opt/crypto_monitor/crypto_monitor_binance
|
||||
cd /opt/crypto_monitor_user/crypto_monitor_binance
|
||||
|
||||
cp -n .env.example .env # 已存在 .env 时不覆盖
|
||||
nano .env # 填入 API、登录密码、端口、代理等
|
||||
@@ -168,7 +168,7 @@ cp .env .env.backup.$(date +%Y%m%d)
|
||||
**一次性安装定时任务**(在对应项目目录执行,Binance / Gate 各执行一次):
|
||||
|
||||
```bash
|
||||
cd /opt/crypto_monitor/crypto_monitor_binance
|
||||
cd /opt/crypto_monitor_user/crypto_monitor_binance
|
||||
chmod +x scripts/backup_data.sh scripts/install_backup_cron.sh
|
||||
bash scripts/install_backup_cron.sh
|
||||
```
|
||||
@@ -176,14 +176,14 @@ bash scripts/install_backup_cron.sh
|
||||
Gate 实例:
|
||||
|
||||
```bash
|
||||
cd /opt/crypto_monitor/crypto_monitor_gate
|
||||
cd /opt/crypto_monitor_user/crypto_monitor_gate
|
||||
bash scripts/install_backup_cron.sh
|
||||
```
|
||||
|
||||
Gate Bot 实例(趋势回调等):
|
||||
|
||||
```bash
|
||||
cd /opt/crypto_monitor/crypto_monitor_gate_bot
|
||||
cd /opt/crypto_monitor_user/crypto_monitor_gate_bot
|
||||
bash scripts/install_backup_cron.sh
|
||||
```
|
||||
|
||||
@@ -247,7 +247,7 @@ BINANCE_SOCKS_PROXY=socks5h://127.0.0.1:1080
|
||||
在已配置 `.env` 且网络可达的前提下:
|
||||
|
||||
```bash
|
||||
cd /opt/crypto_monitor/crypto_monitor_binance
|
||||
cd /opt/crypto_monitor_user/crypto_monitor_binance
|
||||
source .venv/bin/activate
|
||||
python scripts/verify_binance_funding.py
|
||||
```
|
||||
@@ -263,7 +263,7 @@ python scripts/verify_binance_funding.py
|
||||
3. `.env` 已按需配置 `BINANCE_SOCKS_PROXY` 等
|
||||
|
||||
```bash
|
||||
cd /opt/crypto_monitor/crypto_monitor_binance
|
||||
cd /opt/crypto_monitor_user/crypto_monitor_binance
|
||||
source .venv/bin/activate
|
||||
python app.py
|
||||
```
|
||||
@@ -286,7 +286,7 @@ pm2 -v
|
||||
在项目根目录:
|
||||
|
||||
```bash
|
||||
cd /opt/crypto_monitor/crypto_monitor_binance
|
||||
cd /opt/crypto_monitor_user/crypto_monitor_binance
|
||||
pm2 start ecosystem.config.cjs
|
||||
pm2 status
|
||||
pm2 logs --lines 200
|
||||
@@ -323,9 +323,9 @@ ssh -N -D 127.0.0.1:1080 bn-vps \
|
||||
### 10.2 Flask
|
||||
|
||||
```bash
|
||||
cd /opt/crypto_monitor/crypto_monitor_binance
|
||||
pm2 start /opt/crypto_monitor/crypto_monitor_binance/.venv/bin/python --name crypto-monitor-binance -- \
|
||||
/opt/crypto_monitor/crypto_monitor_binance/app.py
|
||||
cd /opt/crypto_monitor_user/crypto_monitor_binance
|
||||
pm2 start /opt/crypto_monitor_user/crypto_monitor_binance/.venv/bin/python --name crypto-monitor-binance -- \
|
||||
/opt/crypto_monitor_user/crypto_monitor_binance/app.py
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
Reference in New Issue
Block a user