Add NIP-11 relay synchronization and group management features
Some checks failed
Go / build (push) Has been cancelled
Go / release (push) Has been cancelled

- Introduced a new `sync` package for managing NIP-11 relay information and relay group configurations.
- Implemented a cache for NIP-11 documents, allowing retrieval of relay public keys and authoritative configurations.
- Enhanced the sync manager to update peer lists based on authoritative configurations from relay group events.
- Updated event handling to incorporate policy checks during event imports, ensuring compliance with relay rules.
- Refactored various components to utilize the new `sha256-simd` package for improved performance.
- Added comprehensive tests to validate the new synchronization and group management functionalities.
- Bumped version to v0.24.1 to reflect these changes.
This commit is contained in:
2025-11-03 18:17:15 +00:00
parent e161d0e4be
commit e56bf76257
83 changed files with 3712 additions and 7417 deletions

View File

@@ -287,3 +287,71 @@ This separation allows flexible output handling:
# Events piped to another program, bloom filter saved
./aggregator -npub npub1... 2>bloom_filter.txt | jq '.content'
```
## Testing
The aggregator includes comprehensive tests to ensure reliable data collection:
### Running Tests
```bash
# Run aggregator tests
go test ./cmd/aggregator
# Run all tests including aggregator
go test ./...
# Run with verbose output
go test -v ./cmd/aggregator
```
### Integration Testing
The aggregator is tested as part of the project's integration test suite:
```bash
# Run the full test suite
./scripts/test.sh
# Run benchmarks (which include aggregator performance)
./scripts/runtests.sh
```
### Example Test Usage
```bash
# Test with mock data (if available)
go test -v ./cmd/aggregator -run TestAggregator
# Test bloom filter functionality
go test -v ./cmd/aggregator -run TestBloomFilter
```
## Development
### Building from Source
```bash
# Build the aggregator binary
go build -o aggregator ./cmd/aggregator
# Build with optimizations
go build -ldflags="-s -w" -o aggregator ./cmd/aggregator
# Cross-compile for different platforms
GOOS=linux GOARCH=amd64 go build -o aggregator-linux-amd64 ./cmd/aggregator
GOOS=darwin GOARCH=arm64 go build -o aggregator-darwin-arm64 ./cmd/aggregator
```
### Code Quality
The aggregator follows Go best practices and includes:
- Comprehensive error handling
- Memory-efficient data structures
- Concurrent processing with proper synchronization
- Extensive logging for debugging
## License
This tool is part of the next.orly.dev project and follows the same licensing terms.