Skip to content

Commit

Permalink
documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
krehermann committed Jun 3, 2024
1 parent aa44cc9 commit 7eff619
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/services/ocrcommon/discoverer_database.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,15 @@ const (
don2donDiscovererTable = "don2don_discoverer_announcements"
)

// DiscovererDatabase is a key-value store for p2p announcements
// that are based on the RageP2P library and bootstrap nodes
type DiscovererDatabase struct {
ds sqlutil.DataSource
peerID string
tableName string
}

// NewOCRDiscovererDatabase creates a new DiscovererDatabase for OCR announcements
func NewOCRDiscovererDatabase(ds sqlutil.DataSource, peerID string) *DiscovererDatabase {
return &DiscovererDatabase{
ds: ds,
Expand All @@ -36,6 +39,7 @@ func NewOCRDiscovererDatabase(ds sqlutil.DataSource, peerID string) *DiscovererD
}
}

// NewDON2DONDiscovererDatabase creates a new DiscovererDatabase for DON2DON announcements
func NewDON2DONDiscovererDatabase(ds sqlutil.DataSource, peerID string) *DiscovererDatabase {
return &DiscovererDatabase{
ds: ds,
Expand Down
1 change: 1 addition & 0 deletions core/store/migrate/migrations/0240_don2don_discoverer.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
-- +goose Up
-- this migration is for the don2don_discoverer_announcements table
-- it is essentially the same as ocr_discoverer_announcements but scoped to the don2don use case
-- both cases are based on RageP2P library and bootstrap nodes. for now but we want to keep their addresses separate to avoid accidental cross-communication
CREATE TABLE don2don_discoverer_announcements (
local_peer_id text NOT NULL,
remote_peer_id text NOT NULL,
Expand Down

0 comments on commit 7eff619

Please sign in to comment.