1// Copyright (C) 2019 Storj Labs, Inc. 2// See LICENSE for copying information. 3 4syntax = "proto3"; 5option go_package = "storj.io/common/pb"; 6 7package pointerdb; 8 9import "google/protobuf/timestamp.proto"; 10import "gogo.proto"; 11import "orders.proto"; 12 13message RedundancyScheme { 14 enum SchemeType { 15 INVALID = 0; 16 RS = 1; 17 } 18 SchemeType type = 1; 19 20 // these values apply to RS encoding 21 int32 min_req = 2; // minimum required for reconstruction 22 int32 total = 3; // total amount of pieces we generated 23 int32 repair_threshold = 4; // amount of pieces we need to drop to before triggering repair 24 int32 success_threshold = 5; // amount of pieces we need to store to call it a success 25 26 int32 erasure_share_size = 6; 27} 28 29message RemotePiece { 30 int32 piece_num = 1; 31 bytes node_id = 2 [(gogoproto.customtype) = "NodeID", (gogoproto.nullable) = false]; 32 orders.PieceHash hash = 3; 33} 34 35message RemoteSegment { 36 RedundancyScheme redundancy = 1; 37 bytes root_piece_id = 2 [(gogoproto.customtype) = "PieceID", (gogoproto.nullable) = false]; 38 repeated RemotePiece remote_pieces = 3; 39 bytes merkle_root = 4; // root hash of the hashes of all of these pieces 40} 41 42message Pointer { 43 enum DataType { 44 INLINE = 0; 45 REMOTE = 1; 46 } 47 48 DataType type = 1; 49 50 bytes inline_segment = 3; 51 RemoteSegment remote = 4; 52 int64 segment_size = 5; 53 54 google.protobuf.Timestamp creation_date = 6 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; 55 google.protobuf.Timestamp expiration_date = 7 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; 56 57 bytes metadata = 8; 58 59 google.protobuf.Timestamp last_repaired = 9 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; 60 int32 repair_count = 10; 61 bool piece_hashes_verified = 11; 62} 63 64message ListResponse { 65 message Item { 66 string path = 1; 67 Pointer pointer = 2; 68 bool is_prefix = 3; 69 } 70 71 repeated Item items = 1; 72 bool more = 2; 73} 74