Skip to content
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

Client: get checkpoints by named witness #242

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion cmd/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import (
var (
baseURL = flag.String("base_url", "https://api.transparency.dev", "The base URL of the distributor")
n = flag.Uint("n", 2, "The desired number of witness signatures for each log")
witness = flag.String("witness", "", "The name of a specific witness to fetch the latest checkpoints for. If specified, --n is ignored.")
)

func main() {
Expand All @@ -58,7 +59,13 @@ func main() {
continue
}
fmt.Printf("Log %q (%s)\n", log.Verifier.Name(), l)
cp, err := d.GetCheckpointN(l, *n)
var cp []byte
var err error
if len(*witness) > 0 {
cp, err = d.GetCheckpointWitness(l, *witness)
} else {
cp, err = d.GetCheckpointN(l, *n)
}
if err != nil {
fmt.Printf("❌️ Could not get checkpoint.%d: %v\n", *n, err)
continue
Expand Down
Loading