From f9b306abc790c1fff6f75199d0701eb77685253d Mon Sep 17 00:00:00 2001 From: Sergey Cherepanov Date: Sun, 26 Mar 2023 14:54:27 +0200 Subject: [PATCH] node configuration command proto --- .../coordinatorproto/coordinator.pb.go | 982 +++++++++++++++--- .../coordinatorproto/coordinator_drpc.pb.go | 42 +- .../coordinatorproto/protos/coordinator.proto | 34 + 3 files changed, 899 insertions(+), 159 deletions(-) diff --git a/coordinator/coordinatorproto/coordinator.pb.go b/coordinator/coordinatorproto/coordinator.pb.go index ef911967..1bdbe25d 100644 --- a/coordinator/coordinatorproto/coordinator.pb.go +++ b/coordinator/coordinatorproto/coordinator.pb.go @@ -90,15 +90,41 @@ func (SpaceStatus) EnumDescriptor() ([]byte, []int) { return fileDescriptor_d94f6f99586adae2, []int{1} } +// NodeType determines the type of API that a node supports +type NodeType int32 + +const ( + // TreeAPI supports space/tree sync api + NodeType_TreeAPI NodeType = 0 + // FileAPI support file api + NodeType_FileAPI NodeType = 1 + // CoordinatorAPI supports coordinator api + NodeType_CoordinatorAPI NodeType = 2 +) + +var NodeType_name = map[int32]string{ + 0: "TreeAPI", + 1: "FileAPI", + 2: "CoordinatorAPI", +} + +var NodeType_value = map[string]int32{ + "TreeAPI": 0, + "FileAPI": 1, + "CoordinatorAPI": 2, +} + +func (x NodeType) String() string { + return proto.EnumName(NodeType_name, int32(x)) +} + +func (NodeType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_d94f6f99586adae2, []int{2} +} + type SpaceSignRequest struct { - // SpaceId is the id of the signed space SpaceId string `protobuf:"bytes,1,opt,name=spaceId,proto3" json:"spaceId,omitempty"` - // Header is the header of the signed space - Header []byte `protobuf:"bytes,2,opt,name=header,proto3" json:"header,omitempty"` - // OldIdentity is the old identity of the space owner - OldIdentity []byte `protobuf:"bytes,3,opt,name=oldIdentity,proto3" json:"oldIdentity,omitempty"` - // NewIdentitySignature is the new identity signed by the old one - NewIdentitySignature []byte `protobuf:"bytes,4,opt,name=newIdentitySignature,proto3" json:"newIdentitySignature,omitempty"` + Header []byte `protobuf:"bytes,2,opt,name=header,proto3" json:"header,omitempty"` } func (m *SpaceSignRequest) Reset() { *m = SpaceSignRequest{} } @@ -148,20 +174,6 @@ func (m *SpaceSignRequest) GetHeader() []byte { return nil } -func (m *SpaceSignRequest) GetOldIdentity() []byte { - if m != nil { - return m.OldIdentity - } - return nil -} - -func (m *SpaceSignRequest) GetNewIdentitySignature() []byte { - if m != nil { - return m.NewIdentitySignature - } - return nil -} - type SpaceStatusPayload struct { Status SpaceStatus `protobuf:"varint,1,opt,name=status,proto3,enum=coordinator.SpaceStatus" json:"status,omitempty"` DeletionTimestamp int64 `protobuf:"varint,2,opt,name=deletionTimestamp,proto3" json:"deletionTimestamp,omitempty"` @@ -688,9 +700,172 @@ func (m *SpaceStatusChangeResponse) GetPayload() *SpaceStatusPayload { return nil } +// NetworkConfigurationRequest contains the requested configurationId, it can be empty to request the latest version +type NetworkConfigurationRequest struct { + ConfigurationId string `protobuf:"bytes,1,opt,name=configurationId,proto3" json:"configurationId,omitempty"` +} + +func (m *NetworkConfigurationRequest) Reset() { *m = NetworkConfigurationRequest{} } +func (m *NetworkConfigurationRequest) String() string { return proto.CompactTextString(m) } +func (*NetworkConfigurationRequest) ProtoMessage() {} +func (*NetworkConfigurationRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_d94f6f99586adae2, []int{11} +} +func (m *NetworkConfigurationRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *NetworkConfigurationRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_NetworkConfigurationRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *NetworkConfigurationRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_NetworkConfigurationRequest.Merge(m, src) +} +func (m *NetworkConfigurationRequest) XXX_Size() int { + return m.Size() +} +func (m *NetworkConfigurationRequest) XXX_DiscardUnknown() { + xxx_messageInfo_NetworkConfigurationRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_NetworkConfigurationRequest proto.InternalMessageInfo + +func (m *NetworkConfigurationRequest) GetConfigurationId() string { + if m != nil { + return m.ConfigurationId + } + return "" +} + +// NetworkConfigurationResponse contains list of nodes +type NetworkConfigurationResponse struct { + ConfigurationId string `protobuf:"bytes,1,opt,name=configurationId,proto3" json:"configurationId,omitempty"` + Nodes []*Node `protobuf:"bytes,2,rep,name=nodes,proto3" json:"nodes,omitempty"` +} + +func (m *NetworkConfigurationResponse) Reset() { *m = NetworkConfigurationResponse{} } +func (m *NetworkConfigurationResponse) String() string { return proto.CompactTextString(m) } +func (*NetworkConfigurationResponse) ProtoMessage() {} +func (*NetworkConfigurationResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_d94f6f99586adae2, []int{12} +} +func (m *NetworkConfigurationResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *NetworkConfigurationResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_NetworkConfigurationResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *NetworkConfigurationResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_NetworkConfigurationResponse.Merge(m, src) +} +func (m *NetworkConfigurationResponse) XXX_Size() int { + return m.Size() +} +func (m *NetworkConfigurationResponse) XXX_DiscardUnknown() { + xxx_messageInfo_NetworkConfigurationResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_NetworkConfigurationResponse proto.InternalMessageInfo + +func (m *NetworkConfigurationResponse) GetConfigurationId() string { + if m != nil { + return m.ConfigurationId + } + return "" +} + +func (m *NetworkConfigurationResponse) GetNodes() []*Node { + if m != nil { + return m.Nodes + } + return nil +} + +// Node describes one node in the network +type Node struct { + // peerId - it's a peer identifier (libp2p format string) so it's an encoded publicKey + PeerId string `protobuf:"bytes,1,opt,name=peerId,proto3" json:"peerId,omitempty"` + // list of node addresses + Addresses []string `protobuf:"bytes,2,rep,name=addresses,proto3" json:"addresses,omitempty"` + // list of supported APIs + Types []NodeType `protobuf:"varint,3,rep,packed,name=types,proto3,enum=coordinator.NodeType" json:"types,omitempty"` +} + +func (m *Node) Reset() { *m = Node{} } +func (m *Node) String() string { return proto.CompactTextString(m) } +func (*Node) ProtoMessage() {} +func (*Node) Descriptor() ([]byte, []int) { + return fileDescriptor_d94f6f99586adae2, []int{13} +} +func (m *Node) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Node) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Node.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Node) XXX_Merge(src proto.Message) { + xxx_messageInfo_Node.Merge(m, src) +} +func (m *Node) XXX_Size() int { + return m.Size() +} +func (m *Node) XXX_DiscardUnknown() { + xxx_messageInfo_Node.DiscardUnknown(m) +} + +var xxx_messageInfo_Node proto.InternalMessageInfo + +func (m *Node) GetPeerId() string { + if m != nil { + return m.PeerId + } + return "" +} + +func (m *Node) GetAddresses() []string { + if m != nil { + return m.Addresses + } + return nil +} + +func (m *Node) GetTypes() []NodeType { + if m != nil { + return m.Types + } + return nil +} + func init() { proto.RegisterEnum("coordinator.ErrorCodes", ErrorCodes_name, ErrorCodes_value) proto.RegisterEnum("coordinator.SpaceStatus", SpaceStatus_name, SpaceStatus_value) + proto.RegisterEnum("coordinator.NodeType", NodeType_name, NodeType_value) proto.RegisterType((*SpaceSignRequest)(nil), "coordinator.SpaceSignRequest") proto.RegisterType((*SpaceStatusPayload)(nil), "coordinator.SpaceStatusPayload") proto.RegisterType((*SpaceSignResponse)(nil), "coordinator.SpaceSignResponse") @@ -702,6 +877,9 @@ func init() { proto.RegisterType((*SpaceStatusCheckResponse)(nil), "coordinator.SpaceStatusCheckResponse") proto.RegisterType((*SpaceStatusChangeRequest)(nil), "coordinator.SpaceStatusChangeRequest") proto.RegisterType((*SpaceStatusChangeResponse)(nil), "coordinator.SpaceStatusChangeResponse") + proto.RegisterType((*NetworkConfigurationRequest)(nil), "coordinator.NetworkConfigurationRequest") + proto.RegisterType((*NetworkConfigurationResponse)(nil), "coordinator.NetworkConfigurationResponse") + proto.RegisterType((*Node)(nil), "coordinator.Node") } func init() { @@ -709,53 +887,61 @@ func init() { } var fileDescriptor_d94f6f99586adae2 = []byte{ - // 728 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0xcf, 0x4e, 0x13, 0x41, - 0x18, 0xef, 0xb6, 0x05, 0xd2, 0xaf, 0xa4, 0x2e, 0x23, 0xe0, 0xda, 0xe0, 0xda, 0xac, 0x4a, 0x1a, - 0x62, 0x80, 0x14, 0x35, 0xf1, 0x66, 0xac, 0x98, 0x60, 0x0c, 0x92, 0xc5, 0x6a, 0xd4, 0x83, 0x59, - 0x76, 0x3f, 0x60, 0xc2, 0xb2, 0xb3, 0xee, 0x4c, 0x15, 0x0e, 0x26, 0x3e, 0x82, 0x27, 0x0f, 0x3e, - 0x83, 0x8f, 0xe0, 0x03, 0x78, 0xe4, 0xe8, 0xd1, 0xc0, 0x53, 0x78, 0x33, 0x9d, 0xdd, 0x6d, 0x67, - 0xdb, 0x6d, 0x39, 0x78, 0x81, 0xce, 0xef, 0xfb, 0x7d, 0x7f, 0x7f, 0xdf, 0xcc, 0xc2, 0x7d, 0x97, - 0xb1, 0xc8, 0xa3, 0x81, 0x23, 0x58, 0xb4, 0xa6, 0xfc, 0x0e, 0x23, 0x26, 0xd8, 0x9a, 0xfc, 0xcb, - 0x55, 0x7c, 0x55, 0x42, 0xa4, 0xaa, 0x40, 0xd6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, 0x8d, 0x23, 0x13, 0x7c, - 0x95, 0x9b, 0x52, 0x5f, 0xbe, 0x8c, 0x16, 0xe7, 0x78, 0xfc, 0xe0, 0xd7, 0xb9, 0xa9, 0x9d, 0x9d, - 0x9b, 0xda, 0x9f, 0x73, 0x53, 0xfb, 0x7a, 0x61, 0x16, 0xce, 0x2e, 0xcc, 0xc2, 0xef, 0x0b, 0xb3, - 0xf0, 0x76, 0x69, 0xd2, 0xb7, 0x77, 0x6f, 0x5a, 0xfe, 0xdb, 0xf8, 0x17, 0x00, 0x00, 0xff, 0xff, - 0x86, 0x2f, 0x30, 0xee, 0xa2, 0x07, 0x00, 0x00, + // 856 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0xdd, 0x6e, 0xe3, 0x44, + 0x14, 0x8e, 0xe3, 0xb4, 0x25, 0xc7, 0x55, 0x70, 0x87, 0xb6, 0x98, 0x50, 0x4c, 0x64, 0x60, 0x09, + 0x05, 0x75, 0x57, 0x59, 0x40, 0x70, 0x07, 0x64, 0x17, 0x54, 0x84, 0x4a, 0xe5, 0xb6, 0x20, 0xe0, + 0x02, 0x79, 0xed, 0xd3, 0x76, 0xd4, 0xd4, 0xe3, 0x9d, 0x99, 0xc0, 0xf6, 0x02, 0x89, 0x47, 0xe0, + 0x8a, 0xa7, 0xe0, 0x11, 0x78, 0x00, 0x2e, 0xf7, 0x92, 0x4b, 0xd4, 0x4a, 0x3c, 0x07, 0x1a, 0x7b, + 0x9c, 0x8c, 0x13, 0x27, 0xad, 0xc4, 0x4d, 0xdb, 0xf3, 0x9d, 0x9f, 0xef, 0x9c, 0x39, 0x3f, 0x2e, + 0x7c, 0x10, 0x33, 0xc6, 0x13, 0x9a, 0x46, 0x92, 0xf1, 0xfb, 0xc6, 0xdf, 0x19, 0x67, 0x92, 0xdd, + 0xcf, 0x7f, 0x0a, 0x13, 0xdf, 0xcb, 0x21, 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 0xff, + 0x69, 0x34, 0x32, 0xd9, 0x19, 0x09, 0x00, 0x00, } func (m *SpaceSignRequest) Marshal() (dAtA []byte, err error) { @@ -778,20 +964,6 @@ func (m *SpaceSignRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.NewIdentitySignature) > 0 { - i -= len(m.NewIdentitySignature) - copy(dAtA[i:], m.NewIdentitySignature) - i = encodeVarintCoordinator(dAtA, i, uint64(len(m.NewIdentitySignature))) - i-- - dAtA[i] = 0x22 - } - if len(m.OldIdentity) > 0 { - i -= len(m.OldIdentity) - copy(dAtA[i:], m.OldIdentity) - i = encodeVarintCoordinator(dAtA, i, uint64(len(m.OldIdentity))) - i-- - dAtA[i] = 0x1a - } if len(m.Header) > 0 { i -= len(m.Header) copy(dAtA[i:], m.Header) @@ -1179,6 +1351,137 @@ func (m *SpaceStatusChangeResponse) MarshalToSizedBuffer(dAtA []byte) (int, erro return len(dAtA) - i, nil } +func (m *NetworkConfigurationRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *NetworkConfigurationRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NetworkConfigurationRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ConfigurationId) > 0 { + i -= len(m.ConfigurationId) + copy(dAtA[i:], m.ConfigurationId) + i = encodeVarintCoordinator(dAtA, i, uint64(len(m.ConfigurationId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *NetworkConfigurationResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *NetworkConfigurationResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NetworkConfigurationResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Nodes) > 0 { + for iNdEx := len(m.Nodes) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Nodes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCoordinator(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.ConfigurationId) > 0 { + i -= len(m.ConfigurationId) + copy(dAtA[i:], m.ConfigurationId) + i = encodeVarintCoordinator(dAtA, i, uint64(len(m.ConfigurationId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Node) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Node) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Node) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Types) > 0 { + dAtA5 := make([]byte, len(m.Types)*10) + var j4 int + for _, num := range m.Types { + for num >= 1<<7 { + dAtA5[j4] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j4++ + } + dAtA5[j4] = uint8(num) + j4++ + } + i -= j4 + copy(dAtA[i:], dAtA5[:j4]) + i = encodeVarintCoordinator(dAtA, i, uint64(j4)) + i-- + dAtA[i] = 0x1a + } + if len(m.Addresses) > 0 { + for iNdEx := len(m.Addresses) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Addresses[iNdEx]) + copy(dAtA[i:], m.Addresses[iNdEx]) + i = encodeVarintCoordinator(dAtA, i, uint64(len(m.Addresses[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.PeerId) > 0 { + i -= len(m.PeerId) + copy(dAtA[i:], m.PeerId) + i = encodeVarintCoordinator(dAtA, i, uint64(len(m.PeerId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintCoordinator(dAtA []byte, offset int, v uint64) int { offset -= sovCoordinator(v) base := offset @@ -1204,14 +1507,6 @@ func (m *SpaceSignRequest) Size() (n int) { if l > 0 { n += 1 + l + sovCoordinator(uint64(l)) } - l = len(m.OldIdentity) - if l > 0 { - n += 1 + l + sovCoordinator(uint64(l)) - } - l = len(m.NewIdentitySignature) - if l > 0 { - n += 1 + l + sovCoordinator(uint64(l)) - } return n } @@ -1377,6 +1672,64 @@ func (m *SpaceStatusChangeResponse) Size() (n int) { return n } +func (m *NetworkConfigurationRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ConfigurationId) + if l > 0 { + n += 1 + l + sovCoordinator(uint64(l)) + } + return n +} + +func (m *NetworkConfigurationResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ConfigurationId) + if l > 0 { + n += 1 + l + sovCoordinator(uint64(l)) + } + if len(m.Nodes) > 0 { + for _, e := range m.Nodes { + l = e.Size() + n += 1 + l + sovCoordinator(uint64(l)) + } + } + return n +} + +func (m *Node) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.PeerId) + if l > 0 { + n += 1 + l + sovCoordinator(uint64(l)) + } + if len(m.Addresses) > 0 { + for _, s := range m.Addresses { + l = len(s) + n += 1 + l + sovCoordinator(uint64(l)) + } + } + if len(m.Types) > 0 { + l = 0 + for _, e := range m.Types { + l += sovCoordinator(uint64(e)) + } + n += 1 + sovCoordinator(uint64(l)) + l + } + return n +} + func sovCoordinator(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1478,74 +1831,6 @@ func (m *SpaceSignRequest) Unmarshal(dAtA []byte) error { m.Header = []byte{} } iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OldIdentity", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCoordinator - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthCoordinator - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthCoordinator - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.OldIdentity = append(m.OldIdentity[:0], dAtA[iNdEx:postIndex]...) - if m.OldIdentity == nil { - m.OldIdentity = []byte{} - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NewIdentitySignature", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCoordinator - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthCoordinator - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthCoordinator - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.NewIdentitySignature = append(m.NewIdentitySignature[:0], dAtA[iNdEx:postIndex]...) - if m.NewIdentitySignature == nil { - m.NewIdentitySignature = []byte{} - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipCoordinator(dAtA[iNdEx:]) @@ -2647,6 +2932,387 @@ func (m *SpaceStatusChangeResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *NetworkConfigurationRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCoordinator + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: NetworkConfigurationRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NetworkConfigurationRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConfigurationId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCoordinator + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthCoordinator + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCoordinator + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ConfigurationId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCoordinator(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCoordinator + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *NetworkConfigurationResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCoordinator + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: NetworkConfigurationResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NetworkConfigurationResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConfigurationId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCoordinator + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthCoordinator + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCoordinator + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ConfigurationId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Nodes", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCoordinator + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCoordinator + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCoordinator + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Nodes = append(m.Nodes, &Node{}) + if err := m.Nodes[len(m.Nodes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCoordinator(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCoordinator + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Node) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCoordinator + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Node: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Node: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PeerId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCoordinator + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthCoordinator + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCoordinator + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PeerId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Addresses", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCoordinator + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthCoordinator + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCoordinator + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Addresses = append(m.Addresses, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 3: + if wireType == 0 { + var v NodeType + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCoordinator + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= NodeType(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Types = append(m.Types, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCoordinator + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthCoordinator + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthCoordinator + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + if elementCount != 0 && len(m.Types) == 0 { + m.Types = make([]NodeType, 0, elementCount) + } + for iNdEx < postIndex { + var v NodeType + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCoordinator + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= NodeType(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Types = append(m.Types, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field Types", wireType) + } + default: + iNdEx = preIndex + skippy, err := skipCoordinator(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCoordinator + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipCoordinator(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/coordinator/coordinatorproto/coordinator_drpc.pb.go b/coordinator/coordinatorproto/coordinator_drpc.pb.go index 3fd4e199..75e73a7b 100644 --- a/coordinator/coordinatorproto/coordinator_drpc.pb.go +++ b/coordinator/coordinatorproto/coordinator_drpc.pb.go @@ -44,6 +44,7 @@ type DRPCCoordinatorClient interface { FileLimitCheck(ctx context.Context, in *FileLimitCheckRequest) (*FileLimitCheckResponse, error) SpaceStatusCheck(ctx context.Context, in *SpaceStatusCheckRequest) (*SpaceStatusCheckResponse, error) SpaceStatusChange(ctx context.Context, in *SpaceStatusChangeRequest) (*SpaceStatusChangeResponse, error) + NetworkConfiguration(ctx context.Context, in *NetworkConfigurationRequest) (*NetworkConfigurationResponse, error) } type drpcCoordinatorClient struct { @@ -92,11 +93,21 @@ func (c *drpcCoordinatorClient) SpaceStatusChange(ctx context.Context, in *Space return out, nil } +func (c *drpcCoordinatorClient) NetworkConfiguration(ctx context.Context, in *NetworkConfigurationRequest) (*NetworkConfigurationResponse, error) { + out := new(NetworkConfigurationResponse) + err := c.cc.Invoke(ctx, "/coordinator.Coordinator/NetworkConfiguration", drpcEncoding_File_coordinator_coordinatorproto_protos_coordinator_proto{}, in, out) + if err != nil { + return nil, err + } + return out, nil +} + type DRPCCoordinatorServer interface { SpaceSign(context.Context, *SpaceSignRequest) (*SpaceSignResponse, error) FileLimitCheck(context.Context, *FileLimitCheckRequest) (*FileLimitCheckResponse, error) SpaceStatusCheck(context.Context, *SpaceStatusCheckRequest) (*SpaceStatusCheckResponse, error) SpaceStatusChange(context.Context, *SpaceStatusChangeRequest) (*SpaceStatusChangeResponse, error) + NetworkConfiguration(context.Context, *NetworkConfigurationRequest) (*NetworkConfigurationResponse, error) } type DRPCCoordinatorUnimplementedServer struct{} @@ -117,9 +128,13 @@ func (s *DRPCCoordinatorUnimplementedServer) SpaceStatusChange(context.Context, return nil, drpcerr.WithCode(errors.New("Unimplemented"), drpcerr.Unimplemented) } +func (s *DRPCCoordinatorUnimplementedServer) NetworkConfiguration(context.Context, *NetworkConfigurationRequest) (*NetworkConfigurationResponse, error) { + return nil, drpcerr.WithCode(errors.New("Unimplemented"), drpcerr.Unimplemented) +} + type DRPCCoordinatorDescription struct{} -func (DRPCCoordinatorDescription) NumMethods() int { return 4 } +func (DRPCCoordinatorDescription) NumMethods() int { return 5 } func (DRPCCoordinatorDescription) Method(n int) (string, drpc.Encoding, drpc.Receiver, interface{}, bool) { switch n { @@ -159,6 +174,15 @@ func (DRPCCoordinatorDescription) Method(n int) (string, drpc.Encoding, drpc.Rec in1.(*SpaceStatusChangeRequest), ) }, DRPCCoordinatorServer.SpaceStatusChange, true + case 4: + return "/coordinator.Coordinator/NetworkConfiguration", drpcEncoding_File_coordinator_coordinatorproto_protos_coordinator_proto{}, + func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { + return srv.(DRPCCoordinatorServer). + NetworkConfiguration( + ctx, + in1.(*NetworkConfigurationRequest), + ) + }, DRPCCoordinatorServer.NetworkConfiguration, true default: return "", nil, nil, nil, false } @@ -231,3 +255,19 @@ func (x *drpcCoordinator_SpaceStatusChangeStream) SendAndClose(m *SpaceStatusCha } return x.CloseSend() } + +type DRPCCoordinator_NetworkConfigurationStream interface { + drpc.Stream + SendAndClose(*NetworkConfigurationResponse) error +} + +type drpcCoordinator_NetworkConfigurationStream struct { + drpc.Stream +} + +func (x *drpcCoordinator_NetworkConfigurationStream) SendAndClose(m *NetworkConfigurationResponse) error { + if err := x.MsgSend(m, drpcEncoding_File_coordinator_coordinatorproto_protos_coordinator_proto{}); err != nil { + return err + } + return x.CloseSend() +} diff --git a/coordinator/coordinatorproto/protos/coordinator.proto b/coordinator/coordinatorproto/protos/coordinator.proto index 1075a1d6..c1521b32 100644 --- a/coordinator/coordinatorproto/protos/coordinator.proto +++ b/coordinator/coordinatorproto/protos/coordinator.proto @@ -18,6 +18,9 @@ service Coordinator { // SpaceStatusChange changes the status of space rpc SpaceStatusChange(SpaceStatusChangeRequest) returns (SpaceStatusChangeResponse); + + // NetworkConfiguration retrieves the latest network configuration + rpc NetworkConfiguration(NetworkConfigurationRequest) returns (NetworkConfigurationResponse); } message SpaceSignRequest { @@ -109,3 +112,34 @@ message SpaceStatusChangeRequest { message SpaceStatusChangeResponse { SpaceStatusPayload payload = 1; } + +// NetworkConfigurationRequest contains the requested configurationId, it can be empty to request the latest version +message NetworkConfigurationRequest { + string configurationId = 1; +} + +// NetworkConfigurationResponse contains list of nodes +message NetworkConfigurationResponse { + string configurationId = 1; + repeated Node nodes = 2; +} + +// NodeType determines the type of API that a node supports +enum NodeType { + // TreeAPI supports space/tree sync api + TreeAPI = 0; + // FileAPI support file api + FileAPI = 1; + // CoordinatorAPI supports coordinator api + CoordinatorAPI = 2; +} + +// Node describes one node in the network +message Node { + // peerId - it's a peer identifier (libp2p format string) so it's an encoded publicKey + string peerId = 1; + // list of node addresses + repeated string addresses = 2; + // list of supported APIs + repeated NodeType types = 3; +}