- Added a sync manager to handle distributed synchronization across relay peers, initialized in the main application run function. - Enhanced the event handling to update the serial number for synchronization when events are processed. - Introduced new API endpoints for synchronization, allowing peers to fetch the current serial number and events within a specified range. - Implemented peer request validation for synchronization endpoints to ensure authorized access based on NIP-98 authentication. - Updated configuration to support relay peers for synchronization. - Bumped version to v0.24.0 to reflect these changes.
18 lines
319 B
Go
18 lines
319 B
Go
package database
|
|
|
|
import (
|
|
"io"
|
|
|
|
"lol.mleku.dev/chk"
|
|
"lol.mleku.dev/log"
|
|
)
|
|
|
|
// Import a collection of events in line structured minified JSON format (JSONL).
|
|
func (d *D) Import(rr io.Reader) {
|
|
go func() {
|
|
if err := d.ImportEventsFromReader(d.ctx, rr); chk.E(err) {
|
|
log.E.F("import failed: %v", err)
|
|
}
|
|
}()
|
|
}
|