The Giveth Notification Service is a critical component of the Giveth ecosystem that monitors blockchain events and sends notifications. It plays a vital role in keeping users informed about important on-chain activities and updates.
- Multi-chain monitoring support
- Real-time event detection
- Customizable notification rules
- Scalable architecture
- Robust error handling and logging
- Production: [Production URL]
- Staging: [Staging URL]
graph TD
A[Notification Service] --> B[Blockchain Monitor]
B --> C[Event Detection]
C --> D[Notification Center]
D --> E[User Notifications]
- TypeScript
- Node.js
- Ethers.js
- Web3.js
- SQLite
- PM2
- Docker
- Service monitors specified blockchain networks
- Detects relevant events and transactions
- Processes events through notification rules
- Sends notifications to appropriate channels
- Logs all activities for monitoring and debugging
- Node.js (version specified in .nvmrc)
- Yarn package manager
- Docker (for containerized deployment)
- SQLite
-
Clone the repository:
git clone https://github.com/Giveth/giveconomy-notification-service.git cd giveconomy-notification-service
-
Install dependencies:
yarn install
-
Set up environment variables:
cp .env.example .env # Edit .env with your configuration
Required environment variables:
NODE_ENV
: Environment (development/staging/production)DATABASE_PATH
: Path to SQLite databaseBLOCKCHAIN_RPC_URL
: RPC endpoint for blockchain connection- Additional chain-specific configurations
Development mode:
yarn dev
Production mode:
yarn start
Docker deployment:
docker-compose up -d
Run linting:
yarn tslint
Fix linting issues:
yarn tslint:fix
Build the application:
yarn build
Start with PM2:
yarn serve
- Development: Local development setup
- Staging: Pre-production testing environment
- Production: Live production environment
-
Build the application:
yarn build
-
Deploy using Docker:
docker-compose -f docker-compose-production.yml up -d
The project uses GitHub Actions for CI/CD. Workflows are defined in the .github/workflows
directory.
-
Database Connection Issues
- Verify SQLite database path
- Check file permissions
- Ensure database schema is up to date
-
Blockchain Connection Problems
- Verify RPC endpoint
- Check network connectivity
- Validate chain configuration
Logs are stored in the logs
directory. Use the following commands to view logs:
# View all logs
tail -f logs/*.log
# View error logs
tail -f logs/error.log
For more detailed debugging, set the log level in the configuration file.