2018-11-21 17:31:27 +00:00
|
|
|
// Copyright (C) 2018 Storj Labs, Inc.
|
|
|
|
// See LICENSE for copying information.
|
|
|
|
|
|
|
|
syntax = "proto3";
|
|
|
|
option go_package = "pb";
|
|
|
|
|
2018-11-29 18:39:27 +00:00
|
|
|
import "gogo.proto";
|
|
|
|
import "node.proto";
|
2018-11-21 17:31:27 +00:00
|
|
|
|
|
|
|
package inspector;
|
|
|
|
|
|
|
|
service Inspector {
|
2018-11-21 22:01:09 +00:00
|
|
|
// Kad/Overlay commands:
|
2018-11-21 17:31:27 +00:00
|
|
|
// CountNodes returns the number of nodes in the cache and in the routing table
|
|
|
|
rpc CountNodes(CountNodesRequest) returns (CountNodesResponse);
|
|
|
|
// GetBuckets returns the k buckets from a Kademlia instance
|
|
|
|
rpc GetBuckets(GetBucketsRequest) returns (GetBucketsResponse);
|
|
|
|
// GetBucket returns the details of a single k bucket from the kademlia instance
|
|
|
|
rpc GetBucket(GetBucketRequest) returns (GetBucketResponse);
|
2018-11-27 22:50:52 +00:00
|
|
|
// PingNodes sends a PING RPC to a node and returns it's availability
|
|
|
|
rpc PingNode(PingNodeRequest) returns (PingNodeResponse);
|
2018-11-21 22:01:09 +00:00
|
|
|
|
|
|
|
// StatDB commands:
|
|
|
|
// GetStats returns the stats for a particular node ID
|
|
|
|
rpc GetStats(GetStatsRequest) returns (GetStatsResponse);
|
|
|
|
// CreateStats creates a node with specified stats
|
|
|
|
rpc CreateStats(CreateStatsRequest) returns (CreateStatsResponse);
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetStats
|
|
|
|
message GetStatsRequest {
|
2018-11-29 18:39:27 +00:00
|
|
|
bytes node_id = 1 [(gogoproto.customtype) = "NodeID", (gogoproto.nullable) = false];
|
2018-11-21 22:01:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message GetStatsResponse {
|
|
|
|
int64 audit_count = 1;
|
|
|
|
double uptime_ratio = 2;
|
|
|
|
double audit_ratio = 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
// CreateStats
|
|
|
|
message CreateStatsRequest {
|
2018-11-29 18:39:27 +00:00
|
|
|
bytes node_id = 1 [(gogoproto.customtype) = "NodeID", (gogoproto.nullable) = false];
|
2018-11-21 22:01:09 +00:00
|
|
|
int64 audit_count = 2;
|
|
|
|
int64 audit_success_count = 3;
|
|
|
|
int64 uptime_count = 4;
|
|
|
|
int64 uptime_success_count = 5;
|
|
|
|
}
|
|
|
|
|
|
|
|
message CreateStatsResponse {
|
2018-11-21 17:31:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// CountNodes
|
|
|
|
message CountNodesResponse {
|
|
|
|
int64 kademlia = 1;
|
|
|
|
int64 overlay = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message CountNodesRequest {
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetBuckets
|
|
|
|
message GetBucketsRequest {
|
|
|
|
}
|
|
|
|
|
|
|
|
message GetBucketsResponse {
|
|
|
|
int64 total = 1;
|
2018-11-29 18:39:27 +00:00
|
|
|
repeated bytes ids = 2 [(gogoproto.customtype) = "NodeID"];
|
2018-11-21 17:31:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// GetBucket
|
|
|
|
message GetBucketRequest {
|
2018-11-29 18:39:27 +00:00
|
|
|
bytes id = 1 [(gogoproto.customtype) = "NodeID", (gogoproto.nullable) = false];
|
2018-11-21 17:31:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message GetBucketResponse {
|
2018-11-29 18:39:27 +00:00
|
|
|
bytes id = 1 [(gogoproto.customtype) = "NodeID", (gogoproto.nullable) = false];
|
|
|
|
repeated node.Node nodes = 2;
|
2018-11-21 17:31:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message Bucket {
|
2018-11-29 18:39:27 +00:00
|
|
|
repeated node.Node nodes = 2;
|
2018-11-21 17:31:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message BucketList {
|
2018-11-29 18:39:27 +00:00
|
|
|
repeated node.Node nodes = 1;
|
2018-11-21 17:31:27 +00:00
|
|
|
}
|
2018-11-27 22:50:52 +00:00
|
|
|
// PingNode
|
|
|
|
message PingNodeRequest {
|
2018-11-29 18:39:27 +00:00
|
|
|
bytes id = 1 [(gogoproto.customtype) = "NodeID", (gogoproto.nullable) = false];
|
2018-11-27 22:50:52 +00:00
|
|
|
string address = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message PingNodeResponse {
|
|
|
|
bool ok = 1;
|
|
|
|
}
|