mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-01 18:11:20 +08:00
Merge pull request #105 from d0lwl0b/dev
fix(config): rename config example to .jsonc and update all references
This commit is contained in:
@@ -50,7 +50,7 @@ docker compose --version # Docker 24+ includes this, no separate installation n
|
||||
|
||||
```bash
|
||||
# Copy configuration template
|
||||
cp config.json.example config.json
|
||||
cp config.example.jsonc config.json
|
||||
|
||||
# Edit configuration file with your API keys
|
||||
nano config.json # or use any other editor
|
||||
@@ -265,7 +265,7 @@ kill -9 <PID>
|
||||
ls -la config.json
|
||||
|
||||
# If not exists, copy template
|
||||
cp config.json.example config.json
|
||||
cp config.example.jsonc config.json
|
||||
```
|
||||
|
||||
### Health Check Failing
|
||||
|
||||
@@ -55,7 +55,7 @@ docker compose --version # Docker 24+ 自带,无需单独安装
|
||||
|
||||
```bash
|
||||
# 复制配置文件模板
|
||||
cp config.json.example config.json
|
||||
cp config.example.jsonc config.json
|
||||
|
||||
# 编辑配置文件,填入你的 API 密钥
|
||||
nano config.json # 或使用其他编辑器
|
||||
@@ -270,7 +270,7 @@ kill -9 <PID>
|
||||
ls -la config.json
|
||||
|
||||
# 如果不存在,复制模板
|
||||
cp config.json.example config.json
|
||||
cp config.example.jsonc config.json
|
||||
```
|
||||
|
||||
### 健康检查失败
|
||||
|
||||
11
README.md
11
README.md
@@ -251,7 +251,16 @@ Before using this system, you need a Binance Futures account. **Use our referral
|
||||
|
||||
Docker automatically handles all dependencies (Go, Node.js, TA-Lib, SQLite) and environment setup.
|
||||
|
||||
#### Step 1: One-Click Start
|
||||
#### Step 1: Prepare Configuration
|
||||
```bash
|
||||
# Copy configuration template
|
||||
cp config.example.jsonc config.json
|
||||
|
||||
# Edit and fill in your API keys
|
||||
nano config.json # or use any editor
|
||||
```
|
||||
|
||||
#### Step 2: One-Click Start
|
||||
```bash
|
||||
# Option 1: Use convenience script (Recommended)
|
||||
chmod +x start.sh
|
||||
|
||||
@@ -184,7 +184,7 @@ Docker автоматически обрабатывает все зависим
|
||||
#### Шаг 1: Подготовьте конфигурацию
|
||||
```bash
|
||||
# Скопируйте шаблон конфигурации
|
||||
cp config.json.example config.json
|
||||
cp config.example.jsonc config.json
|
||||
|
||||
# Отредактируйте и заполните ваши API ключи
|
||||
nano config.json # или используйте любой редактор
|
||||
@@ -322,7 +322,7 @@ cd ..
|
||||
**Шаг 1**: Скопируйте и переименуйте файл примера конфигурации
|
||||
|
||||
```bash
|
||||
cp config.json.example config.json
|
||||
cp config.example.jsonc config.json
|
||||
```
|
||||
|
||||
**Шаг 2**: Отредактируйте `config.json` и заполните ваши API ключи
|
||||
|
||||
@@ -184,7 +184,7 @@ Docker автоматично обробляє всі залежності (Go,
|
||||
#### Крок 1: Підготуйте конфігурацію
|
||||
```bash
|
||||
# Скопіюйте шаблон конфігурації
|
||||
cp config.json.example config.json
|
||||
cp config.example.jsonc config.json
|
||||
|
||||
# Відредагуйте та заповніть ваші API ключі
|
||||
nano config.json # або використайте будь-який редактор
|
||||
@@ -322,7 +322,7 @@ cd ..
|
||||
**Крок 1**: Скопіюйте та перейменуйте файл прикладу конфігурації
|
||||
|
||||
```bash
|
||||
cp config.json.example config.json
|
||||
cp config.example.jsonc config.json
|
||||
```
|
||||
|
||||
**Крок 2**: Відредагуйте `config.json` та заповніть ваші API ключі
|
||||
|
||||
@@ -248,7 +248,7 @@ Docker会自动处理所有依赖(Go、Node.js、TA-Lib)和环境配置,
|
||||
#### 步骤1:准备配置文件
|
||||
```bash
|
||||
# 复制配置文件模板
|
||||
cp config.json.example config.json
|
||||
cp config.example.jsonc config.json
|
||||
|
||||
# 编辑并填入你的API密钥
|
||||
nano config.json # 或使用其他编辑器
|
||||
@@ -385,7 +385,7 @@ cd ..
|
||||
**步骤1**:复制并重命名示例配置文件
|
||||
|
||||
```bash
|
||||
cp config.json.example config.json
|
||||
cp config.example.jsonc config.json
|
||||
```
|
||||
|
||||
**步骤2**:编辑`config.json`填入您的API密钥
|
||||
|
||||
80
config.example.jsonc
Normal file
80
config.example.jsonc
Normal file
@@ -0,0 +1,80 @@
|
||||
{
|
||||
"traders": [
|
||||
{
|
||||
"id": "hyperliquid_deepseek",
|
||||
"name": "Hyperliquid DeepSeek Trader",
|
||||
"ai_model": "deepseek",
|
||||
"exchange": "hyperliquid",
|
||||
"hyperliquid_private_key": "your_ethereum_private_key_without_0x_prefix",
|
||||
"hyperliquid_wallet_addr": "your_ethereum_address",
|
||||
"hyperliquid_testnet": false,
|
||||
"deepseek_key": "your_deepseek_api_key",
|
||||
"initial_balance": 1000,
|
||||
"scan_interval_minutes": 3
|
||||
},
|
||||
{
|
||||
"id": "binance_qwen",
|
||||
"name": "Binance Qwen Trader",
|
||||
"ai_model": "qwen",
|
||||
"exchange": "binance",
|
||||
"binance_api_key": "your_binance_api_key",
|
||||
"binance_secret_key": "your_binance_secret_key",
|
||||
"qwen_key": "your_qwen_api_key",
|
||||
"initial_balance": 1000,
|
||||
"scan_interval_minutes": 3
|
||||
},
|
||||
{
|
||||
"id": "binance_custom",
|
||||
"name": "Binance Custom API Trader",
|
||||
"ai_model": "custom",
|
||||
"exchange": "binance",
|
||||
"binance_api_key": "your_binance_api_key",
|
||||
"binance_secret_key": "your_binance_secret_key",
|
||||
"custom_api_url": "https://api.openai.com/v1",
|
||||
"custom_api_key": "sk-your-api-key",
|
||||
"custom_model_name": "gpt-4o",
|
||||
"initial_balance": 1000,
|
||||
"scan_interval_minutes": 3
|
||||
},
|
||||
{
|
||||
"id": "aster_deepseek",
|
||||
"name": "Aster DeepSeek Trader",
|
||||
"ai_model": "deepseek",
|
||||
"exchange": "aster",
|
||||
|
||||
// 注意请仔细阅读这三个提示 请进入https://www.asterdex.com/en/api-wallet网站 -> 选择专业api -> 创建新api获取以下信息
|
||||
// user: 主钱包地址 (登录地址/连接到aster的钱包地址)
|
||||
// signer: API钱包地址 (点击生成地址后生成的地址)
|
||||
// privateKey: API钱包私钥 (生成地址对应的私钥)
|
||||
|
||||
"aster_user": "0x63DD5aCC6b1aa0f563956C0e534DD30B6dcF7C4e",
|
||||
"aster_signer": "0x21cF8Ae13Bb72632562c6Fff438652Ba1a151bb0",
|
||||
"aster_private_key": "your_aster_api_wallet_private_key_without_0x_prefix",
|
||||
|
||||
"deepseek_key": "your_deepseek_api_key",
|
||||
"initial_balance": 1000.0,
|
||||
"scan_interval_minutes": 3
|
||||
}
|
||||
],
|
||||
"leverage": {
|
||||
"btc_eth_leverage": 5,
|
||||
"altcoin_leverage": 5
|
||||
},
|
||||
"use_default_coins": true,
|
||||
"default_coins": [
|
||||
"BTCUSDT",
|
||||
"ETHUSDT",
|
||||
"SOLUSDT",
|
||||
"BNBUSDT",
|
||||
"XRPUSDT",
|
||||
"DOGEUSDT",
|
||||
"ADAUSDT",
|
||||
"HYPEUSDT"
|
||||
],
|
||||
"coin_pool_api_url": "",
|
||||
"oi_top_api_url": "",
|
||||
"api_server_port": 8080,
|
||||
"max_daily_loss": 10.0,
|
||||
"max_drawdown": 20.0,
|
||||
"stop_trading_minutes": 60
|
||||
}
|
||||
11
start.sh
11
start.sh
@@ -82,12 +82,19 @@ check_env() {
|
||||
# ------------------------------------------------------------------------
|
||||
check_config() {
|
||||
if [ ! -f "config.json" ]; then
|
||||
print_warning "config.json 不存在,从模板复制..."
|
||||
cp config.json.example config.json
|
||||
print_warning "config.json 不存在,正在从 config.example.jsonc 生成..."
|
||||
|
||||
# 生成 config.json(安全去除 JSONC 注释,不破坏 https://)
|
||||
perl -0777 -pe 's:/\*.*?\*/::gs' config.example.jsonc \
|
||||
| sed -E 's/^[[:space:]]*\/\/.*$//' \
|
||||
| jq '.' > config.json
|
||||
|
||||
print_success "已生成 config.json"
|
||||
print_info "请编辑 config.json 填入你的 API 密钥"
|
||||
print_info "运行: nano config.json 或使用其他编辑器"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
print_success "配置文件存在"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user