| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
A Go-based microservice that monitors Ethereum wallet activities and cryptocurrency prices, sending customized alerts based on user preferences.
Real-time Transaction Monitoring
Cryptocurrency Price Alerts
Customizable User Alerts
Clone the repository:
git clone https://github.com/Jetlum/WalletAlertService.git
Navigate to the project directory:
cd WalletAlertService
Install dependencies:
go mod download
Create a config.yaml file in the root directory with the following content:
infura: project_id: "YOUR_INFURA_PROJECT_ID" database: url: "postgresql://username:password@localhost:5432/dbname" sendgrid: api_key: "YOUR_SENDGRID_API_KEY" coingecko: api_key: "YOUR_COINGECKO_API_KEY" price_check_interval: 1 # Interval in minutes for price checking
Configure the Ethereum client:
go run main.go
Configure user preferences
// Transaction alerts
userPreference := &models.UserPreference{
UserID: "user@example.com",
WalletAddress: "0x...",
MinEtherValue: "1000000000000000000", // 1 ETH
TrackNFTs: true,
EmailNotification: true,
}
// Price alerts
priceAlert := &models.PriceAlert{
UserID: "user@example.com",
CryptocurrencyID: "BTC",
ThresholdPrice: "50000.00",
IsUpperBound: true,
EmailNotification: true,
}
Run all tests:
go test ./... -v
Run specific tests:
go test -v ./services/... // Test notification services go test -v ./repository/... // Test repositories
Project Structure
├── config/ # Configuration management ├── database/ # Database initialization and connection ├── models/ # Data models and validation ├── nft/ # NFT detection logic ├── repository/ # Data access layer ├── services/ # Business logic and notifications ├── mock/ # Mock implementations for testing └── main.go # Application entry point
NFT Detection:
Pre-configured list of popular NFT contract addresses Extensible for adding new collections
Transaction Processing:
Real-time block monitoring Transaction filtering and categorization Event creation and storage
Price Monitoring:
Real-time cryptocurrency price tracking Configurable check intervals Support for multiple cryptocurrencies Threshold-based alerts Notification System
Notification System:
Email notifications via SendGrid User preference-based filtering Customizable notification templates Support for both transaction and price alerts
Project Structure
├── config/ # Configuration management ├── database/ # Database initialization and connection ├── models/ # Data models ├── nft/ # NFT detection logic ├── repository/ # Data access layer ├── services/ # Business logic and notifications └── mock/ # Test mocks
The project includes a robust testing setup:
Unit Tests: Testing individual components Mock Implementations: For external services and database Integration Tests: Testing component interactions
Set test environment:
export GO_ENV=test
go-ethereum: Ethereum client sendgrid-go: Email notifications gorm: Database ORM viper: Configuration management coingecko-api: CoinGecko API client
| Back | FazBrowse Home | New Git URL |