-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for "one-of" attestors alongside "each"
- Loading branch information
Showing
3 changed files
with
49 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package execute | ||
|
||
import ( | ||
"github.com/libp2p/go-libp2p/core/peer" | ||
) | ||
|
||
type Attributes struct { | ||
// Values specify which attributes the node in question should have. | ||
// At the moment we support strict equality only, so no `if RAM >= 16GB` types of conditions. | ||
Values []Parameter `json:"values,omitempty"` | ||
|
||
// Should we accept nodes whose attributes are not attested? | ||
AttestationRequired bool `json:"attestation_required,omitempty"` | ||
|
||
// Explicitly request specific attestors. | ||
Attestors AttributeAttestors `json:"attestors,omitempty"` | ||
} | ||
|
||
type AttributeAttestors struct { | ||
// Each of the listed attestors should be found. | ||
Each []peer.ID `json:"each,omitempty"` | ||
|
||
// Any one of these attestors should be found. | ||
OneOf []peer.ID `json:"one_of,omitempty"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters