From 09d55c9beb380b191e688b192dff36c06d588b7b Mon Sep 17 00:00:00 2001 From: Alex Trottier Date: Sun, 29 Dec 2019 19:34:13 -0800 Subject: [PATCH] chore: add rpc to persist data locally --- doc/PROTO.md | 68 ++++ go/node.pb.go | 850 ++++++++++++++++++++++++++++++++++----- java/pb/NodeAPIGrpc.java | 87 ++++ js/node_grpc_pb.js | 34 ++ js/node_pb.js | 366 +++++++++++++++++ pb/node.proto | 14 + py/node_pb2.py | 228 ++++++++++- py/node_pb2_grpc.py | 17 + ts/node_pb.d.ts | 44 ++ ts/node_pb_service.d.ts | 19 + ts/node_pb_service.js | 40 ++ 11 files changed, 1654 insertions(+), 113 deletions(-) diff --git a/doc/PROTO.md b/doc/PROTO.md index 2247a02..aa059cf 100644 --- a/doc/PROTO.md +++ b/doc/PROTO.md @@ -61,6 +61,10 @@ - [P2PLsInfo](#pb.P2PLsInfo) - [P2PRequest](#pb.P2PRequest) - [P2PResponse](#pb.P2PResponse) + - [PersistRequest](#pb.PersistRequest) + - [PersistResponse](#pb.PersistResponse) + - [PersistResponse.ErrorsEntry](#pb.PersistResponse.ErrorsEntry) + - [PersistResponse.StatusEntry](#pb.PersistResponse.StatusEntry) - [BSREQOPTS](#pb.BSREQOPTS) - [BSREQTYPE](#pb.BSREQTYPE) @@ -795,6 +799,69 @@ P2PResponse is a response message sent in response to a P2PRequest message + + + +### PersistRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| cids | [string](#string) | repeated | cids to persist locally | + + + + + + + + +### PersistResponse + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| status | [PersistResponse.StatusEntry](#pb.PersistResponse.StatusEntry) | repeated | key = cid, value = whether or not it was persisted | +| errors | [PersistResponse.ErrorsEntry](#pb.PersistResponse.ErrorsEntry) | repeated | key = cid, value = error if not persisted | + + + + + + + + +### PersistResponse.ErrorsEntry + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| key | [string](#string) | | | +| value | [string](#string) | | | + + + + + + + + +### PersistResponse.StatusEntry + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| key | [string](#string) | | | +| value | [bool](#bool) | | | + + + + + @@ -926,6 +993,7 @@ NodeAPI provide an API to control the underlying custom ipfs node | Blockstore | [BlockstoreRequest](#pb.BlockstoreRequest) | [BlockstoreResponse](#pb.BlockstoreResponse) | Blockstore allows low-level management of the underlying blockstore | | Dag | [DagRequest](#pb.DagRequest) | [DagResponse](#pb.DagResponse) | Dag is a unidirectional rpc allowing manipulation of low-level ipld objects | | Keystore | [KeystoreRequest](#pb.KeystoreRequest) | [KeystoreResponse](#pb.KeystoreResponse) | Keystore is a unidirectional RPC allowing management of ipfs keystores | +| Persist | [PersistRequest](#pb.PersistRequest) | [PersistResponse](#pb.PersistResponse) | Persist is used to retrieve data from the network and make it available locally | diff --git a/go/node.pb.go b/go/node.pb.go index bf503fd..295b31c 100644 --- a/go/node.pb.go +++ b/go/node.pb.go @@ -1529,6 +1529,105 @@ func (m *KeystoreResponse) GetHas() bool { return false } +type PersistRequest struct { + // cids to persist locally + Cids []string `protobuf:"bytes,1,rep,name=cids,proto3" json:"cids,omitempty"` +} + +func (m *PersistRequest) Reset() { *m = PersistRequest{} } +func (m *PersistRequest) String() string { return proto.CompactTextString(m) } +func (*PersistRequest) ProtoMessage() {} +func (*PersistRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_0c843d59d2d938e7, []int{17} +} +func (m *PersistRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PersistRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PersistRequest.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 *PersistRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_PersistRequest.Merge(m, src) +} +func (m *PersistRequest) XXX_Size() int { + return m.Size() +} +func (m *PersistRequest) XXX_DiscardUnknown() { + xxx_messageInfo_PersistRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_PersistRequest proto.InternalMessageInfo + +func (m *PersistRequest) GetCids() []string { + if m != nil { + return m.Cids + } + return nil +} + +type PersistResponse struct { + // key = cid, value = whether or not it was persisted + Status map[string]bool `protobuf:"bytes,1,rep,name=status,proto3" json:"status,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` + // key = cid, value = error if not persisted + Errors map[string]string `protobuf:"bytes,2,rep,name=errors,proto3" json:"errors,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (m *PersistResponse) Reset() { *m = PersistResponse{} } +func (m *PersistResponse) String() string { return proto.CompactTextString(m) } +func (*PersistResponse) ProtoMessage() {} +func (*PersistResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0c843d59d2d938e7, []int{18} +} +func (m *PersistResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PersistResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PersistResponse.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 *PersistResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_PersistResponse.Merge(m, src) +} +func (m *PersistResponse) XXX_Size() int { + return m.Size() +} +func (m *PersistResponse) XXX_DiscardUnknown() { + xxx_messageInfo_PersistResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_PersistResponse proto.InternalMessageInfo + +func (m *PersistResponse) GetStatus() map[string]bool { + if m != nil { + return m.Status + } + return nil +} + +func (m *PersistResponse) GetErrors() map[string]string { + if m != nil { + return m.Errors + } + return nil +} + func init() { proto.RegisterEnum("pb.P2PREQTYPE", P2PREQTYPE_name, P2PREQTYPE_value) proto.RegisterEnum("pb.CONNMGMTREQTYPE", CONNMGMTREQTYPE_name, CONNMGMTREQTYPE_value) @@ -1558,105 +1657,114 @@ func init() { proto.RegisterType((*IPLDNode)(nil), "pb.IPLDNode") proto.RegisterType((*KeystoreRequest)(nil), "pb.KeystoreRequest") proto.RegisterType((*KeystoreResponse)(nil), "pb.KeystoreResponse") + proto.RegisterType((*PersistRequest)(nil), "pb.PersistRequest") + proto.RegisterType((*PersistResponse)(nil), "pb.PersistResponse") + proto.RegisterMapType((map[string]string)(nil), "pb.PersistResponse.ErrorsEntry") + proto.RegisterMapType((map[string]bool)(nil), "pb.PersistResponse.StatusEntry") } func init() { proto.RegisterFile("node.proto", fileDescriptor_0c843d59d2d938e7) } var fileDescriptor_0c843d59d2d938e7 = []byte{ - // 1475 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0xcd, 0x72, 0xdb, 0x54, - 0x14, 0xb6, 0xe4, 0x9f, 0xd8, 0xc7, 0xf9, 0x51, 0x6f, 0x43, 0xc7, 0x78, 0xe1, 0x09, 0x82, 0x29, - 0x99, 0x0c, 0xa4, 0x1d, 0x17, 0x86, 0x0c, 0x03, 0xc3, 0xd8, 0x96, 0x1c, 0x3c, 0xfe, 0x89, 0x91, - 0x9c, 0xfe, 0x6c, 0xf0, 0x28, 0xf6, 0x25, 0x11, 0x91, 0x25, 0x57, 0x92, 0x53, 0xdc, 0x25, 0x4f, - 0x00, 0x0b, 0xde, 0x81, 0x47, 0xe0, 0x11, 0x58, 0x96, 0x5d, 0x97, 0x4c, 0xbb, 0x60, 0xc5, 0x3b, - 0x30, 0xe7, 0x5e, 0x49, 0x96, 0x5c, 0x65, 0x52, 0xba, 0xbb, 0xe7, 0xdc, 0x73, 0xcf, 0xf9, 0xce, - 0xff, 0x05, 0xb0, 0x9d, 0x29, 0x3d, 0x9c, 0xbb, 0x8e, 0xef, 0x10, 0x71, 0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4, 0x64, 0xee, 0xf3, - 0xba, 0x8d, 0x0b, 0x9f, 0x0c, 0x47, 0xba, 0x16, 0xde, 0x12, 0x02, 0xb9, 0x89, 0x39, 0x0d, 0x0b, - 0x98, 0x9d, 0x91, 0x37, 0x35, 0x7c, 0x83, 0x65, 0x7c, 0x53, 0x63, 0x67, 0xec, 0x85, 0x89, 0x39, - 0x7d, 0x48, 0x5d, 0xcf, 0x74, 0xec, 0x60, 0x14, 0xc7, 0x38, 0xa4, 0x0a, 0xc5, 0x0b, 0xc3, 0xbb, - 0x68, 0x2f, 0xec, 0x49, 0x30, 0x5c, 0x23, 0x5a, 0xbe, 0x00, 0x12, 0x77, 0x29, 0x68, 0x87, 0xff, - 0xed, 0xd3, 0x07, 0x50, 0x38, 0x63, 0x6a, 0x82, 0x2e, 0x28, 0x31, 0x59, 0xe4, 0x68, 0xc1, 0x85, - 0xfc, 0x29, 0xe4, 0x19, 0x03, 0x0b, 0x6a, 0x62, 0x4e, 0xc3, 0x82, 0x9a, 0x98, 0xd3, 0xc8, 0x29, - 0xcc, 0x42, 0xe0, 0x94, 0xfc, 0x8f, 0x08, 0xa0, 0x18, 0xe7, 0x37, 0xef, 0x3c, 0xa5, 0x71, 0x9c, - 0x0a, 0x29, 0x45, 0x29, 0xb9, 0x0b, 0xdb, 0xce, 0xd9, 0x8f, 0x74, 0xe2, 0xab, 0xf6, 0xc4, 0x99, - 0x9a, 0xf6, 0x79, 0x30, 0xeb, 0xd6, 0xb8, 0xe4, 0x3e, 0xdc, 0xf6, 0xa8, 0x6b, 0x1a, 0x96, 0xf9, - 0xdc, 0xf0, 0x4d, 0xc7, 0x6e, 0x3b, 0xee, 0xcc, 0xf0, 0x83, 0x55, 0x98, 0x76, 0x95, 0x88, 0x71, - 0x3e, 0x19, 0xe3, 0xb5, 0xfc, 0xe0, 0x12, 0xcc, 0x26, 0xf2, 0x43, 0x20, 0x87, 0xb2, 0x41, 0x6e, - 0xd8, 0x99, 0xdc, 0x83, 0xbc,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6, 0xe7, 0x71, 0xbf, 0x31, 0x40, 0x15, 0xfc, 0xf2, 0x58, 0x1d, 0x49, 0xd9, 0xe0, 0x12, - 0xfd, 0x60, 0x97, 0xb9, 0x83, 0xbb, 0x81, 0x56, 0x5c, 0x02, 0x18, 0x4b, 0x45, 0x6d, 0x37, 0x4e, - 0x7b, 0x18, 0x94, 0x4d, 0x28, 0x36, 0xf5, 0x71, 0xfb, 0x44, 0x6b, 0x21, 0xfc, 0xef, 0x01, 0x56, - 0x8d, 0xc8, 0x04, 0x1b, 0xc7, 0xcc, 0x60, 0x26, 0x24, 0xd0, 0x80, 0x80, 0x81, 0x42, 0x62, 0xa0, - 0x3e, 0x1a, 0x0f, 0x4e, 0x14, 0x55, 0x12, 0x31, 0xb8, 0xc8, 0x69, 0x28, 0xca, 0xb8, 0xd7, 0x19, - 0x74, 0x75, 0x29, 0x1b, 0xb2, 0x10, 0x06, 0x67, 0xe5, 0x0e, 0xba, 0x50, 0x8a, 0xea, 0x08, 0x11, - 0x77, 0xf5, 0xf1, 0xb7, 0x0d, 0x9d, 0xbb, 0xd6, 0xd5, 0x03, 0xe5, 0xfc, 0x8c, 0x56, 0x45, 0x8c, - 0x40, 0x37, 0x8a, 0x40, 0x16, 0x41, 0x74, 0xf5, 0x31, 0x26, 0x5f, 0xca, 0xd5, 0xff, 0x10, 0x61, - 0x03, 0x3b, 0xaf, 0x31, 0xec, 0x90, 0x2f, 0xa0, 0x18, 0xfe, 0x04, 0xc8, 0xed, 0xe4, 0x37, 0x87, - 0xd5, 0x6a, 0x75, 0x37, 0xed, 0xef, 0x23, 0x67, 0xc8, 0x3e, 0x14, 0xf8, 0xd2, 0x27, 0x7c, 0xb1, - 0xc7, 0x3f, 0x00, 0x55, 0xb6, 0x6a, 0xd4, 0xd9, 0xdc, 0x5f, 0x32, 0xc9, 0xec, 0xb0, 0x3e, 0x24, - 0xd1, 0x87, 0x3d, 0x90, 0xd9, 0x89, 0xe8, 0x48, 0xe7, 0xd7, 0x00, 0xab, 0xc5, 0x47, 0xde, 0x8b, - 0xf6, 0x55, 0xbc, 0xc7, 0xab, 0x77, 0xd6, 0xd9, 0x31, 0x48, 0x59, 0xc5, 0x38, 0xe7, 0x86, 0x56, - 0x73, 0x99, 0x1b, 0x8a, 0x0d, 0x53, 0x39, 0x83, 0x5e, 0x87, 0x1d, 0xcc, 0xbd, 0x5e, 0x1b, 0x24, - 0xdc, 0xeb, 0xf5, 0x26, 0x97, 0x33, 0xcd, 0xca, 0x9f, 0xaf, 0x6a, 0xc2, 0x8b, 0x57, 0x35, 0xe1, - 0xef, 0x57, 0x35, 0xe1, 0x97, 0xd7, 0xb5, 0xcc, 0x8b, 0xd7, 0xb5, 0xcc, 0xcb, 0xd7, 0xb5, 0xcc, - 0x59, 0x81, 0xfd, 0xf2, 0x1f, 0xfc, 0x17, 0x00, 0x00, 0xff, 0xff, 0x93, 0x47, 0xc3, 0x19, 0x34, - 0x0e, 0x00, 0x00, + // 1568 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x57, 0x4b, 0x73, 0xdb, 0x46, + 0x12, 0x26, 0xc0, 0x87, 0xc8, 0xa6, 0x1e, 0xf0, 0x48, 0xeb, 0xe2, 0xf2, 0xc0, 0xd5, 0x62, 0x5d, + 0x5e, 0x95, 0x6a, 0x57, 0x76, 0xd1, 0xde, 0xb2, 0xbc, 0xb5, 0x5b, 0x29, 0x3e, 0x40, 0x85, 0xc5, + 0x87, 0x18, 0x80, 0xf2, 0xe3, 0x12, 0x16, 0x44, 0x4e, 0x24, 0x44, 0x24, 0x40, 0x03, 0xa0, 0x1c, + 0xf9, 0x98, 0x5f, 0x90, 0x1c, 0xf2, 0x1f, 0xf2, 0x53, 0x72, 0x74, 0x6e, 0x3e, 0xa6, 0xec, 0x43, + 0x4e, 0xc9, 0x3d, 0xb7, 0x54, 0xcf, 0x0c, 0x40, 0x80, 0x86, 0x4a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 0xd3, 0x83, 0x3f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x97, 0x3a, 0xab, 0xb3, 0x8c, 0x0f, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1685,6 +1793,8 @@ type NodeAPIClient interface { Dag(ctx context.Context, in *DagRequest, opts ...grpc.CallOption) (*DagResponse, error) //Keystore is a unidirectional RPC allowing management of ipfs keystores Keystore(ctx context.Context, in *KeystoreRequest, opts ...grpc.CallOption) (*KeystoreResponse, error) + // Persist is used to retrieve data from the network and make it available locally + Persist(ctx context.Context, in *PersistRequest, opts ...grpc.CallOption) (*PersistResponse, error) } type nodeAPIClient struct { @@ -1749,6 +1859,15 @@ func (c *nodeAPIClient) Keystore(ctx context.Context, in *KeystoreRequest, opts return out, nil } +func (c *nodeAPIClient) Persist(ctx context.Context, in *PersistRequest, opts ...grpc.CallOption) (*PersistResponse, error) { + out := new(PersistResponse) + err := c.cc.Invoke(ctx, "/pb.NodeAPI/Persist", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // NodeAPIServer is the server API for NodeAPI service. type NodeAPIServer interface { // ConnMgmt provides control over libp2p connections @@ -1765,6 +1884,8 @@ type NodeAPIServer interface { Dag(context.Context, *DagRequest) (*DagResponse, error) //Keystore is a unidirectional RPC allowing management of ipfs keystores Keystore(context.Context, *KeystoreRequest) (*KeystoreResponse, error) + // Persist is used to retrieve data from the network and make it available locally + Persist(context.Context, *PersistRequest) (*PersistResponse, error) } // UnimplementedNodeAPIServer can be embedded to have forward compatible implementations. @@ -1789,6 +1910,9 @@ func (*UnimplementedNodeAPIServer) Dag(ctx context.Context, req *DagRequest) (*D func (*UnimplementedNodeAPIServer) Keystore(ctx context.Context, req *KeystoreRequest) (*KeystoreResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Keystore not implemented") } +func (*UnimplementedNodeAPIServer) Persist(ctx context.Context, req *PersistRequest) (*PersistResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Persist not implemented") +} func RegisterNodeAPIServer(s *grpc.Server, srv NodeAPIServer) { s.RegisterService(&_NodeAPI_serviceDesc, srv) @@ -1902,6 +2026,24 @@ func _NodeAPI_Keystore_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } +func _NodeAPI_Persist_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PersistRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NodeAPIServer).Persist(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.NodeAPI/Persist", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NodeAPIServer).Persist(ctx, req.(*PersistRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _NodeAPI_serviceDesc = grpc.ServiceDesc{ ServiceName: "pb.NodeAPI", HandlerType: (*NodeAPIServer)(nil), @@ -1930,6 +2072,10 @@ var _NodeAPI_serviceDesc = grpc.ServiceDesc{ MethodName: "Keystore", Handler: _NodeAPI_Keystore_Handler, }, + { + MethodName: "Persist", + Handler: _NodeAPI_Persist_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "node.proto", @@ -2861,6 +3007,102 @@ func (m *KeystoreResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *PersistRequest) 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 *PersistRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PersistRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Cids) > 0 { + for iNdEx := len(m.Cids) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Cids[iNdEx]) + copy(dAtA[i:], m.Cids[iNdEx]) + i = encodeVarintNode(dAtA, i, uint64(len(m.Cids[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *PersistResponse) 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 *PersistResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PersistResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Errors) > 0 { + for k := range m.Errors { + v := m.Errors[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintNode(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintNode(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintNode(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Status) > 0 { + for k := range m.Status { + v := m.Status[k] + baseI := i + i-- + if v { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintNode(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintNode(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func encodeVarintNode(dAtA []byte, offset int, v uint64) int { offset -= sovNode(v) base := offset @@ -3301,6 +3543,46 @@ func (m *KeystoreResponse) Size() (n int) { return n } +func (m *PersistRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Cids) > 0 { + for _, s := range m.Cids { + l = len(s) + n += 1 + l + sovNode(uint64(l)) + } + } + return n +} + +func (m *PersistResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Status) > 0 { + for k, v := range m.Status { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovNode(uint64(len(k))) + 1 + 1 + n += mapEntrySize + 1 + sovNode(uint64(mapEntrySize)) + } + } + if len(m.Errors) > 0 { + for k, v := range m.Errors { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovNode(uint64(len(k))) + 1 + len(v) + sovNode(uint64(len(v))) + n += mapEntrySize + 1 + sovNode(uint64(mapEntrySize)) + } + } + return n +} + func sovNode(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -6279,6 +6561,386 @@ func (m *KeystoreResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *PersistRequest) 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 ErrIntOverflowNode + } + 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: PersistRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PersistRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Cids", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNode + } + 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 ErrInvalidLengthNode + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthNode + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Cids = append(m.Cids, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipNode(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthNode + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthNode + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PersistResponse) 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 ErrIntOverflowNode + } + 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: PersistResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PersistResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNode + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthNode + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthNode + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Status == nil { + m.Status = make(map[string]bool) + } + var mapkey string + var mapvalue bool + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNode + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNode + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthNode + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthNode + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapvaluetemp int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNode + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapvaluetemp |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + mapvalue = bool(mapvaluetemp != 0) + } else { + iNdEx = entryPreIndex + skippy, err := skipNode(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthNode + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Status[mapkey] = mapvalue + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Errors", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNode + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthNode + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthNode + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Errors == nil { + m.Errors = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNode + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNode + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthNode + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthNode + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNode + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthNode + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthNode + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipNode(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthNode + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Errors[mapkey] = mapvalue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipNode(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthNode + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthNode + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipNode(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/java/pb/NodeAPIGrpc.java b/java/pb/NodeAPIGrpc.java index d805072..84c9e48 100644 --- a/java/pb/NodeAPIGrpc.java +++ b/java/pb/NodeAPIGrpc.java @@ -222,6 +222,38 @@ pb.Node.KeystoreResponse> getKeystoreMethod() { return getKeystoreMethod; } + private static volatile io.grpc.MethodDescriptor getPersistMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Persist", + requestType = pb.Node.PersistRequest.class, + responseType = pb.Node.PersistResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getPersistMethod() { + io.grpc.MethodDescriptor getPersistMethod; + if ((getPersistMethod = NodeAPIGrpc.getPersistMethod) == null) { + synchronized (NodeAPIGrpc.class) { + if ((getPersistMethod = NodeAPIGrpc.getPersistMethod) == null) { + NodeAPIGrpc.getPersistMethod = getPersistMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "pb.NodeAPI", "Persist")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + pb.Node.PersistRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + pb.Node.PersistResponse.getDefaultInstance())) + .setSchemaDescriptor(new NodeAPIMethodDescriptorSupplier("Persist")) + .build(); + } + } + } + return getPersistMethod; + } + /** * Creates a new async stub that supports all call types for the service */ @@ -314,6 +346,16 @@ public void keystore(pb.Node.KeystoreRequest request, asyncUnimplementedUnaryCall(getKeystoreMethod(), responseObserver); } + /** + *
+     * Persist is used to retrieve data from the network and make it available locally
+     * 
+ */ + public void persist(pb.Node.PersistRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getPersistMethod(), responseObserver); + } + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) .addMethod( @@ -358,6 +400,13 @@ public void keystore(pb.Node.KeystoreRequest request, pb.Node.KeystoreRequest, pb.Node.KeystoreResponse>( this, METHODID_KEYSTORE))) + .addMethod( + getPersistMethod(), + asyncUnaryCall( + new MethodHandlers< + pb.Node.PersistRequest, + pb.Node.PersistResponse>( + this, METHODID_PERSIST))) .build(); } } @@ -450,6 +499,17 @@ public void keystore(pb.Node.KeystoreRequest request, asyncUnaryCall( getChannel().newCall(getKeystoreMethod(), getCallOptions()), request, responseObserver); } + + /** + *
+     * Persist is used to retrieve data from the network and make it available locally
+     * 
+ */ + public void persist(pb.Node.PersistRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getPersistMethod(), getCallOptions()), request, responseObserver); + } } /** @@ -534,6 +594,16 @@ public pb.Node.KeystoreResponse keystore(pb.Node.KeystoreRequest request) { return blockingUnaryCall( getChannel(), getKeystoreMethod(), getCallOptions(), request); } + + /** + *
+     * Persist is used to retrieve data from the network and make it available locally
+     * 
+ */ + public pb.Node.PersistResponse persist(pb.Node.PersistRequest request) { + return blockingUnaryCall( + getChannel(), getPersistMethod(), getCallOptions(), request); + } } /** @@ -624,6 +694,17 @@ public com.google.common.util.concurrent.ListenableFuture + * Persist is used to retrieve data from the network and make it available locally + * + */ + public com.google.common.util.concurrent.ListenableFuture persist( + pb.Node.PersistRequest request) { + return futureUnaryCall( + getChannel().newCall(getPersistMethod(), getCallOptions()), request); + } } private static final int METHODID_CONN_MGMT = 0; @@ -632,6 +713,7 @@ public com.google.common.util.concurrent.ListenableFuture implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -674,6 +756,10 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv serviceImpl.keystore((pb.Node.KeystoreRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; + case METHODID_PERSIST: + serviceImpl.persist((pb.Node.PersistRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; default: throw new AssertionError(); } @@ -741,6 +827,7 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .addMethod(getBlockstoreMethod()) .addMethod(getDagMethod()) .addMethod(getKeystoreMethod()) + .addMethod(getPersistMethod()) .build(); } } diff --git a/js/node_grpc_pb.js b/js/node_grpc_pb.js index 0bb2290..5c39b2c 100644 --- a/js/node_grpc_pb.js +++ b/js/node_grpc_pb.js @@ -137,6 +137,28 @@ function deserialize_pb_P2PResponse(buffer_arg) { return node_pb.P2PResponse.deserializeBinary(new Uint8Array(buffer_arg)); } +function serialize_pb_PersistRequest(arg) { + if (!(arg instanceof node_pb.PersistRequest)) { + throw new Error('Expected argument of type pb.PersistRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_pb_PersistRequest(buffer_arg) { + return node_pb.PersistRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_pb_PersistResponse(arg) { + if (!(arg instanceof node_pb.PersistResponse)) { + throw new Error('Expected argument of type pb.PersistResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_pb_PersistResponse(buffer_arg) { + return node_pb.PersistResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + // NodeAPI provide an API to control the underlying custom ipfs node var NodeAPIService = exports.NodeAPIService = { @@ -214,6 +236,18 @@ var NodeAPIService = exports.NodeAPIService = { responseSerialize: serialize_pb_KeystoreResponse, responseDeserialize: deserialize_pb_KeystoreResponse, }, + // Persist is used to retrieve data from the network and make it available locally + persist: { + path: '/pb.NodeAPI/Persist', + requestStream: false, + responseStream: false, + requestType: node_pb.PersistRequest, + responseType: node_pb.PersistResponse, + requestSerialize: serialize_pb_PersistRequest, + requestDeserialize: deserialize_pb_PersistRequest, + responseSerialize: serialize_pb_PersistResponse, + responseDeserialize: deserialize_pb_PersistResponse, + }, }; exports.NodeAPIClient = grpc.makeGenericClientConstructor(NodeAPIService); diff --git a/js/node_pb.js b/js/node_pb.js index b48e947..d38027b 100644 --- a/js/node_pb.js +++ b/js/node_pb.js @@ -39,6 +39,8 @@ goog.exportSymbol('proto.pb.P2PLsInfo', null, global); goog.exportSymbol('proto.pb.P2PREQTYPE', null, global); goog.exportSymbol('proto.pb.P2PRequest', null, global); goog.exportSymbol('proto.pb.P2PResponse', null, global); +goog.exportSymbol('proto.pb.PersistRequest', null, global); +goog.exportSymbol('proto.pb.PersistResponse', null, global); /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -396,6 +398,48 @@ if (goog.DEBUG && !COMPILED) { */ proto.pb.KeystoreResponse.displayName = 'proto.pb.KeystoreResponse'; } +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.pb.PersistRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.pb.PersistRequest.repeatedFields_, null); +}; +goog.inherits(proto.pb.PersistRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pb.PersistRequest.displayName = 'proto.pb.PersistRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.pb.PersistResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.pb.PersistResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.pb.PersistResponse.displayName = 'proto.pb.PersistResponse'; +} @@ -4532,6 +4576,328 @@ proto.pb.KeystoreResponse.prototype.setHas = function(value) { }; + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.pb.PersistRequest.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.pb.PersistRequest.prototype.toObject = function(opt_includeInstance) { + return proto.pb.PersistRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.pb.PersistRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pb.PersistRequest.toObject = function(includeInstance, msg) { + var f, obj = { + cidsList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.pb.PersistRequest} + */ +proto.pb.PersistRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pb.PersistRequest; + return proto.pb.PersistRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pb.PersistRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pb.PersistRequest} + */ +proto.pb.PersistRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.addCids(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pb.PersistRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pb.PersistRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.pb.PersistRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pb.PersistRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getCidsList(); + if (f.length > 0) { + writer.writeRepeatedString( + 1, + f + ); + } +}; + + +/** + * repeated string cids = 1; + * @return {!Array} + */ +proto.pb.PersistRequest.prototype.getCidsList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.pb.PersistRequest} returns this + */ +proto.pb.PersistRequest.prototype.setCidsList = function(value) { + return jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.pb.PersistRequest} returns this + */ +proto.pb.PersistRequest.prototype.addCids = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.pb.PersistRequest} returns this + */ +proto.pb.PersistRequest.prototype.clearCidsList = function() { + return this.setCidsList([]); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.pb.PersistResponse.prototype.toObject = function(opt_includeInstance) { + return proto.pb.PersistResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.pb.PersistResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pb.PersistResponse.toObject = function(includeInstance, msg) { + var f, obj = { + statusMap: (f = msg.getStatusMap()) ? f.toObject(includeInstance, undefined) : [], + errorsMap: (f = msg.getErrorsMap()) ? f.toObject(includeInstance, undefined) : [] + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.pb.PersistResponse} + */ +proto.pb.PersistResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.pb.PersistResponse; + return proto.pb.PersistResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.pb.PersistResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.pb.PersistResponse} + */ +proto.pb.PersistResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = msg.getStatusMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readBool, null, "", false); + }); + break; + case 2: + var value = msg.getErrorsMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", ""); + }); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.pb.PersistResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.pb.PersistResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.pb.PersistResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.pb.PersistResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getStatusMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(1, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeBool); + } + f = message.getErrorsMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(2, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); + } +}; + + +/** + * map status = 1; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.pb.PersistResponse.prototype.getStatusMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 1, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.pb.PersistResponse} returns this + */ +proto.pb.PersistResponse.prototype.clearStatusMap = function() { + this.getStatusMap().clear(); + return this;}; + + +/** + * map errors = 2; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.pb.PersistResponse.prototype.getErrorsMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 2, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.pb.PersistResponse} returns this + */ +proto.pb.PersistResponse.prototype.clearErrorsMap = function() { + this.getErrorsMap().clear(); + return this;}; + + /** * @enum {number} */ diff --git a/pb/node.proto b/pb/node.proto index 284a217..52f039d 100644 --- a/pb/node.proto +++ b/pb/node.proto @@ -18,6 +18,8 @@ service NodeAPI { rpc Dag(DagRequest) returns (DagResponse) { }; //Keystore is a unidirectional RPC allowing management of ipfs keystores rpc Keystore(KeystoreRequest) returns (KeystoreResponse) { }; + // Persist is used to retrieve data from the network and make it available locally + rpc Persist(PersistRequest) returns (PersistResponse) { }; } // P2PREQTYPE denotes the particular type of request being used in the p2p rpc @@ -329,4 +331,16 @@ message KeystoreResponse { // indicates if we have the key in our keystore // sent by: KS_HAS bool has = 4; +} + +message PersistRequest { + // cids to persist locally + repeated string cids = 1; +} + +message PersistResponse { + // key = cid, value = whether or not it was persisted + map status = 1; + // key = cid, value = error if not persisted + map errors = 2; } \ No newline at end of file diff --git a/py/node_pb2.py b/py/node_pb2.py index 1aa08d1..2b1474d 100644 --- a/py/node_pb2.py +++ b/py/node_pb2.py @@ -22,7 +22,7 @@ package='pb', syntax='proto3', serialized_options=None, - serialized_pb=_b('\n\nnode.proto\x12\x02pb\x1a\nutil.proto\"\xde\x01\n\nP2PRequest\x12#\n\x0brequestType\x18\x01 \x01(\x0e\x32\x0e.pb.P2PREQTYPE\x12\x0b\n\x03\x61ll\x18\x02 \x01(\x08\x12\x0f\n\x07verbose\x18\x03 \x01(\x08\x12\x14\n\x0cprotocolName\x18\x04 \x01(\t\x12\x15\n\rlistenAddress\x18\x05 \x01(\t\x12\x15\n\rtargetAddress\x18\x06 \x01(\t\x12\x15\n\rremoteAddress\x18\x07 \x01(\t\x12\x1c\n\x14\x61llowCustomProtocols\x18\x08 \x01(\x08\x12\x14\n\x0creportPeerID\x18\t \x01(\x08\"z\n\x0bP2PResponse\x12#\n\x0brequestType\x18\x01 \x01(\x0e\x32\x0e.pb.P2PREQTYPE\x12\r\n\x05names\x18\x02 \x03(\t\x12\x13\n\x0b\x63onnsClosed\x18\x03 \x01(\x05\x12\"\n\x0bstreamInfos\x18\x04 \x03(\x0b\x32\r.pb.P2PLsInfo\"^\n\tP2PLsInfo\x12\x14\n\x0cprotocolName\x18\x01 \x01(\t\x12\x15\n\rlistenAddress\x18\x02 \x01(\t\x12\x15\n\rtargetAddress\x18\x03 \x01(\t\x12\r\n\x05local\x18\x04 \x01(\x08\"#\n\x10GetPeersResponse\x12\x0f\n\x07peerIDs\x18\x01 \x03(\t\"`\n\x0f\x43onnMgmtRequest\x12(\n\x0brequestType\x18\x01 \x01(\x0e\x32\x13.pb.CONNMGMTREQTYPE\x12\x12\n\nmultiAddrs\x18\x02 \x03(\t\x12\x0f\n\x07peerIDs\x18\x03 \x03(\t\"\xac\x02\n\x10\x43onnMgmtResponse\x12(\n\x0brequestType\x18\x01 \x01(\x0e\x32\x13.pb.CONNMGMTREQTYPE\x12\x36\n\tconnected\x18\x02 \x03(\x0b\x32#.pb.ConnMgmtResponse.ConnectedEntry\x12\x30\n\x06status\x18\x03 \x03(\x0b\x32 .pb.ConnMgmtResponse.StatusEntry\x12\x0f\n\x07peerIDs\x18\x04 \x03(\t\x1a\x30\n\x0e\x43onnectedEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x08:\x02\x38\x01\x1a\x41\n\x0bStatusEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12!\n\x05value\x18\x02 \x01(\x0b\x32\x12.pb.ConnMgmtStatus:\x02\x38\x01\"6\n\x0e\x43onnMgmtStatus\x12\x14\n\x0c\x64isconnected\x18\x01 \x01(\x08\x12\x0e\n\x06reason\x18\x02 \x01(\t\"^\n\rExtrasRequest\x12&\n\x0brequestType\x18\x01 \x01(\x0e\x32\x11.pb.EXTRASREQTYPE\x12%\n\rextrasFeature\x18\x02 \x01(\x0e\x32\x0e.pb.EXTRASTYPE\"\x99\x01\n\x11\x42lockstoreRequest\x12\"\n\x0brequestType\x18\x01 \x01(\x0e\x32\r.pb.BSREQTYPE\x12\x1e\n\x07reqOpts\x18\x02 \x03(\x0e\x32\r.pb.BSREQOPTS\x12\x0c\n\x04\x63ids\x18\x03 \x03(\t\x12\x0c\n\x04\x64\x61ta\x18\x04 \x03(\x0c\x12\x12\n\ncidVersion\x18\x05 \x01(\t\x12\x10\n\x08hashFunc\x18\x07 \x01(\t\"S\n\x12\x42lockstoreResponse\x12\"\n\x0brequestType\x18\x01 \x01(\x0e\x32\r.pb.BSREQTYPE\x12\x19\n\x06\x62locks\x18\x02 \x03(\x0b\x32\t.pb.Block\"\"\n\x05\x42lock\x12\x0b\n\x03\x63id\x18\x01 \x01(\t\x12\x0c\n\x04\x64\x61ta\x18\x02 \x01(\x0c\"\x80\x02\n\nDagRequest\x12#\n\x0brequestType\x18\x01 \x01(\x0e\x32\x0e.pb.DAGREQTYPE\x12\x0c\n\x04\x64\x61ta\x18\x02 \x01(\x0c\x12\x16\n\x0eobjectEncoding\x18\x03 \x01(\t\x12\x1b\n\x13serializationFormat\x18\x04 \x01(\t\x12\x10\n\x08hashFunc\x18\x05 \x01(\t\x12\x12\n\ncidVersion\x18\x06 \x01(\x03\x12\x0c\n\x04hash\x18\x07 \x01(\t\x12(\n\x05links\x18\x08 \x03(\x0b\x32\x19.pb.DagRequest.LinksEntry\x1a,\n\nLinksEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"p\n\x0b\x44\x61gResponse\x12#\n\x0brequestType\x18\x01 \x01(\x0e\x32\x0e.pb.DAGREQTYPE\x12\x0e\n\x06hashes\x18\x02 \x03(\t\x12\x0f\n\x07rawData\x18\x03 \x01(\x0c\x12\x1b\n\x05links\x18\x04 \x03(\x0b\x32\x0c.pb.IPLDLink\"4\n\x08IPLDLink\x12\x0c\n\x04hash\x18\x01 \x01(\x0c\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x0c\n\x04size\x18\x03 \x01(\x04\"5\n\x08IPLDNode\x12\x1b\n\x05links\x18\x02 \x03(\x0b\x32\x0c.pb.IPLDLink\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x0c\"W\n\x0fKeystoreRequest\x12\"\n\x0brequestType\x18\x01 \x01(\x0e\x32\r.pb.KSREQTYPE\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x12\n\nprivateKey\x18\x03 \x01(\x0c\"i\n\x10KeystoreResponse\x12\"\n\x0brequestType\x18\x01 \x01(\x0e\x32\r.pb.KSREQTYPE\x12\x12\n\nprivateKey\x18\x02 \x01(\x0c\x12\x10\n\x08keyNames\x18\x03 \x03(\t\x12\x0b\n\x03has\x18\x04 \x01(\x08*8\n\nP2PREQTYPE\x12\t\n\x05\x43LOSE\x10\x00\x12\x0b\n\x07\x46ORWARD\x10\x01\x12\n\n\x06LISTEN\x10\x02\x12\x06\n\x02LS\x10\x03*U\n\x0f\x43ONNMGMTREQTYPE\x12\x0e\n\nCM_CONNECT\x10\x00\x12\x11\n\rCM_DISCONNECT\x10\x01\x12\r\n\tCM_STATUS\x10\x02\x12\x10\n\x0c\x43M_GET_PEERS\x10\x03*.\n\rEXTRASREQTYPE\x12\r\n\tEX_ENABLE\x10\x00\x12\x0e\n\nEX_DISABLE\x10\x01*?\n\nEXTRASTYPE\x12\x0c\n\x08IDENTIFY\x10\x00\x12\n\n\x06PUBSUB\x10\x01\x12\r\n\tDISCOVERY\x10\x02\x12\x08\n\x04MDNS\x10\x03*T\n\tBSREQTYPE\x12\r\n\tBS_DELETE\x10\x00\x12\n\n\x06\x42S_PUT\x10\x01\x12\x0f\n\x0b\x42S_PUT_MANY\x10\x02\x12\n\n\x06\x42S_GET\x10\x03\x12\x0f\n\x0b\x42S_GET_MANY\x10\x04*&\n\tBSREQOPTS\x12\x0b\n\x07\x44\x45\x46\x41ULT\x10\x00\x12\x0c\n\x08\x42S_FORCE\x10\x01*^\n\nDAGREQTYPE\x12\x0b\n\x07\x44\x41G_PUT\x10\x00\x12\x0b\n\x07\x44\x41G_GET\x10\x01\x12\x10\n\x0c\x44\x41G_NEW_NODE\x10\x02\x12\x11\n\rDAG_ADD_LINKS\x10\x03\x12\x11\n\rDAG_GET_LINKS\x10\x04*K\n\tKSREQTYPE\x12\n\n\x06KS_HAS\x10\x00\x12\n\n\x06KS_GET\x10\x01\x12\n\n\x06KS_PUT\x10\x02\x12\r\n\tKS_DELETE\x10\x03\x12\x0b\n\x07KS_LIST\x10\x04\x32\xb8\x02\n\x07NodeAPI\x12\x37\n\x08\x43onnMgmt\x12\x13.pb.ConnMgmtRequest\x1a\x14.pb.ConnMgmtResponse\"\x00\x12(\n\x06\x45xtras\x12\x11.pb.ExtrasRequest\x1a\t.pb.Empty\"\x00\x12(\n\x03P2P\x12\x0e.pb.P2PRequest\x1a\x0f.pb.P2PResponse\"\x00\x12=\n\nBlockstore\x12\x15.pb.BlockstoreRequest\x1a\x16.pb.BlockstoreResponse\"\x00\x12(\n\x03\x44\x61g\x12\x0e.pb.DagRequest\x1a\x0f.pb.DagResponse\"\x00\x12\x37\n\x08Keystore\x12\x13.pb.KeystoreRequest\x1a\x14.pb.KeystoreResponse\"\x00\x62\x06proto3') + serialized_pb=_b('\n\nnode.proto\x12\x02pb\x1a\nutil.proto\"\xde\x01\n\nP2PRequest\x12#\n\x0brequestType\x18\x01 \x01(\x0e\x32\x0e.pb.P2PREQTYPE\x12\x0b\n\x03\x61ll\x18\x02 \x01(\x08\x12\x0f\n\x07verbose\x18\x03 \x01(\x08\x12\x14\n\x0cprotocolName\x18\x04 \x01(\t\x12\x15\n\rlistenAddress\x18\x05 \x01(\t\x12\x15\n\rtargetAddress\x18\x06 \x01(\t\x12\x15\n\rremoteAddress\x18\x07 \x01(\t\x12\x1c\n\x14\x61llowCustomProtocols\x18\x08 \x01(\x08\x12\x14\n\x0creportPeerID\x18\t \x01(\x08\"z\n\x0bP2PResponse\x12#\n\x0brequestType\x18\x01 \x01(\x0e\x32\x0e.pb.P2PREQTYPE\x12\r\n\x05names\x18\x02 \x03(\t\x12\x13\n\x0b\x63onnsClosed\x18\x03 \x01(\x05\x12\"\n\x0bstreamInfos\x18\x04 \x03(\x0b\x32\r.pb.P2PLsInfo\"^\n\tP2PLsInfo\x12\x14\n\x0cprotocolName\x18\x01 \x01(\t\x12\x15\n\rlistenAddress\x18\x02 \x01(\t\x12\x15\n\rtargetAddress\x18\x03 \x01(\t\x12\r\n\x05local\x18\x04 \x01(\x08\"#\n\x10GetPeersResponse\x12\x0f\n\x07peerIDs\x18\x01 \x03(\t\"`\n\x0f\x43onnMgmtRequest\x12(\n\x0brequestType\x18\x01 \x01(\x0e\x32\x13.pb.CONNMGMTREQTYPE\x12\x12\n\nmultiAddrs\x18\x02 \x03(\t\x12\x0f\n\x07peerIDs\x18\x03 \x03(\t\"\xac\x02\n\x10\x43onnMgmtResponse\x12(\n\x0brequestType\x18\x01 \x01(\x0e\x32\x13.pb.CONNMGMTREQTYPE\x12\x36\n\tconnected\x18\x02 \x03(\x0b\x32#.pb.ConnMgmtResponse.ConnectedEntry\x12\x30\n\x06status\x18\x03 \x03(\x0b\x32 .pb.ConnMgmtResponse.StatusEntry\x12\x0f\n\x07peerIDs\x18\x04 \x03(\t\x1a\x30\n\x0e\x43onnectedEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x08:\x02\x38\x01\x1a\x41\n\x0bStatusEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12!\n\x05value\x18\x02 \x01(\x0b\x32\x12.pb.ConnMgmtStatus:\x02\x38\x01\"6\n\x0e\x43onnMgmtStatus\x12\x14\n\x0c\x64isconnected\x18\x01 \x01(\x08\x12\x0e\n\x06reason\x18\x02 \x01(\t\"^\n\rExtrasRequest\x12&\n\x0brequestType\x18\x01 \x01(\x0e\x32\x11.pb.EXTRASREQTYPE\x12%\n\rextrasFeature\x18\x02 \x01(\x0e\x32\x0e.pb.EXTRASTYPE\"\x99\x01\n\x11\x42lockstoreRequest\x12\"\n\x0brequestType\x18\x01 \x01(\x0e\x32\r.pb.BSREQTYPE\x12\x1e\n\x07reqOpts\x18\x02 \x03(\x0e\x32\r.pb.BSREQOPTS\x12\x0c\n\x04\x63ids\x18\x03 \x03(\t\x12\x0c\n\x04\x64\x61ta\x18\x04 \x03(\x0c\x12\x12\n\ncidVersion\x18\x05 \x01(\t\x12\x10\n\x08hashFunc\x18\x07 \x01(\t\"S\n\x12\x42lockstoreResponse\x12\"\n\x0brequestType\x18\x01 \x01(\x0e\x32\r.pb.BSREQTYPE\x12\x19\n\x06\x62locks\x18\x02 \x03(\x0b\x32\t.pb.Block\"\"\n\x05\x42lock\x12\x0b\n\x03\x63id\x18\x01 \x01(\t\x12\x0c\n\x04\x64\x61ta\x18\x02 \x01(\x0c\"\x80\x02\n\nDagRequest\x12#\n\x0brequestType\x18\x01 \x01(\x0e\x32\x0e.pb.DAGREQTYPE\x12\x0c\n\x04\x64\x61ta\x18\x02 \x01(\x0c\x12\x16\n\x0eobjectEncoding\x18\x03 \x01(\t\x12\x1b\n\x13serializationFormat\x18\x04 \x01(\t\x12\x10\n\x08hashFunc\x18\x05 \x01(\t\x12\x12\n\ncidVersion\x18\x06 \x01(\x03\x12\x0c\n\x04hash\x18\x07 \x01(\t\x12(\n\x05links\x18\x08 \x03(\x0b\x32\x19.pb.DagRequest.LinksEntry\x1a,\n\nLinksEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"p\n\x0b\x44\x61gResponse\x12#\n\x0brequestType\x18\x01 \x01(\x0e\x32\x0e.pb.DAGREQTYPE\x12\x0e\n\x06hashes\x18\x02 \x03(\t\x12\x0f\n\x07rawData\x18\x03 \x01(\x0c\x12\x1b\n\x05links\x18\x04 \x03(\x0b\x32\x0c.pb.IPLDLink\"4\n\x08IPLDLink\x12\x0c\n\x04hash\x18\x01 \x01(\x0c\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x0c\n\x04size\x18\x03 \x01(\x04\"5\n\x08IPLDNode\x12\x1b\n\x05links\x18\x02 \x03(\x0b\x32\x0c.pb.IPLDLink\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x0c\"W\n\x0fKeystoreRequest\x12\"\n\x0brequestType\x18\x01 \x01(\x0e\x32\r.pb.KSREQTYPE\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x12\n\nprivateKey\x18\x03 \x01(\x0c\"i\n\x10KeystoreResponse\x12\"\n\x0brequestType\x18\x01 \x01(\x0e\x32\r.pb.KSREQTYPE\x12\x12\n\nprivateKey\x18\x02 \x01(\x0c\x12\x10\n\x08keyNames\x18\x03 \x03(\t\x12\x0b\n\x03has\x18\x04 \x01(\x08\"\x1e\n\x0ePersistRequest\x12\x0c\n\x04\x63ids\x18\x01 \x03(\t\"\xd1\x01\n\x0fPersistResponse\x12/\n\x06status\x18\x01 \x03(\x0b\x32\x1f.pb.PersistResponse.StatusEntry\x12/\n\x06\x65rrors\x18\x02 \x03(\x0b\x32\x1f.pb.PersistResponse.ErrorsEntry\x1a-\n\x0bStatusEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x08:\x02\x38\x01\x1a-\n\x0b\x45rrorsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01*8\n\nP2PREQTYPE\x12\t\n\x05\x43LOSE\x10\x00\x12\x0b\n\x07\x46ORWARD\x10\x01\x12\n\n\x06LISTEN\x10\x02\x12\x06\n\x02LS\x10\x03*U\n\x0f\x43ONNMGMTREQTYPE\x12\x0e\n\nCM_CONNECT\x10\x00\x12\x11\n\rCM_DISCONNECT\x10\x01\x12\r\n\tCM_STATUS\x10\x02\x12\x10\n\x0c\x43M_GET_PEERS\x10\x03*.\n\rEXTRASREQTYPE\x12\r\n\tEX_ENABLE\x10\x00\x12\x0e\n\nEX_DISABLE\x10\x01*?\n\nEXTRASTYPE\x12\x0c\n\x08IDENTIFY\x10\x00\x12\n\n\x06PUBSUB\x10\x01\x12\r\n\tDISCOVERY\x10\x02\x12\x08\n\x04MDNS\x10\x03*T\n\tBSREQTYPE\x12\r\n\tBS_DELETE\x10\x00\x12\n\n\x06\x42S_PUT\x10\x01\x12\x0f\n\x0b\x42S_PUT_MANY\x10\x02\x12\n\n\x06\x42S_GET\x10\x03\x12\x0f\n\x0b\x42S_GET_MANY\x10\x04*&\n\tBSREQOPTS\x12\x0b\n\x07\x44\x45\x46\x41ULT\x10\x00\x12\x0c\n\x08\x42S_FORCE\x10\x01*^\n\nDAGREQTYPE\x12\x0b\n\x07\x44\x41G_PUT\x10\x00\x12\x0b\n\x07\x44\x41G_GET\x10\x01\x12\x10\n\x0c\x44\x41G_NEW_NODE\x10\x02\x12\x11\n\rDAG_ADD_LINKS\x10\x03\x12\x11\n\rDAG_GET_LINKS\x10\x04*K\n\tKSREQTYPE\x12\n\n\x06KS_HAS\x10\x00\x12\n\n\x06KS_GET\x10\x01\x12\n\n\x06KS_PUT\x10\x02\x12\r\n\tKS_DELETE\x10\x03\x12\x0b\n\x07KS_LIST\x10\x04\x32\xee\x02\n\x07NodeAPI\x12\x37\n\x08\x43onnMgmt\x12\x13.pb.ConnMgmtRequest\x1a\x14.pb.ConnMgmtResponse\"\x00\x12(\n\x06\x45xtras\x12\x11.pb.ExtrasRequest\x1a\t.pb.Empty\"\x00\x12(\n\x03P2P\x12\x0e.pb.P2PRequest\x1a\x0f.pb.P2PResponse\"\x00\x12=\n\nBlockstore\x12\x15.pb.BlockstoreRequest\x1a\x16.pb.BlockstoreResponse\"\x00\x12(\n\x03\x44\x61g\x12\x0e.pb.DagRequest\x1a\x0f.pb.DagResponse\"\x00\x12\x37\n\x08Keystore\x12\x13.pb.KeystoreRequest\x1a\x14.pb.KeystoreResponse\"\x00\x12\x34\n\x07Persist\x12\x12.pb.PersistRequest\x1a\x13.pb.PersistResponse\"\x00\x62\x06proto3') , dependencies=[util__pb2.DESCRIPTOR,]) @@ -51,8 +51,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=2020, - serialized_end=2076, + serialized_start=2264, + serialized_end=2320, ) _sym_db.RegisterEnumDescriptor(_P2PREQTYPE) @@ -82,8 +82,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=2078, - serialized_end=2163, + serialized_start=2322, + serialized_end=2407, ) _sym_db.RegisterEnumDescriptor(_CONNMGMTREQTYPE) @@ -105,8 +105,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=2165, - serialized_end=2211, + serialized_start=2409, + serialized_end=2455, ) _sym_db.RegisterEnumDescriptor(_EXTRASREQTYPE) @@ -136,8 +136,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=2213, - serialized_end=2276, + serialized_start=2457, + serialized_end=2520, ) _sym_db.RegisterEnumDescriptor(_EXTRASTYPE) @@ -171,8 +171,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=2278, - serialized_end=2362, + serialized_start=2522, + serialized_end=2606, ) _sym_db.RegisterEnumDescriptor(_BSREQTYPE) @@ -194,8 +194,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=2364, - serialized_end=2402, + serialized_start=2608, + serialized_end=2646, ) _sym_db.RegisterEnumDescriptor(_BSREQOPTS) @@ -229,8 +229,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=2404, - serialized_end=2498, + serialized_start=2648, + serialized_end=2742, ) _sym_db.RegisterEnumDescriptor(_DAGREQTYPE) @@ -264,8 +264,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=2500, - serialized_end=2575, + serialized_start=2744, + serialized_end=2819, ) _sym_db.RegisterEnumDescriptor(_KSREQTYPE) @@ -1263,6 +1263,149 @@ serialized_end=2018, ) + +_PERSISTREQUEST = _descriptor.Descriptor( + name='PersistRequest', + full_name='pb.PersistRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='cids', full_name='pb.PersistRequest.cids', index=0, + number=1, type=9, cpp_type=9, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2020, + serialized_end=2050, +) + + +_PERSISTRESPONSE_STATUSENTRY = _descriptor.Descriptor( + name='StatusEntry', + full_name='pb.PersistResponse.StatusEntry', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='key', full_name='pb.PersistResponse.StatusEntry.key', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='value', full_name='pb.PersistResponse.StatusEntry.value', index=1, + number=2, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=_b('8\001'), + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2170, + serialized_end=2215, +) + +_PERSISTRESPONSE_ERRORSENTRY = _descriptor.Descriptor( + name='ErrorsEntry', + full_name='pb.PersistResponse.ErrorsEntry', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='key', full_name='pb.PersistResponse.ErrorsEntry.key', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='value', full_name='pb.PersistResponse.ErrorsEntry.value', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=_b('8\001'), + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2217, + serialized_end=2262, +) + +_PERSISTRESPONSE = _descriptor.Descriptor( + name='PersistResponse', + full_name='pb.PersistResponse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='status', full_name='pb.PersistResponse.status', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='errors', full_name='pb.PersistResponse.errors', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_PERSISTRESPONSE_STATUSENTRY, _PERSISTRESPONSE_ERRORSENTRY, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2053, + serialized_end=2262, +) + _P2PREQUEST.fields_by_name['requestType'].enum_type = _P2PREQTYPE _P2PRESPONSE.fields_by_name['requestType'].enum_type = _P2PREQTYPE _P2PRESPONSE.fields_by_name['streamInfos'].message_type = _P2PLSINFO @@ -1287,6 +1430,10 @@ _IPLDNODE.fields_by_name['links'].message_type = _IPLDLINK _KEYSTOREREQUEST.fields_by_name['requestType'].enum_type = _KSREQTYPE _KEYSTORERESPONSE.fields_by_name['requestType'].enum_type = _KSREQTYPE +_PERSISTRESPONSE_STATUSENTRY.containing_type = _PERSISTRESPONSE +_PERSISTRESPONSE_ERRORSENTRY.containing_type = _PERSISTRESPONSE +_PERSISTRESPONSE.fields_by_name['status'].message_type = _PERSISTRESPONSE_STATUSENTRY +_PERSISTRESPONSE.fields_by_name['errors'].message_type = _PERSISTRESPONSE_ERRORSENTRY DESCRIPTOR.message_types_by_name['P2PRequest'] = _P2PREQUEST DESCRIPTOR.message_types_by_name['P2PResponse'] = _P2PRESPONSE DESCRIPTOR.message_types_by_name['P2PLsInfo'] = _P2PLSINFO @@ -1304,6 +1451,8 @@ DESCRIPTOR.message_types_by_name['IPLDNode'] = _IPLDNODE DESCRIPTOR.message_types_by_name['KeystoreRequest'] = _KEYSTOREREQUEST DESCRIPTOR.message_types_by_name['KeystoreResponse'] = _KEYSTORERESPONSE +DESCRIPTOR.message_types_by_name['PersistRequest'] = _PERSISTREQUEST +DESCRIPTOR.message_types_by_name['PersistResponse'] = _PERSISTRESPONSE DESCRIPTOR.enum_types_by_name['P2PREQTYPE'] = _P2PREQTYPE DESCRIPTOR.enum_types_by_name['CONNMGMTREQTYPE'] = _CONNMGMTREQTYPE DESCRIPTOR.enum_types_by_name['EXTRASREQTYPE'] = _EXTRASREQTYPE @@ -1457,10 +1606,42 @@ }) _sym_db.RegisterMessage(KeystoreResponse) +PersistRequest = _reflection.GeneratedProtocolMessageType('PersistRequest', (_message.Message,), { + 'DESCRIPTOR' : _PERSISTREQUEST, + '__module__' : 'node_pb2' + # @@protoc_insertion_point(class_scope:pb.PersistRequest) + }) +_sym_db.RegisterMessage(PersistRequest) + +PersistResponse = _reflection.GeneratedProtocolMessageType('PersistResponse', (_message.Message,), { + + 'StatusEntry' : _reflection.GeneratedProtocolMessageType('StatusEntry', (_message.Message,), { + 'DESCRIPTOR' : _PERSISTRESPONSE_STATUSENTRY, + '__module__' : 'node_pb2' + # @@protoc_insertion_point(class_scope:pb.PersistResponse.StatusEntry) + }) + , + + 'ErrorsEntry' : _reflection.GeneratedProtocolMessageType('ErrorsEntry', (_message.Message,), { + 'DESCRIPTOR' : _PERSISTRESPONSE_ERRORSENTRY, + '__module__' : 'node_pb2' + # @@protoc_insertion_point(class_scope:pb.PersistResponse.ErrorsEntry) + }) + , + 'DESCRIPTOR' : _PERSISTRESPONSE, + '__module__' : 'node_pb2' + # @@protoc_insertion_point(class_scope:pb.PersistResponse) + }) +_sym_db.RegisterMessage(PersistResponse) +_sym_db.RegisterMessage(PersistResponse.StatusEntry) +_sym_db.RegisterMessage(PersistResponse.ErrorsEntry) + _CONNMGMTRESPONSE_CONNECTEDENTRY._options = None _CONNMGMTRESPONSE_STATUSENTRY._options = None _DAGREQUEST_LINKSENTRY._options = None +_PERSISTRESPONSE_STATUSENTRY._options = None +_PERSISTRESPONSE_ERRORSENTRY._options = None _NODEAPI = _descriptor.ServiceDescriptor( name='NodeAPI', @@ -1468,8 +1649,8 @@ file=DESCRIPTOR, index=0, serialized_options=None, - serialized_start=2578, - serialized_end=2890, + serialized_start=2822, + serialized_end=3188, methods=[ _descriptor.MethodDescriptor( name='ConnMgmt', @@ -1525,6 +1706,15 @@ output_type=_KEYSTORERESPONSE, serialized_options=None, ), + _descriptor.MethodDescriptor( + name='Persist', + full_name='pb.NodeAPI.Persist', + index=6, + containing_service=None, + input_type=_PERSISTREQUEST, + output_type=_PERSISTRESPONSE, + serialized_options=None, + ), ]) _sym_db.RegisterServiceDescriptor(_NODEAPI) diff --git a/py/node_pb2_grpc.py b/py/node_pb2_grpc.py index b6d5824..ec325e7 100644 --- a/py/node_pb2_grpc.py +++ b/py/node_pb2_grpc.py @@ -45,6 +45,11 @@ def __init__(self, channel): request_serializer=node__pb2.KeystoreRequest.SerializeToString, response_deserializer=node__pb2.KeystoreResponse.FromString, ) + self.Persist = channel.unary_unary( + '/pb.NodeAPI/Persist', + request_serializer=node__pb2.PersistRequest.SerializeToString, + response_deserializer=node__pb2.PersistResponse.FromString, + ) class NodeAPIServicer(object): @@ -95,6 +100,13 @@ def Keystore(self, request, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def Persist(self, request, context): + """Persist is used to retrieve data from the network and make it available locally + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + def add_NodeAPIServicer_to_server(servicer, server): rpc_method_handlers = { @@ -128,6 +140,11 @@ def add_NodeAPIServicer_to_server(servicer, server): request_deserializer=node__pb2.KeystoreRequest.FromString, response_serializer=node__pb2.KeystoreResponse.SerializeToString, ), + 'Persist': grpc.unary_unary_rpc_method_handler( + servicer.Persist, + request_deserializer=node__pb2.PersistRequest.FromString, + response_serializer=node__pb2.PersistResponse.SerializeToString, + ), } generic_handler = grpc.method_handlers_generic_handler( 'pb.NodeAPI', rpc_method_handlers) diff --git a/ts/node_pb.d.ts b/ts/node_pb.d.ts index 1631fab..e3639ff 100644 --- a/ts/node_pb.d.ts +++ b/ts/node_pb.d.ts @@ -569,6 +569,50 @@ export namespace KeystoreResponse { } } +export class PersistRequest extends jspb.Message { + clearCidsList(): void; + getCidsList(): Array; + setCidsList(value: Array): void; + addCids(value: string, index?: number): string; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): PersistRequest.AsObject; + static toObject(includeInstance: boolean, msg: PersistRequest): PersistRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: PersistRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): PersistRequest; + static deserializeBinaryFromReader(message: PersistRequest, reader: jspb.BinaryReader): PersistRequest; +} + +export namespace PersistRequest { + export type AsObject = { + cidsList: Array, + } +} + +export class PersistResponse extends jspb.Message { + getStatusMap(): jspb.Map; + clearStatusMap(): void; + getErrorsMap(): jspb.Map; + clearErrorsMap(): void; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): PersistResponse.AsObject; + static toObject(includeInstance: boolean, msg: PersistResponse): PersistResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: PersistResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): PersistResponse; + static deserializeBinaryFromReader(message: PersistResponse, reader: jspb.BinaryReader): PersistResponse; +} + +export namespace PersistResponse { + export type AsObject = { + statusMap: Array<[string, boolean]>, + errorsMap: Array<[string, string]>, + } +} + export interface P2PREQTYPEMap { CLOSE: 0; FORWARD: 1; diff --git a/ts/node_pb_service.d.ts b/ts/node_pb_service.d.ts index 565bae7..a909fb1 100644 --- a/ts/node_pb_service.d.ts +++ b/ts/node_pb_service.d.ts @@ -59,6 +59,15 @@ type NodeAPIKeystore = { readonly responseType: typeof node_pb.KeystoreResponse; }; +type NodeAPIPersist = { + readonly methodName: string; + readonly service: typeof NodeAPI; + readonly requestStream: false; + readonly responseStream: false; + readonly requestType: typeof node_pb.PersistRequest; + readonly responseType: typeof node_pb.PersistResponse; +}; + export class NodeAPI { static readonly serviceName: string; static readonly ConnMgmt: NodeAPIConnMgmt; @@ -67,6 +76,7 @@ export class NodeAPI { static readonly Blockstore: NodeAPIBlockstore; static readonly Dag: NodeAPIDag; static readonly Keystore: NodeAPIKeystore; + static readonly Persist: NodeAPIPersist; } export type ServiceError = { message: string, code: number; metadata: grpc.Metadata } @@ -155,5 +165,14 @@ export class NodeAPIClient { requestMessage: node_pb.KeystoreRequest, callback: (error: ServiceError|null, responseMessage: node_pb.KeystoreResponse|null) => void ): UnaryResponse; + persist( + requestMessage: node_pb.PersistRequest, + metadata: grpc.Metadata, + callback: (error: ServiceError|null, responseMessage: node_pb.PersistResponse|null) => void + ): UnaryResponse; + persist( + requestMessage: node_pb.PersistRequest, + callback: (error: ServiceError|null, responseMessage: node_pb.PersistResponse|null) => void + ): UnaryResponse; } diff --git a/ts/node_pb_service.js b/ts/node_pb_service.js index 4272c90..0e03df1 100644 --- a/ts/node_pb_service.js +++ b/ts/node_pb_service.js @@ -65,6 +65,15 @@ NodeAPI.Keystore = { responseType: node_pb.KeystoreResponse }; +NodeAPI.Persist = { + methodName: "Persist", + service: NodeAPI, + requestStream: false, + responseStream: false, + requestType: node_pb.PersistRequest, + responseType: node_pb.PersistResponse +}; + exports.NodeAPI = NodeAPI; function NodeAPIClient(serviceHost, options) { @@ -258,5 +267,36 @@ NodeAPIClient.prototype.keystore = function keystore(requestMessage, metadata, c }; }; +NodeAPIClient.prototype.persist = function persist(requestMessage, metadata, callback) { + if (arguments.length === 2) { + callback = arguments[1]; + } + var client = grpc.unary(NodeAPI.Persist, { + request: requestMessage, + host: this.serviceHost, + metadata: metadata, + transport: this.options.transport, + debug: this.options.debug, + onEnd: function (response) { + if (callback) { + if (response.status !== grpc.Code.OK) { + var err = new Error(response.statusMessage); + err.code = response.status; + err.metadata = response.trailers; + callback(err, null); + } else { + callback(null, response.message); + } + } + } + }); + return { + cancel: function () { + callback = null; + client.close(); + } + }; +}; + exports.NodeAPIClient = NodeAPIClient;