refactor: split PM2 ecosystem config into pm2/ folder + update README
- ecosystem.config.cjs removed from root - pm2/copy.config.cjs — copy trade bot config - pm2/mm.config.cjs — market maker bot config Both use __dirname-relative paths so they work regardless of cwd. README updated: - Added PM2/VPS section with per-bot start/log/management commands - Added plain log mode section (bot / mm-bot scripts) - Updated project structure tree with new files - Added MIN_MARKET_TIME_LEFT and GTC_FALLBACK_TIMEOUT to config table - Updated copy trade flow diagram Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
5ea7f3d2b0
commit
f4490c12ac
@@ -0,0 +1,47 @@
|
||||
/**
|
||||
* PM2 config — Copy Trade Bot
|
||||
*
|
||||
* Usage (from project root):
|
||||
* pm2 start pm2/copy.config.cjs # live trading
|
||||
* pm2 start pm2/copy.config.cjs --env sim # simulation / dry-run
|
||||
*
|
||||
* pm2 logs polymarket-copy
|
||||
* pm2 restart polymarket-copy
|
||||
* pm2 stop polymarket-copy
|
||||
* pm2 delete polymarket-copy
|
||||
*/
|
||||
const path = require('path');
|
||||
const root = path.join(__dirname, '..');
|
||||
|
||||
module.exports = {
|
||||
apps: [
|
||||
{
|
||||
name: 'polymarket-copy',
|
||||
script: path.join(root, 'src/bot.js'),
|
||||
interpreter: 'node',
|
||||
|
||||
// Live trading (default)
|
||||
env: {
|
||||
NODE_ENV: 'production',
|
||||
DRY_RUN: 'false',
|
||||
},
|
||||
|
||||
// Simulation: pm2 start pm2/copy.config.cjs --env sim
|
||||
env_sim: {
|
||||
NODE_ENV: 'production',
|
||||
DRY_RUN: 'true',
|
||||
},
|
||||
|
||||
out_file: path.join(root, 'logs/copy-out.log'),
|
||||
error_file: path.join(root, 'logs/copy-error.log'),
|
||||
log_date_format: 'YYYY-MM-DD HH:mm:ss Z',
|
||||
merge_logs: true,
|
||||
|
||||
restart_delay: 5000,
|
||||
max_restarts: 10,
|
||||
min_uptime: '10s',
|
||||
max_memory_restart: '256M',
|
||||
stop_exit_codes: [0],
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -0,0 +1,47 @@
|
||||
/**
|
||||
* PM2 config — Market Maker Bot
|
||||
*
|
||||
* Usage (from project root):
|
||||
* pm2 start pm2/mm.config.cjs # live trading
|
||||
* pm2 start pm2/mm.config.cjs --env sim # simulation / dry-run
|
||||
*
|
||||
* pm2 logs polymarket-mm
|
||||
* pm2 restart polymarket-mm
|
||||
* pm2 stop polymarket-mm
|
||||
* pm2 delete polymarket-mm
|
||||
*/
|
||||
const path = require('path');
|
||||
const root = path.join(__dirname, '..');
|
||||
|
||||
module.exports = {
|
||||
apps: [
|
||||
{
|
||||
name: 'polymarket-mm',
|
||||
script: path.join(root, 'src/mm-bot.js'),
|
||||
interpreter: 'node',
|
||||
|
||||
// Live trading (default)
|
||||
env: {
|
||||
NODE_ENV: 'production',
|
||||
DRY_RUN: 'false',
|
||||
},
|
||||
|
||||
// Simulation: pm2 start pm2/mm.config.cjs --env sim
|
||||
env_sim: {
|
||||
NODE_ENV: 'production',
|
||||
DRY_RUN: 'true',
|
||||
},
|
||||
|
||||
out_file: path.join(root, 'logs/mm-out.log'),
|
||||
error_file: path.join(root, 'logs/mm-error.log'),
|
||||
log_date_format: 'YYYY-MM-DD HH:mm:ss Z',
|
||||
merge_logs: true,
|
||||
|
||||
restart_delay: 5000,
|
||||
max_restarts: 10,
|
||||
min_uptime: '10s',
|
||||
max_memory_restart: '256M',
|
||||
stop_exit_codes: [0],
|
||||
},
|
||||
],
|
||||
};
|
||||
Reference in New Issue
Block a user