diff --git a/Makefile b/Makefile index 39b92d4c..ba5614de 100644 --- a/Makefile +++ b/Makefile @@ -12,17 +12,14 @@ test-integration: test-system: cd tests/system && go test -tags=system_test -v . -gen-lumera-proto: - cd ./proto/lumera/action && protoc --go_out=../../../gen/lumera/action --go-grpc_out=../../../gen/lumera/action --go_opt=paths=source_relative --go-grpc_opt=paths=source_relative action.proto && cd ../../../ - cd ./proto/lumera/action && protoc --go_out=../../../gen/lumera/action --go-grpc_out=../../../gen/lumera/action --go_opt=paths=source_relative --go-grpc_opt=paths=source_relative action_service.proto && cd ../../../ - cd ./proto/lumera/supernode && protoc --go_out=../../../gen/lumera/supernode --go-grpc_out=../../../gen/lumera/supernode --go_opt=paths=source_relative --go-grpc_opt=paths=source_relative supernode.proto && cd ../../../ - cd ./proto/lumera/supernode && protoc --go_out=../../../gen/lumera/supernode --go-grpc_out=../../../gen/lumera/supernode --go_opt=paths=source_relative --go-grpc_opt=paths=source_relative supernode_service.proto && cd ../../../ - -gen-dupe-detection-proto: - cd ./proto/dupedetection && protoc --go_out=../../gen/dupedetection --go-grpc_out=../../gen/dupedetection --go_opt=paths=source_relative --go-grpc_opt=paths=source_relative dd-server.proto && cd ../../ - -gen-raptor-q-proto: - cd ./proto/raptorq && protoc --go_out=../../gen/raptorq --go-grpc_out=../../gen/raptorq --go_opt=paths=source_relative --go-grpc_opt=paths=source_relative raptorq.proto && cd ../../ +gen-cascade: + protoc \ + --proto_path=proto \ + --go_out=gen \ + --go_opt=paths=source_relative \ + --go-grpc_out=gen \ + --go-grpc_opt=paths=source_relative \ + proto/supernode/action/cascade/service.proto # Define the paths SUPERNODE_SRC=supernode/main.go diff --git a/gen/supernode/action/cascade/service.pb.go b/gen/supernode/action/cascade/service.pb.go index c106097f..a0c4a1d3 100644 --- a/gen/supernode/action/cascade/service.pb.go +++ b/gen/supernode/action/cascade/service.pb.go @@ -1,8 +1,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.35.2 -// protoc v3.21.12 -// source: proto/supernode/action/cascade/service.proto +// protoc v3.12.4 +// source: supernode/action/cascade/service.proto package cascade @@ -20,33 +20,33 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -type UploadInputDataRequest struct { +type RegisterRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // Types that are assignable to RequestType: // - // *UploadInputDataRequest_Chunk - // *UploadInputDataRequest_Metadata - RequestType isUploadInputDataRequest_RequestType `protobuf_oneof:"request_type"` + // *RegisterRequest_Chunk + // *RegisterRequest_Metadata + RequestType isRegisterRequest_RequestType `protobuf_oneof:"request_type"` } -func (x *UploadInputDataRequest) Reset() { - *x = UploadInputDataRequest{} - mi := &file_proto_supernode_action_cascade_service_proto_msgTypes[0] +func (x *RegisterRequest) Reset() { + *x = RegisterRequest{} + mi := &file_supernode_action_cascade_service_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *UploadInputDataRequest) String() string { +func (x *RegisterRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*UploadInputDataRequest) ProtoMessage() {} +func (*RegisterRequest) ProtoMessage() {} -func (x *UploadInputDataRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_supernode_action_cascade_service_proto_msgTypes[0] +func (x *RegisterRequest) ProtoReflect() protoreflect.Message { + mi := &file_supernode_action_cascade_service_proto_msgTypes[0] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -57,47 +57,47 @@ func (x *UploadInputDataRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use UploadInputDataRequest.ProtoReflect.Descriptor instead. -func (*UploadInputDataRequest) Descriptor() ([]byte, []int) { - return file_proto_supernode_action_cascade_service_proto_rawDescGZIP(), []int{0} +// Deprecated: Use RegisterRequest.ProtoReflect.Descriptor instead. +func (*RegisterRequest) Descriptor() ([]byte, []int) { + return file_supernode_action_cascade_service_proto_rawDescGZIP(), []int{0} } -func (m *UploadInputDataRequest) GetRequestType() isUploadInputDataRequest_RequestType { +func (m *RegisterRequest) GetRequestType() isRegisterRequest_RequestType { if m != nil { return m.RequestType } return nil } -func (x *UploadInputDataRequest) GetChunk() *DataChunk { - if x, ok := x.GetRequestType().(*UploadInputDataRequest_Chunk); ok { +func (x *RegisterRequest) GetChunk() *DataChunk { + if x, ok := x.GetRequestType().(*RegisterRequest_Chunk); ok { return x.Chunk } return nil } -func (x *UploadInputDataRequest) GetMetadata() *Metadata { - if x, ok := x.GetRequestType().(*UploadInputDataRequest_Metadata); ok { +func (x *RegisterRequest) GetMetadata() *Metadata { + if x, ok := x.GetRequestType().(*RegisterRequest_Metadata); ok { return x.Metadata } return nil } -type isUploadInputDataRequest_RequestType interface { - isUploadInputDataRequest_RequestType() +type isRegisterRequest_RequestType interface { + isRegisterRequest_RequestType() } -type UploadInputDataRequest_Chunk struct { +type RegisterRequest_Chunk struct { Chunk *DataChunk `protobuf:"bytes,1,opt,name=chunk,proto3,oneof"` } -type UploadInputDataRequest_Metadata struct { +type RegisterRequest_Metadata struct { Metadata *Metadata `protobuf:"bytes,2,opt,name=metadata,proto3,oneof"` } -func (*UploadInputDataRequest_Chunk) isUploadInputDataRequest_RequestType() {} +func (*RegisterRequest_Chunk) isRegisterRequest_RequestType() {} -func (*UploadInputDataRequest_Metadata) isUploadInputDataRequest_RequestType() {} +func (*RegisterRequest_Metadata) isRegisterRequest_RequestType() {} type DataChunk struct { state protoimpl.MessageState @@ -109,7 +109,7 @@ type DataChunk struct { func (x *DataChunk) Reset() { *x = DataChunk{} - mi := &file_proto_supernode_action_cascade_service_proto_msgTypes[1] + mi := &file_supernode_action_cascade_service_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -121,7 +121,7 @@ func (x *DataChunk) String() string { func (*DataChunk) ProtoMessage() {} func (x *DataChunk) ProtoReflect() protoreflect.Message { - mi := &file_proto_supernode_action_cascade_service_proto_msgTypes[1] + mi := &file_supernode_action_cascade_service_proto_msgTypes[1] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -134,7 +134,7 @@ func (x *DataChunk) ProtoReflect() protoreflect.Message { // Deprecated: Use DataChunk.ProtoReflect.Descriptor instead. func (*DataChunk) Descriptor() ([]byte, []int) { - return file_proto_supernode_action_cascade_service_proto_rawDescGZIP(), []int{1} + return file_supernode_action_cascade_service_proto_rawDescGZIP(), []int{1} } func (x *DataChunk) GetData() []byte { @@ -149,16 +149,13 @@ type Metadata struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Filename string `protobuf:"bytes,1,opt,name=filename,proto3" json:"filename,omitempty"` - ActionId string `protobuf:"bytes,2,opt,name=action_id,json=actionId,proto3" json:"action_id,omitempty"` - DataHash string `protobuf:"bytes,3,opt,name=data_hash,json=dataHash,proto3" json:"data_hash,omitempty"` - RqMax int32 `protobuf:"varint,4,opt,name=rq_max,json=rqMax,proto3" json:"rq_max,omitempty"` - SignedData string `protobuf:"bytes,5,opt,name=signed_data,json=signedData,proto3" json:"signed_data,omitempty"` + TaskId string `protobuf:"bytes,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"` + ActionId string `protobuf:"bytes,2,opt,name=action_id,json=actionId,proto3" json:"action_id,omitempty"` } func (x *Metadata) Reset() { *x = Metadata{} - mi := &file_proto_supernode_action_cascade_service_proto_msgTypes[2] + mi := &file_supernode_action_cascade_service_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -170,7 +167,7 @@ func (x *Metadata) String() string { func (*Metadata) ProtoMessage() {} func (x *Metadata) ProtoReflect() protoreflect.Message { - mi := &file_proto_supernode_action_cascade_service_proto_msgTypes[2] + mi := &file_supernode_action_cascade_service_proto_msgTypes[2] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -183,12 +180,12 @@ func (x *Metadata) ProtoReflect() protoreflect.Message { // Deprecated: Use Metadata.ProtoReflect.Descriptor instead. func (*Metadata) Descriptor() ([]byte, []int) { - return file_proto_supernode_action_cascade_service_proto_rawDescGZIP(), []int{2} + return file_supernode_action_cascade_service_proto_rawDescGZIP(), []int{2} } -func (x *Metadata) GetFilename() string { +func (x *Metadata) GetTaskId() string { if x != nil { - return x.Filename + return x.TaskId } return "" } @@ -200,28 +197,7 @@ func (x *Metadata) GetActionId() string { return "" } -func (x *Metadata) GetDataHash() string { - if x != nil { - return x.DataHash - } - return "" -} - -func (x *Metadata) GetRqMax() int32 { - if x != nil { - return x.RqMax - } - return 0 -} - -func (x *Metadata) GetSignedData() string { - if x != nil { - return x.SignedData - } - return "" -} - -type UploadInputDataResponse struct { +type RegisterResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -230,21 +206,21 @@ type UploadInputDataResponse struct { Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` } -func (x *UploadInputDataResponse) Reset() { - *x = UploadInputDataResponse{} - mi := &file_proto_supernode_action_cascade_service_proto_msgTypes[3] +func (x *RegisterResponse) Reset() { + *x = RegisterResponse{} + mi := &file_supernode_action_cascade_service_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *UploadInputDataResponse) String() string { +func (x *RegisterResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*UploadInputDataResponse) ProtoMessage() {} +func (*RegisterResponse) ProtoMessage() {} -func (x *UploadInputDataResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_supernode_action_cascade_service_proto_msgTypes[3] +func (x *RegisterResponse) ProtoReflect() protoreflect.Message { + mi := &file_supernode_action_cascade_service_proto_msgTypes[3] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -255,94 +231,86 @@ func (x *UploadInputDataResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use UploadInputDataResponse.ProtoReflect.Descriptor instead. -func (*UploadInputDataResponse) Descriptor() ([]byte, []int) { - return file_proto_supernode_action_cascade_service_proto_rawDescGZIP(), []int{3} +// Deprecated: Use RegisterResponse.ProtoReflect.Descriptor instead. +func (*RegisterResponse) Descriptor() ([]byte, []int) { + return file_supernode_action_cascade_service_proto_rawDescGZIP(), []int{3} } -func (x *UploadInputDataResponse) GetSuccess() bool { +func (x *RegisterResponse) GetSuccess() bool { if x != nil { return x.Success } return false } -func (x *UploadInputDataResponse) GetMessage() string { +func (x *RegisterResponse) GetMessage() string { if x != nil { return x.Message } return "" } -var File_proto_supernode_action_cascade_service_proto protoreflect.FileDescriptor - -var file_proto_supernode_action_cascade_service_proto_rawDesc = []byte{ - 0x0a, 0x2c, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x73, 0x75, 0x70, 0x65, 0x72, 0x6e, 0x6f, 0x64, - 0x65, 0x2f, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x63, 0x61, 0x73, 0x63, 0x61, 0x64, 0x65, - 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07, - 0x63, 0x61, 0x73, 0x63, 0x61, 0x64, 0x65, 0x22, 0x85, 0x01, 0x0a, 0x16, 0x55, 0x70, 0x6c, 0x6f, - 0x61, 0x64, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x05, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x12, 0x2e, 0x63, 0x61, 0x73, 0x63, 0x61, 0x64, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x61, - 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x48, 0x00, 0x52, 0x05, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x12, 0x2f, - 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x11, 0x2e, 0x63, 0x61, 0x73, 0x63, 0x61, 0x64, 0x65, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x42, - 0x0e, 0x0a, 0x0c, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x22, - 0x1f, 0x0a, 0x09, 0x44, 0x61, 0x74, 0x61, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x12, 0x12, 0x0a, 0x04, - 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, - 0x22, 0x98, 0x01, 0x0a, 0x08, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1a, 0x0a, - 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x68, - 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x61, 0x74, 0x61, 0x48, - 0x61, 0x73, 0x68, 0x12, 0x15, 0x0a, 0x06, 0x72, 0x71, 0x5f, 0x6d, 0x61, 0x78, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x05, 0x72, 0x71, 0x4d, 0x61, 0x78, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x69, - 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0a, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x22, 0x4d, 0x0a, 0x17, 0x55, - 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, - 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, - 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x32, 0x68, 0x0a, 0x0e, 0x43, 0x61, - 0x73, 0x63, 0x61, 0x64, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x56, 0x0a, 0x0f, - 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x44, 0x61, 0x74, 0x61, 0x12, - 0x1f, 0x2e, 0x63, 0x61, 0x73, 0x63, 0x61, 0x64, 0x65, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, - 0x49, 0x6e, 0x70, 0x75, 0x74, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x20, 0x2e, 0x63, 0x61, 0x73, 0x63, 0x61, 0x64, 0x65, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, - 0x64, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x28, 0x01, 0x42, 0x42, 0x5a, 0x40, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x4c, 0x75, 0x6d, 0x65, 0x72, 0x61, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, - 0x6c, 0x2f, 0x73, 0x75, 0x70, 0x65, 0x72, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x67, 0x65, 0x6e, 0x2f, - 0x73, 0x75, 0x70, 0x65, 0x72, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x2f, 0x63, 0x61, 0x73, 0x63, 0x61, 0x64, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +var File_supernode_action_cascade_service_proto protoreflect.FileDescriptor + +var file_supernode_action_cascade_service_proto_rawDesc = []byte{ + 0x0a, 0x26, 0x73, 0x75, 0x70, 0x65, 0x72, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x2f, 0x63, 0x61, 0x73, 0x63, 0x61, 0x64, 0x65, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07, 0x63, 0x61, 0x73, 0x63, 0x61, 0x64, + 0x65, 0x22, 0x7e, 0x0a, 0x0f, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x05, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x63, 0x61, 0x73, 0x63, 0x61, 0x64, 0x65, 0x2e, 0x44, 0x61, + 0x74, 0x61, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x48, 0x00, 0x52, 0x05, 0x63, 0x68, 0x75, 0x6e, 0x6b, + 0x12, 0x2f, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x63, 0x61, 0x73, 0x63, 0x61, 0x64, 0x65, 0x2e, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x42, 0x0e, 0x0a, 0x0c, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x74, 0x79, 0x70, + 0x65, 0x22, 0x1f, 0x0a, 0x09, 0x44, 0x61, 0x74, 0x61, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x12, 0x12, + 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, + 0x74, 0x61, 0x22, 0x40, 0x0a, 0x08, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x17, + 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x46, 0x0a, 0x10, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, + 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, + 0x73, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x32, 0x53, 0x0a, 0x0e, + 0x43, 0x61, 0x73, 0x63, 0x61, 0x64, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x41, + 0x0a, 0x08, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x18, 0x2e, 0x63, 0x61, 0x73, + 0x63, 0x61, 0x64, 0x65, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x63, 0x61, 0x73, 0x63, 0x61, 0x64, 0x65, 0x2e, 0x52, + 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, + 0x01, 0x42, 0x42, 0x5a, 0x40, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x4c, 0x75, 0x6d, 0x65, 0x72, 0x61, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x73, + 0x75, 0x70, 0x65, 0x72, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x73, 0x75, 0x70, + 0x65, 0x72, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x63, 0x61, + 0x73, 0x63, 0x61, 0x64, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - file_proto_supernode_action_cascade_service_proto_rawDescOnce sync.Once - file_proto_supernode_action_cascade_service_proto_rawDescData = file_proto_supernode_action_cascade_service_proto_rawDesc + file_supernode_action_cascade_service_proto_rawDescOnce sync.Once + file_supernode_action_cascade_service_proto_rawDescData = file_supernode_action_cascade_service_proto_rawDesc ) -func file_proto_supernode_action_cascade_service_proto_rawDescGZIP() []byte { - file_proto_supernode_action_cascade_service_proto_rawDescOnce.Do(func() { - file_proto_supernode_action_cascade_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_supernode_action_cascade_service_proto_rawDescData) +func file_supernode_action_cascade_service_proto_rawDescGZIP() []byte { + file_supernode_action_cascade_service_proto_rawDescOnce.Do(func() { + file_supernode_action_cascade_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_supernode_action_cascade_service_proto_rawDescData) }) - return file_proto_supernode_action_cascade_service_proto_rawDescData + return file_supernode_action_cascade_service_proto_rawDescData } -var file_proto_supernode_action_cascade_service_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_proto_supernode_action_cascade_service_proto_goTypes = []any{ - (*UploadInputDataRequest)(nil), // 0: cascade.UploadInputDataRequest - (*DataChunk)(nil), // 1: cascade.DataChunk - (*Metadata)(nil), // 2: cascade.Metadata - (*UploadInputDataResponse)(nil), // 3: cascade.UploadInputDataResponse +var file_supernode_action_cascade_service_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_supernode_action_cascade_service_proto_goTypes = []any{ + (*RegisterRequest)(nil), // 0: cascade.RegisterRequest + (*DataChunk)(nil), // 1: cascade.DataChunk + (*Metadata)(nil), // 2: cascade.Metadata + (*RegisterResponse)(nil), // 3: cascade.RegisterResponse } -var file_proto_supernode_action_cascade_service_proto_depIdxs = []int32{ - 1, // 0: cascade.UploadInputDataRequest.chunk:type_name -> cascade.DataChunk - 2, // 1: cascade.UploadInputDataRequest.metadata:type_name -> cascade.Metadata - 0, // 2: cascade.CascadeService.UploadInputData:input_type -> cascade.UploadInputDataRequest - 3, // 3: cascade.CascadeService.UploadInputData:output_type -> cascade.UploadInputDataResponse +var file_supernode_action_cascade_service_proto_depIdxs = []int32{ + 1, // 0: cascade.RegisterRequest.chunk:type_name -> cascade.DataChunk + 2, // 1: cascade.RegisterRequest.metadata:type_name -> cascade.Metadata + 0, // 2: cascade.CascadeService.Register:input_type -> cascade.RegisterRequest + 3, // 3: cascade.CascadeService.Register:output_type -> cascade.RegisterResponse 3, // [3:4] is the sub-list for method output_type 2, // [2:3] is the sub-list for method input_type 2, // [2:2] is the sub-list for extension type_name @@ -350,31 +318,31 @@ var file_proto_supernode_action_cascade_service_proto_depIdxs = []int32{ 0, // [0:2] is the sub-list for field type_name } -func init() { file_proto_supernode_action_cascade_service_proto_init() } -func file_proto_supernode_action_cascade_service_proto_init() { - if File_proto_supernode_action_cascade_service_proto != nil { +func init() { file_supernode_action_cascade_service_proto_init() } +func file_supernode_action_cascade_service_proto_init() { + if File_supernode_action_cascade_service_proto != nil { return } - file_proto_supernode_action_cascade_service_proto_msgTypes[0].OneofWrappers = []any{ - (*UploadInputDataRequest_Chunk)(nil), - (*UploadInputDataRequest_Metadata)(nil), + file_supernode_action_cascade_service_proto_msgTypes[0].OneofWrappers = []any{ + (*RegisterRequest_Chunk)(nil), + (*RegisterRequest_Metadata)(nil), } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_proto_supernode_action_cascade_service_proto_rawDesc, + RawDescriptor: file_supernode_action_cascade_service_proto_rawDesc, NumEnums: 0, NumMessages: 4, NumExtensions: 0, NumServices: 1, }, - GoTypes: file_proto_supernode_action_cascade_service_proto_goTypes, - DependencyIndexes: file_proto_supernode_action_cascade_service_proto_depIdxs, - MessageInfos: file_proto_supernode_action_cascade_service_proto_msgTypes, + GoTypes: file_supernode_action_cascade_service_proto_goTypes, + DependencyIndexes: file_supernode_action_cascade_service_proto_depIdxs, + MessageInfos: file_supernode_action_cascade_service_proto_msgTypes, }.Build() - File_proto_supernode_action_cascade_service_proto = out.File - file_proto_supernode_action_cascade_service_proto_rawDesc = nil - file_proto_supernode_action_cascade_service_proto_goTypes = nil - file_proto_supernode_action_cascade_service_proto_depIdxs = nil + File_supernode_action_cascade_service_proto = out.File + file_supernode_action_cascade_service_proto_rawDesc = nil + file_supernode_action_cascade_service_proto_goTypes = nil + file_supernode_action_cascade_service_proto_depIdxs = nil } diff --git a/gen/supernode/action/cascade/service_grpc.pb.go b/gen/supernode/action/cascade/service_grpc.pb.go index db6f86fd..cd23a36e 100644 --- a/gen/supernode/action/cascade/service_grpc.pb.go +++ b/gen/supernode/action/cascade/service_grpc.pb.go @@ -1,8 +1,8 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.5.1 -// - protoc v3.21.12 -// source: proto/supernode/action/cascade/service.proto +// - protoc v3.12.4 +// source: supernode/action/cascade/service.proto package cascade @@ -19,14 +19,14 @@ import ( const _ = grpc.SupportPackageIsVersion9 const ( - CascadeService_UploadInputData_FullMethodName = "/cascade.CascadeService/UploadInputData" + CascadeService_Register_FullMethodName = "/cascade.CascadeService/Register" ) // CascadeServiceClient is the client API for CascadeService service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type CascadeServiceClient interface { - UploadInputData(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[UploadInputDataRequest, UploadInputDataResponse], error) + Register(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[RegisterRequest, RegisterResponse], error) } type cascadeServiceClient struct { @@ -37,24 +37,24 @@ func NewCascadeServiceClient(cc grpc.ClientConnInterface) CascadeServiceClient { return &cascadeServiceClient{cc} } -func (c *cascadeServiceClient) UploadInputData(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[UploadInputDataRequest, UploadInputDataResponse], error) { +func (c *cascadeServiceClient) Register(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[RegisterRequest, RegisterResponse], error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - stream, err := c.cc.NewStream(ctx, &CascadeService_ServiceDesc.Streams[0], CascadeService_UploadInputData_FullMethodName, cOpts...) + stream, err := c.cc.NewStream(ctx, &CascadeService_ServiceDesc.Streams[0], CascadeService_Register_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &grpc.GenericClientStream[UploadInputDataRequest, UploadInputDataResponse]{ClientStream: stream} + x := &grpc.GenericClientStream[RegisterRequest, RegisterResponse]{ClientStream: stream} return x, nil } // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. -type CascadeService_UploadInputDataClient = grpc.ClientStreamingClient[UploadInputDataRequest, UploadInputDataResponse] +type CascadeService_RegisterClient = grpc.ClientStreamingClient[RegisterRequest, RegisterResponse] // CascadeServiceServer is the server API for CascadeService service. // All implementations must embed UnimplementedCascadeServiceServer // for forward compatibility. type CascadeServiceServer interface { - UploadInputData(grpc.ClientStreamingServer[UploadInputDataRequest, UploadInputDataResponse]) error + Register(grpc.ClientStreamingServer[RegisterRequest, RegisterResponse]) error mustEmbedUnimplementedCascadeServiceServer() } @@ -65,8 +65,8 @@ type CascadeServiceServer interface { // pointer dereference when methods are called. type UnimplementedCascadeServiceServer struct{} -func (UnimplementedCascadeServiceServer) UploadInputData(grpc.ClientStreamingServer[UploadInputDataRequest, UploadInputDataResponse]) error { - return status.Errorf(codes.Unimplemented, "method UploadInputData not implemented") +func (UnimplementedCascadeServiceServer) Register(grpc.ClientStreamingServer[RegisterRequest, RegisterResponse]) error { + return status.Errorf(codes.Unimplemented, "method Register not implemented") } func (UnimplementedCascadeServiceServer) mustEmbedUnimplementedCascadeServiceServer() {} func (UnimplementedCascadeServiceServer) testEmbeddedByValue() {} @@ -89,12 +89,12 @@ func RegisterCascadeServiceServer(s grpc.ServiceRegistrar, srv CascadeServiceSer s.RegisterService(&CascadeService_ServiceDesc, srv) } -func _CascadeService_UploadInputData_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(CascadeServiceServer).UploadInputData(&grpc.GenericServerStream[UploadInputDataRequest, UploadInputDataResponse]{ServerStream: stream}) +func _CascadeService_Register_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(CascadeServiceServer).Register(&grpc.GenericServerStream[RegisterRequest, RegisterResponse]{ServerStream: stream}) } // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. -type CascadeService_UploadInputDataServer = grpc.ClientStreamingServer[UploadInputDataRequest, UploadInputDataResponse] +type CascadeService_RegisterServer = grpc.ClientStreamingServer[RegisterRequest, RegisterResponse] // CascadeService_ServiceDesc is the grpc.ServiceDesc for CascadeService service. // It's only intended for direct use with grpc.RegisterService, @@ -105,10 +105,10 @@ var CascadeService_ServiceDesc = grpc.ServiceDesc{ Methods: []grpc.MethodDesc{}, Streams: []grpc.StreamDesc{ { - StreamName: "UploadInputData", - Handler: _CascadeService_UploadInputData_Handler, + StreamName: "Register", + Handler: _CascadeService_Register_Handler, ClientStreams: true, }, }, - Metadata: "proto/supernode/action/cascade/service.proto", + Metadata: "supernode/action/cascade/service.proto", } diff --git a/proto/supernode/action/cascade/service.proto b/proto/supernode/action/cascade/service.proto index 3449fa56..3987231a 100644 --- a/proto/supernode/action/cascade/service.proto +++ b/proto/supernode/action/cascade/service.proto @@ -2,11 +2,11 @@ syntax = "proto3"; package cascade; option go_package = "github.com/LumeraProtocol/supernode/gen/supernode/action/cascade"; -service CascadeService { - rpc UploadInputData (stream UploadInputDataRequest) returns (UploadInputDataResponse); +service CascadeService { + rpc Register (stream RegisterRequest) returns (RegisterResponse); } -message UploadInputDataRequest { +message RegisterRequest { oneof request_type { DataChunk chunk = 1; Metadata metadata = 2; @@ -18,14 +18,11 @@ message DataChunk { } message Metadata { - string filename = 1; + string task_id = 1; string action_id = 2; - string data_hash = 3; - int32 rq_max = 4; - string signed_data = 5; } -message UploadInputDataResponse { +message RegisterResponse { bool success = 1; string message = 2; } \ No newline at end of file diff --git a/supernode/node/action/server/cascade/cascade_action_server.go b/supernode/node/action/server/cascade/cascade_action_server.go index 397866f4..542e2335 100644 --- a/supernode/node/action/server/cascade/cascade_action_server.go +++ b/supernode/node/action/server/cascade/cascade_action_server.go @@ -24,9 +24,9 @@ func NewCascadeActionServer(service *cascadeService.CascadeService) *CascadeActi func (server *CascadeActionServer) Desc() *grpc.ServiceDesc { return &pb.CascadeService_ServiceDesc } -func (server *CascadeActionServer) UploadInputData(stream pb.CascadeService_UploadInputDataServer) error { +func (server *CascadeActionServer) Register(stream pb.CascadeService_RegisterServer) error { fields := logtrace.Fields{ - logtrace.FieldMethod: "UploadInputData", + logtrace.FieldMethod: "Register", logtrace.FieldModule: "CascadeActionServer", } @@ -52,7 +52,7 @@ func (server *CascadeActionServer) UploadInputData(stream pb.CascadeService_Uplo // Check which type of message we received switch x := req.RequestType.(type) { - case *pb.UploadInputDataRequest_Chunk: + case *pb.RegisterRequest_Chunk: // Add data chunk to our collection allData = append(allData, x.Chunk.Data...) logtrace.Info(ctx, "received data chunk", logtrace.Fields{ @@ -60,13 +60,12 @@ func (server *CascadeActionServer) UploadInputData(stream pb.CascadeService_Uplo "total_size_so_far": len(allData), }) - case *pb.UploadInputDataRequest_Metadata: + case *pb.RegisterRequest_Metadata: // Store metadata - this should be the final message metadata = x.Metadata logtrace.Info(ctx, "received metadata", logtrace.Fields{ - "filename": metadata.Filename, + "task_id": metadata.TaskId, "action_id": metadata.ActionId, - "data_hash": metadata.DataHash, }) } } @@ -79,7 +78,8 @@ func (server *CascadeActionServer) UploadInputData(stream pb.CascadeService_Uplo // Process the complete data task := server.service.NewCascadeRegistrationTask() - res, err := task.UploadInputData(ctx, &cascadeService.UploadInputDataRequest{ + res, err := task.Register(ctx, &cascadeService.RegisterRequest{ + TaskID: metadata.TaskId, ActionID: metadata.ActionId, Data: allData, }) @@ -91,7 +91,7 @@ func (server *CascadeActionServer) UploadInputData(stream pb.CascadeService_Uplo } // Send the response - return stream.SendMsg(&pb.UploadInputDataResponse{ + return stream.SendMsg(&pb.RegisterResponse{ Success: res.Success, Message: res.Message, }) diff --git a/supernode/services/cascade/metadata.go b/supernode/services/cascade/metadata.go index 1ddb74a9..18e99d9f 100644 --- a/supernode/services/cascade/metadata.go +++ b/supernode/services/cascade/metadata.go @@ -31,8 +31,6 @@ type GenRQIdentifiersFilesResponse struct { RQIDs []string // RedundantMetadataFiles is a list of redundant files that are generated from the Metadata file RedundantMetadataFiles [][]byte - // Compressed[B64(JSON(layout)).Signature] - B64EncodedMetadataFileWithSignatureCompressed []byte } // GenRQIdentifiersFiles generates Redundant Metadata Files and IDs @@ -51,13 +49,14 @@ func GenRQIdentifiersFiles(ctx context.Context, req GenRQIdentifiersFilesRequest encMetadataFileWithSignature := buffer.Bytes() // Generate the specified number of variant IDs - _, RQIDsFiles, err := GetIDFiles(ctx, encMetadataFileWithSignature, req.IC, req.RqMax) + rqIdIds, rqIDsFiles, err := GetIDFiles(ctx, encMetadataFileWithSignature, req.IC, req.RqMax) if err != nil { return resp, errors.Errorf("get ID Files: %w", err) } return GenRQIdentifiersFilesResponse{ - RedundantMetadataFiles: RQIDsFiles, + RedundantMetadataFiles: rqIDsFiles, + RQIDs: rqIdIds, }, nil } diff --git a/supernode/services/cascade/register.go b/supernode/services/cascade/register.go index 35bd3f0a..d6dc6917 100644 --- a/supernode/services/cascade/register.go +++ b/supernode/services/cascade/register.go @@ -20,22 +20,23 @@ import ( "google.golang.org/grpc/status" ) -// UploadInputDataRequest contains parameters for upload request -type UploadInputDataRequest struct { +// RegisterRequest contains parameters for upload request +type RegisterRequest struct { + TaskID string ActionID string Data []byte } -// UploadInputDataResponse contains the result of upload -type UploadInputDataResponse struct { +// RegisterResponse contains the result of upload +type RegisterResponse struct { Success bool Message string } -// UploadInputData processes the upload request for cascade input data -func (task *CascadeRegistrationTask) UploadInputData(ctx context.Context, req *UploadInputDataRequest) (*UploadInputDataResponse, error) { +// Register processes the upload request for cascade input data +func (task *CascadeRegistrationTask) Register(ctx context.Context, req *RegisterRequest) (*RegisterResponse, error) { fields := logtrace.Fields{ - logtrace.FieldMethod: "UploadInputData", + logtrace.FieldMethod: "Register", logtrace.FieldRequest: req, } @@ -163,7 +164,7 @@ func (task *CascadeRegistrationTask) UploadInputData(ctx context.Context, req *U } logtrace.Info(ctx, "raptor-q symbols have been stored", fields) - return &UploadInputDataResponse{ + return &RegisterResponse{ Success: true, Message: "successfully uploaded input data", }, nil