storj/pkg/pb/node.proto
Jennifer Li Johnson a2fa5c4c5a Proper NodeType Handling (#873)
* adds enums to nodetype

* updating nodetype todos

* ran pb updates

* reorder nodetypes

* adding checks

* wip

* wip

* wip

* bug in test-captplanet

* wip

* add values to storagenode, satellite, captplanet binaries

* Cleanup

* more cleanup

* wip

* lint

* lint

* wip

* fixes bug

* regenerate protos

Change-Id: Id270212e8c7479e52641058042cf23b5317ab773

* limit node type changes to kademlia

Change-Id: I9c1a6cc4a79e05086627f0fdeb5028c62ce754f4

* dpanic

Change-Id: Id952a2ad13c807ebaea0ec0a875405e267d81c3e

* review comments

Change-Id: I7f9b77ef22779dd012fd490375b136014f51f834
2019-01-02 11:47:34 -07:00

71 lines
1.9 KiB
Protocol Buffer

// Copyright (C) 2018 Storj Labs, Inc.
// See LICENSE for copying information.
syntax = "proto3";
option go_package = "pb";
package node;
import "gogo.proto";
// NodeRestrictions contains all relevant data about a nodes ability to store data
message NodeRestrictions {
int64 free_bandwidth = 1;
int64 free_disk = 2;
}
// TODO move statdb.Update() stuff out of here
// Node represents a node in the overlay network
// Node is info for a updating a single storagenode, used in the Update rpc calls
message Node {
bytes id = 1 [(gogoproto.customtype) = "NodeID", (gogoproto.nullable) = false];
NodeAddress address = 2;
NodeType type = 3;
NodeRestrictions restrictions = 4;
NodeStats reputation = 5;
NodeMetadata metadata = 6;
repeated int64 latency_list = 7;
bool audit_success = 8;
bool is_up = 9;
bool update_latency = 10;
bool update_audit_success = 11;
bool update_uptime = 12;
}
// NodeType is an enum of possible node types
enum NodeType {
INVALID = 0;
SATELLITE = 1;
STORAGE = 2;
UPLINK = 3;
}
// NodeAddress contains the information needed to communicate with a node on the network
message NodeAddress {
NodeTransport transport = 1;
string address = 2;
}
// NodeTransport is an enum of possible transports for the overlay network
enum NodeTransport {
TCP_TLS_GRPC = 0;
}
// NodeStats is the reputation characteristics of a node
message NodeStats {
bytes node_id = 1 [(gogoproto.customtype) = "NodeID", (gogoproto.nullable) = false];
int64 latency_90 = 2; // 90th percentile measure of storagenode latency
double audit_success_ratio = 3; // (auditSuccessCount / totalAuditCount)
double uptime_ratio = 4; // (uptimeCount / totalUptimeCheckCount)
int64 audit_count = 5;
int64 audit_success_count = 6;
int64 uptime_count = 7;
int64 uptime_success_count = 8;
}
message NodeMetadata {
string email = 1;
string wallet = 2;
}