A Telegram bot that monitors and reports SUI token transactions on SuiRewards.me. This bot automatically detects buy transactions and sends informative notifications to a configured Telegram group.
- Node.js (v16+)
- npm or pnpm
- Docker (optional for containerized deployment)
- PM2 (optional for production deployment)
- A Telegram bot token from @BotFather
- NINJA API key for price data
- Clone the repository
- Rename
.env.example
to.env
mv .env.example .env
- Configure the
.env
file with your credentials:BOT_TOKEN=your_telegram_bot_token NINJA_API_KEY=your_ninja_api_key NINJA_API_URL=ninja_api_endpoint ENVIRONMENT=dev|prod
-
Install dependencies:
pnpm install # or npm install
-
Run in development mode with auto-reload:
pnpm dev # or npm run dev
- Make sure Docker and Docker Compose are installed on your system
- Build and start the container:
docker compose up -d
- View logs:
docker compose logs -f
- To stop the bot:
docker compose down
-
Install PM2 globally:
npm install -g pm2
-
Start the bot with PM2:
pm2 start "npm run start" --name srm-buybot
-
Configure PM2 to start on system boot:
pm2 startup pm2 save
-
Useful PM2 commands:
# Check status pm2 status # View logs pm2 logs srm-buybot # Restart the bot pm2 restart srm-buybot # Stop the bot pm2 stop srm-buybot
-
Update system packages:
sudo apt update && sudo apt upgrade -y
-
Install Node.js and npm (if not already installed):
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash - sudo apt install -y nodejs
-
Clone the repository:
git clone <repository-url> cd srm-buybot
-
Configure environment variables:
cp .env.example .env nano .env # Edit with your credentials
-
Install dependencies and run the bot:
npm install npm run start
- For production usage, set
ENVIRONMENT=prod
in your.env
file - The bot requires proper network access to interact with the SUI blockchain and API services
- Make sure your Telegram bot has the necessary permissions in the target chat group