Basic pull stub

This commit is contained in:
Oskar Thoren 2019-04-16 14:25:38 +08:00
parent 2f574e0dca
commit 2001faa6d2
No known key found for this signature in database
GPG Key ID: 33AAFB33580C538E
1 changed files with 15 additions and 0 deletions

View File

@ -49,6 +49,15 @@ func getRoot(location string, groupID string) string {
return "5f30cc80133b9394156e24b233f0c4be32b24e44bb3381f02c7ba52619d0febc"
}
// Pull gets difference between what you have and what you know you can have
// NOTE: This can happen from any untrusted location, as the integritry can be proven
// TODO: Should return a list of payloads
func pull(mr string, haves []string) []string {
var diff []string
diff = append(diff, "xxx")
return diff
}
func main() {
fmt.Printf("Hello Merkleslash\n")
@ -91,4 +100,10 @@ func main() {
newMR := getRoot("", "")
log.Println("Trusted root:", newMR)
// 2. Sync difference
var emptyList []string
payloads := pull(newMR, emptyList)
log.Println("Pulled payloads:", payloads)
// TODO: Verify contents
}