Skip to content

Commit aebd334

Browse files
authored
more docs, and minor improvements for attested-get (#30)
1 parent 24c49a8 commit aebd334

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

cmd/attested-get/main.go

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,24 @@ package main
1010
//
1111
// go run cmd/attested-get/main.go --addr=https://instance_ip:port
1212
//
13-
// Can also save the verified measurements and the response body to files:
13+
// Save the verified measurements and the response body to files:
1414
//
15-
// go run cmd/attested-get/main.go --addr=https://instance_ip:port --out-measurements=measurements.json --out-response=response.txt
15+
// go run cmd/attested-get/main.go \
16+
// --addr=https://instance_ip:port \
17+
// --out-measurements=measurements.json \
18+
// --out-response=response.txt
1619
//
17-
// You can also compare the resulting measurements with a list of expected measurements:
20+
// Compare the resulting measurements with a list of expected measurements:
1821
//
19-
// go run cmd/get-measurements/main.go --addr=https://instance_ip:port --expected-measurements=measurements.json
22+
// go run cmd/attested-get/main.go \
23+
// --addr=https://instance_ip:port \
24+
// --expected-measurements=measurements.json
25+
//
26+
// Also works with an URL for expected measurements:
27+
//
28+
// go run cmd/attested-get/main.go \
29+
// --addr=https://buildernet-01-euw.builder.flashbots.net:7936/cert \
30+
// --expected-measurements=https://measurements.builder.flashbots.net
2031
//
2132

2233
import (
@@ -133,6 +144,7 @@ func runClient(cCtx *cli.Context) (err error) {
133144
if expectedMeasurementsPath != "" {
134145
log.Info("Loading expected measurements from " + expectedMeasurementsPath + " ...")
135146
expectedMeasurements, err = multimeasurements.New(expectedMeasurementsPath)
147+
log.With("measurements", expectedMeasurements.Count()).Info("Measurements loaded")
136148
if err != nil {
137149
return err
138150
}

multimeasurements/multimeasurements.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,7 @@ func (m *MultiMeasurements) Contains(measurements map[uint32][]byte) (found bool
9292

9393
return false, nil
9494
}
95+
96+
func (m *MultiMeasurements) Count() (n uint32) {
97+
return uint32(len(m.Measurements))
98+
}

0 commit comments

Comments
 (0)