-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
republishing and storage #21
Conversation
impl/pkg/service/did.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removing it for now in a follow up
|
||
type PKARRRecord struct { | ||
// Up to an 1000 byte base64URL encoded string | ||
V string `json:"v" validate:"required"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possible to add length validation for these 3 fields?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is validated up the call stack, will open an issue for further validation
@@ -83,3 +132,54 @@ func (s *PKARRService) GetPKARR(ctx context.Context, id string) (*GetPKARRRespon | |||
Sig: got.Sig, | |||
}, nil | |||
} | |||
|
|||
// TODO(gabe) make this more efficient. create a publish schedule based on each individual record, not all records | |||
func (s *PKARRService) republish() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is this meant to scale? How will sharding work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no sharding planned. it will scale better with individual publishing schedules
|
||
// TODO(gabe) make this more efficient. create a publish schedule based on each individual record, not all records | ||
func (s *PKARRService) republish() { | ||
allRecords, err := s.db.ListRecords() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This call may simply return a subset of all the results. Might need to do some cursor tracking
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree, will open up an issue for this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dht: d, | ||
scheduler: &scheduler, | ||
} | ||
if err = scheduler.Schedule(cfg.PKARRConfig.RepublishCRON, service.republish); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The way this is setup, there will be a republish job for each instance that's running did-dht. Is that intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
intended to run as a single instance
need to add tests