Ensure .env exists in the root folder as:
DISCORD_TOKEN=[token from discord]
API_BASE_URL=https://api.kasplex.org/v1/krc20
PORT=8080
KASPA_NETWORK=Mainnet
RESOLVER_NODES=[array of resolver FQDN's as "https://...", "https://...", "https://..."]
MAINNET_API_BASE_URL=https://api.kasplex.org/v1/krc20
TESTNET_10_API_BASE_URL=https://tn10api.kasplex.org/v1/krc20
TESTNET_11_API_BASE_URL=https://tn11api.kasplex.org/v1/krc20
Build and run it directly from the project's root folder:
npm run build
npm start
# Kat-Wallet-Bot Management Instructions
## Initial Setup
1. Install PM2 globally:
```bash
npm install -g pm2
-
Build and start the bot with PM2:
npm run build pm2 start npm --name "Kat-Wallet-Bot" -- start
-
Save the PM2 process list to keep the bot running after closing SSH:
pm2 save
When you have new changes to deploy:
-
Pull the latest changes from the main branch:
git pull origin main
-
Rebuild and restart the bot:
npm run build pm2 restart Kat-Wallet-Bot
- View running processes:
pm2 list
- Monitor bot in real-time:
pm2 monit
- View bot logs:
pm2 logs Kat-Wallet-Bot
- Stop the bot:
pm2 stop Kat-Wallet-Bot
- Remove the bot from PM2:
pm2 delete Kat-Wallet-Bot
Remember to run pm2 save
after making changes to ensure the current process list is saved for automatic restarts.
## Kasplex API Documentation
https://docs.kasplex.org/tools-and-reference/kasplex-indexer-api