DiscoveryAPI

Top

The public Volt discovery service.

This is exposed by the Volt battery over an INSECURE grpc channel.

This insecurity is ameliorated by the fact that discovered Volts return signatures of their challenge code and owner credential.

Note that only Volts that have explicitly set 'discoverable' in the Volt settings will be discovered.

Discover()

Request: DiscoverRequest
Response: DiscoverResponse

DiscoverRequest

FieldTypeDescription
require_relaybool

Set to require that only Volts that expose a Relay be included in the response.

DiscoverResponse

FieldTypeDescription
statusStatus

endpointSignedEndpoint repeated

A list of endpoints that match the request criteria.

SignedEndpoint

FieldTypeDescription
endpointVoltEndpoint

The discovered Volt endpoint information.

challenge_signaturestring

The discovered Volt's challenge code, signed by the Volt private key and base64 encoded.

If a client knows the Volt challenge code by some out-of-band means, it can use the Volt public key (contained in the endpoint information above) to determine that the discovered Volt also knows the same challenge code.

Status

FieldTypeDescription
codeint32

A simple error code that can be easily handled by the client.

Mirrors the grpc StatusCode enum, 0 => OK

messagestring

A developer-facing human-readable error message in English. It should both explain the error and offer an actionable resolution to it.

descriptionstring

Long form error description.

Scalar Value Types

.proto TypeNotesC++JavaPythonGoC#PHPRuby
doubledoubledoublefloatfloat64doublefloatFloat
floatfloatfloatfloatfloat32floatfloatFloat
int32Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead.int32intintint32intintegerBignum or Fixnum (as required)
int64Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead.int64longint/longint64longinteger/stringBignum
uint32Uses variable-length encoding.uint32intint/longuint32uintintegerBignum or Fixnum (as required)
uint64Uses variable-length encoding.uint64longint/longuint64ulonginteger/stringBignum or Fixnum (as required)
sint32Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s.int32intintint32intintegerBignum or Fixnum (as required)
sint64Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s.int64longint/longint64longinteger/stringBignum
fixed32Always four bytes. More efficient than uint32 if values are often greater than 2^28.uint32intintuint32uintintegerBignum or Fixnum (as required)
fixed64Always eight bytes. More efficient than uint64 if values are often greater than 2^56.uint64longint/longuint64ulonginteger/stringBignum
sfixed32Always four bytes.int32intintint32intintegerBignum or Fixnum (as required)
sfixed64Always eight bytes.int64longint/longint64longinteger/stringBignum
boolboolbooleanbooleanboolboolbooleanTrueClass/FalseClass
stringA string must always contain UTF-8 encoded or 7-bit ASCII text.stringStringstr/unicodestringstringstringString (UTF-8)
bytesMay contain any arbitrary sequence of bytes.stringByteStringstr[]byteByteStringstringString (ASCII-8BIT)