120d875e06
* consolidate `NodeRep` and `NodeStats` * regenerate * review fixes * go travis
105 lines
2.8 KiB
Protocol Buffer
105 lines
2.8 KiB
Protocol Buffer
// Copyright (C) 2018 Storj Labs, Inc.
|
|
// See LICENSE for copying information.
|
|
|
|
syntax = "proto3";
|
|
option go_package = "pb";
|
|
|
|
import "google/protobuf/duration.proto";
|
|
import "gogo.proto";
|
|
import "node.proto";
|
|
|
|
package overlay;
|
|
|
|
// Overlay defines the interface for communication with the overlay network
|
|
service Overlay {
|
|
// Lookup finds a nodes address from the network
|
|
rpc Lookup(LookupRequest) returns (LookupResponse);
|
|
// BulkLookup finds nodes addresses from the network
|
|
rpc BulkLookup(LookupRequests) returns (LookupResponses);
|
|
// FindStorageNodes finds a list of nodes in the network that meet the specified request parameters
|
|
rpc FindStorageNodes(FindStorageNodesRequest) returns (FindStorageNodesResponse);
|
|
}
|
|
|
|
service Nodes {
|
|
rpc Query(QueryRequest) returns (QueryResponse);
|
|
rpc Ping(PingRequest) returns (PingResponse);
|
|
}
|
|
|
|
// LookupRequest is is request message for the lookup rpc call
|
|
message LookupRequest {
|
|
bytes node_id = 1 [(gogoproto.customtype) = "NodeID", (gogoproto.nullable) = false];
|
|
}
|
|
|
|
// LookupResponse is is response message for the lookup rpc call
|
|
message LookupResponse {
|
|
node.Node node = 1;
|
|
}
|
|
|
|
//LookupRequests is a list of LookupRequest
|
|
message LookupRequests {
|
|
repeated LookupRequest lookup_request = 1;
|
|
}
|
|
|
|
//LookupResponse is a list of LookupResponse
|
|
message LookupResponses {
|
|
repeated LookupResponse lookup_response = 1;
|
|
}
|
|
|
|
|
|
// FindStorageNodesResponse is is response message for the FindStorageNodes rpc call
|
|
message FindStorageNodesResponse {
|
|
repeated node.Node nodes = 1;
|
|
}
|
|
|
|
// FindStorageNodesRequest is is request message for the FindStorageNodes rpc call
|
|
message FindStorageNodesRequest {
|
|
int64 object_size = 1;
|
|
google.protobuf.Duration contract_length = 2;
|
|
OverlayOptions opts = 3;
|
|
bytes start = 4 [(gogoproto.customtype) = "NodeID", (gogoproto.nullable) = false];
|
|
int64 max_nodes = 5;
|
|
}
|
|
|
|
// OverlayOptions is a set of criteria that a node must meet to be considered for a storage opportunity
|
|
message OverlayOptions {
|
|
google.protobuf.Duration max_latency = 1;
|
|
node.NodeStats min_stats = 2;
|
|
int64 min_speed_kbps = 3;
|
|
int64 amount = 4;
|
|
node.NodeRestrictions restrictions = 5;
|
|
repeated bytes excluded_nodes = 6 [(gogoproto.customtype) = "NodeID"];
|
|
}
|
|
|
|
message QueryRequest {
|
|
node.Node sender = 1;
|
|
node.Node target = 2;
|
|
int64 limit = 3;
|
|
bool pingback = 4;
|
|
}
|
|
|
|
message QueryResponse {
|
|
node.Node sender = 1;
|
|
repeated node.Node response = 2;
|
|
}
|
|
|
|
message PingRequest {};
|
|
message PingResponse {};
|
|
|
|
message Restriction {
|
|
enum Operator {
|
|
LT = 0;
|
|
EQ = 1;
|
|
GT = 2;
|
|
LTE = 3;
|
|
GTE = 4;
|
|
}
|
|
enum Operand {
|
|
FREE_BANDWIDTH = 0;
|
|
FREE_DISK = 1;
|
|
}
|
|
|
|
Operator operator = 1;
|
|
Operand operand = 2;
|
|
int64 value = 3;
|
|
}
|