From 969f386e5e24eedfe1ebdf77ec7501412e258d44 Mon Sep 17 00:00:00 2001 From: Alex Trottier Date: Sun, 29 Dec 2019 17:00:41 -0800 Subject: [PATCH] re-enable streamer --- doc/PROTO.md | 1 + go/node.pb.go | 242 +++++++++++++++++++++++++-------------- java/pb/NodeAPIGrpc.java | 65 +++++++++++ js/node_grpc_pb.js | 12 ++ pb/node.proto | 2 + py/node_pb2.py | 13 ++- py/node_pb2_grpc.py | 17 +++ ts/node_pb_service.d.ts | 11 ++ ts/node_pb_service.js | 54 +++++++++ 9 files changed, 330 insertions(+), 87 deletions(-) diff --git a/doc/PROTO.md b/doc/PROTO.md index 1a8d01e..9515eda 100644 --- a/doc/PROTO.md +++ b/doc/PROTO.md @@ -955,6 +955,7 @@ NodeAPI provide an API to control the underlying custom ipfs node | P2P | [P2PRequest](#pb.P2PRequest) | [P2PResponse](#pb.P2PResponse) | P2P allows control of generalized p2p streams for tcp/udp based protocol. By using this RPC, we can tunnel traffic similar to ssh tunneling except using libp2p as the transport layer, and and tcp/udp port. | | 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 | +| DagStream | [DagRequest](#pb.DagRequest) stream | [DagResponse](#pb.DagResponse) stream | DagStream is like Dag but with bidirectional streams | diff --git a/go/node.pb.go b/go/node.pb.go index d90c232..56edac0 100644 --- a/go/node.pb.go +++ b/go/node.pb.go @@ -1333,91 +1333,92 @@ func init() { func init() { proto.RegisterFile("node.proto", fileDescriptor_0c843d59d2d938e7) } var fileDescriptor_0c843d59d2d938e7 = []byte{ - // 1342 bytes of a gzipped FileDescriptorProto + // 1357 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0xcd,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, 0x57, 0xd8, 0x19, 0x87, - 0x2e, 0x5d, 0xfb, 0x95, 0xdf, 0xe8, 0x77, 0x55, 0x38, 0xd2, 0xba, 0x70, 0x8e, 0x4e, 0xc4, 0xb7, - 0x47, 0x5c, 0x9e, 0x94, 0x61, 0xa7, 0x37, 0x9c, 0x58, 0xba, 0x92, 0x23, 0x15, 0xd8, 0xed, 0x4f, - 0xcc, 0xfb, 0x1d, 0x53, 0x53, 0x24, 0x02, 0x50, 0x1c, 0x0e, 0x2c, 0x5b, 0x1f, 0x2b, 0x32, 0x29, - 0x82, 0x3c, 0xb4, 0x94, 0xfc, 0xd1, 0x19, 0x1c, 0x5c, 0x69, 0xdc, 0x64, 0x1f, 0xa0, 0x37, 0x9a, - 0x22, 0xaa, 0xf7, 0x6c, 0x25, 0x47, 0xae, 0x41, 0xb5, 0x37, 0x9a, 0x6a, 0x03, 0x2b, 0x85, 0x24, - 0x52, 0x85, 0x72, 0x6f, 0x34, 0xb5, 0xec, 0x8e, 0x7d, 0x66, 0x29, 0x32, 0x51, 0x60, 0xaf, 0x37, - 0x9a, 0x9e, 0xea, 0xf6, 0xd4, 0xd0, 0x75, 0x13, 0xcd, 0x1e, 0x43, 0x75, 0xa3, 0xab, 0xe0, 0x09, - 0xfd, 0xc1, 0x54, 0x1f, 0x77, 0xba, 0x43, 0xe4, 0xb5, 0x0f, 0xa0, 0x3f, 0x40, 0x9b, 0x5c, 0x96, - 0x8e, 0xbe, 0x45, 0x39, 0x6d, 0x27, 0x64, 0x0f, 0x4a, 0x03, 0x4d, 0x1f, 0xdb, 0x83, 0xfe, 0x43, - 0x25, 0x87, 0xb4, 0x8d, 0xb3, 0xae, 0x75, 0xd6, 0x15, 0x8e, 0x39, 0x91, 0x7b, 0xba, 0xf9, 0x50, - 0x91, 0x49, 0x09, 0x0a, 0x23, 0x6d, 0x8c, 0x0e, 0x6d, 0x28, 0x77, 0xb3, 0xce, 0xba, 0xd6, 0x54, - 0xd3, 0x87, 0xba, 0xad,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c, 0x08, 0x95, 0xf4, 0xef, 0xad, 0x47, 0x13, 0xdd, 0x48, 0xab, 0x10, 0x05, 0xb2, + 0xb6, 0xe7, 0x55, 0xe5, 0x86, 0xd4, 0x2c, 0x1a, 0xb8, 0x24, 0x55, 0xd8, 0x79, 0x46, 0xc3, 0xf3, + 0x80, 0xd1, 0x6a, 0x96, 0xa3, 0x89, 0x48, 0x54, 0xd8, 0xe5, 0x5e, 0x67, 0x81, 0x37, 0xb2, 0xe7, + 0xb4, 0x9a, 0x6b, 0x48, 0xcd, 0x92, 0xb1, 0x81, 0x91, 0x4f, 0xa0, 0xe2, 0xb9, 0x2c, 0xa2, 0x7e, + 0xdb, 0x71, 0x42, 0xca, 0x58, 0x35, 0xcf, 0x95, 0x36, 0x41, 0xd4, 0x8a, 0xec, 0xf0, 0x82, 0x46, + 0x89, 0x56, 0x41, 0x68, 0x6d, 0x80, 0xa8, 0x15, 0xd2, 0x79, 0x10, 0xd1, 0x44, 0x6b, 0x47, 0x68, + 0x6d, 0x80, 0xa4, 0x05, 0x07, 0xb6, 0xe7, 0x05, 0xcf, 0xbb, 0x4b, 0x16, 0x05, 0xf3, 0x49, 0x4c, + 0x86, 0x55, 0x8b, 0x9c, 0xfc, 0xd6, 0x3d, 0xbc, 0x49, 0x48, 0x17, 0x41, 0x18, 0x4d, 0x28, 0x0d, + 0xfb, 0x5a, 0xb5, 0xc4, 0x75, 0x37, 0x30, 0xf5, 0x0f, 0x09, 0xca, 0x3c, 0xb4, 0x6c, 0x11, 0xf8, + 0x8c, 0xbe, 0x47, 0x6c, 0x0f, 0x20, 0xef, 0xdb, 0x73, 0xca, 0xaa, 0x72, 0x23, 0xdb, 0x2c, 0x19, + 0x42, 0x20, 0x0d, 0x28, 0xcf, 0x02, 0xdf, 0x67, 0x5d, 0x2f, 0x60, 0xd4, 0xe1, 0x31, 0xce, 0x1b, + 0x69, 0x88, 0xdc, 0x81, 0x32, 0x8b, 0x42, 0x6a, 0xcf, 0xfb, 0xfe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0xd3, 0xa1, 0xc6, 0x3b, 0xa2, 0x3e, + 0x5f, 0x44, 0x97, 0x5c, 0x33, 0x3b, 0x69, 0x4d, 0xc8, 0xea, 0x37, 0x17, 0xeb, 0xec, 0xaf, 0xe4, + 0x95, 0xcd, 0x6f, 0x00, 0xd6, 0xed, 0x96, 0x7c, 0xb0, 0x6a, 0xab, 0xe9, 0xce, 0x5f, 0xbb, 0x75, + 0x15, 0x4e, 0x51, 0xca, 0x6a, 0xf6, 0x85, 0x70, 0xb4, 0x6e, 0x1f, 0xc2, 0x51, 0xea, 0xcd, 0xab, + 0x19, 0x72, 0x0c, 0x25, 0xcd, 0xbe, 0x30, 0xf9, 0x2f, 0xef, 0x5a, 0xfd, 0xa6, 0x74, 0x2c, 0x75, + 0xaa, 0x7f, 0xbd, 0xae, 0x4b, 0x2f, 0x5f, 0xd7, 0xa5, 0xbf, 0x5f, 0xd7, 0xa5, 0x5f, 0xdf, 0xd4, + 0x33, 0x2f, 0xdf, 0xd4, 0x33, 0xaf, 0xde, 0xd4, 0x33, 0xe7, 0x05, 0xfe, 0xf7, 0xbb, 0xfb, 0x5f, + 0x00, 0x00, 0x00, 0xff, 0xff, 0xaf, 0x5c, 0xed, 0x69, 0x4a, 0x0c, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1444,6 +1445,8 @@ type NodeAPIClient interface { Blockstore(ctx context.Context, in *BlockstoreRequest, opts ...grpc.CallOption) (*BlockstoreResponse, error) // Dag is a unidirectional rpc allowing manipulation of low-level ipld objects Dag(ctx context.Context, in *DagRequest, opts ...grpc.CallOption) (*DagResponse, error) + // DagStream is like Dag but with bidirectional streams + DagStream(ctx context.Context, opts ...grpc.CallOption) (NodeAPI_DagStreamClient, error) } type nodeAPIClient struct { @@ -1499,6 +1502,37 @@ func (c *nodeAPIClient) Dag(ctx context.Context, in *DagRequest, opts ...grpc.Ca return out, nil } +func (c *nodeAPIClient) DagStream(ctx context.Context, opts ...grpc.CallOption) (NodeAPI_DagStreamClient, error) { + stream, err := c.cc.NewStream(ctx, &_NodeAPI_serviceDesc.Streams[0], "/pb.NodeAPI/DagStream", opts...) + if err != nil { + return nil, err + } + x := &nodeAPIDagStreamClient{stream} + return x, nil +} + +type NodeAPI_DagStreamClient interface { + Send(*DagRequest) error + Recv() (*DagResponse, error) + grpc.ClientStream +} + +type nodeAPIDagStreamClient struct { + grpc.ClientStream +} + +func (x *nodeAPIDagStreamClient) Send(m *DagRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *nodeAPIDagStreamClient) Recv() (*DagResponse, error) { + m := new(DagResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + // NodeAPIServer is the server API for NodeAPI service. type NodeAPIServer interface { // ConnMgmt provides control over libp2p connections @@ -1513,6 +1547,8 @@ type NodeAPIServer interface { Blockstore(context.Context, *BlockstoreRequest) (*BlockstoreResponse, error) // Dag is a unidirectional rpc allowing manipulation of low-level ipld objects Dag(context.Context, *DagRequest) (*DagResponse, error) + // DagStream is like Dag but with bidirectional streams + DagStream(NodeAPI_DagStreamServer) error } // UnimplementedNodeAPIServer can be embedded to have forward compatible implementations. @@ -1534,6 +1570,9 @@ func (*UnimplementedNodeAPIServer) Blockstore(ctx context.Context, req *Blocksto func (*UnimplementedNodeAPIServer) Dag(ctx context.Context, req *DagRequest) (*DagResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Dag not implemented") } +func (*UnimplementedNodeAPIServer) DagStream(srv NodeAPI_DagStreamServer) error { + return status.Errorf(codes.Unimplemented, "method DagStream not implemented") +} func RegisterNodeAPIServer(s *grpc.Server, srv NodeAPIServer) { s.RegisterService(&_NodeAPI_serviceDesc, srv) @@ -1629,6 +1668,32 @@ func _NodeAPI_Dag_Handler(srv interface{}, ctx context.Context, dec func(interfa return interceptor(ctx, in, info, handler) } +func _NodeAPI_DagStream_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(NodeAPIServer).DagStream(&nodeAPIDagStreamServer{stream}) +} + +type NodeAPI_DagStreamServer interface { + Send(*DagResponse) error + Recv() (*DagRequest, error) + grpc.ServerStream +} + +type nodeAPIDagStreamServer struct { + grpc.ServerStream +} + +func (x *nodeAPIDagStreamServer) Send(m *DagResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *nodeAPIDagStreamServer) Recv() (*DagRequest, error) { + m := new(DagRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + var _NodeAPI_serviceDesc = grpc.ServiceDesc{ ServiceName: "pb.NodeAPI", HandlerType: (*NodeAPIServer)(nil), @@ -1654,7 +1719,14 @@ var _NodeAPI_serviceDesc = grpc.ServiceDesc{ Handler: _NodeAPI_Dag_Handler, }, }, - Streams: []grpc.StreamDesc{}, + Streams: []grpc.StreamDesc{ + { + StreamName: "DagStream", + Handler: _NodeAPI_DagStream_Handler, + ServerStreams: true, + ClientStreams: true, + }, + }, Metadata: "node.proto", } diff --git a/java/pb/NodeAPIGrpc.java b/java/pb/NodeAPIGrpc.java index 3e51960..f3c41a4 100644 --- a/java/pb/NodeAPIGrpc.java +++ b/java/pb/NodeAPIGrpc.java @@ -190,6 +190,38 @@ pb.Node.DagResponse> getDagMethod() { return getDagMethod; } + private static volatile io.grpc.MethodDescriptor getDagStreamMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DagStream", + requestType = pb.Node.DagRequest.class, + responseType = pb.Node.DagResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + public static io.grpc.MethodDescriptor getDagStreamMethod() { + io.grpc.MethodDescriptor getDagStreamMethod; + if ((getDagStreamMethod = NodeAPIGrpc.getDagStreamMethod) == null) { + synchronized (NodeAPIGrpc.class) { + if ((getDagStreamMethod = NodeAPIGrpc.getDagStreamMethod) == null) { + NodeAPIGrpc.getDagStreamMethod = getDagStreamMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName(generateFullMethodName( + "pb.NodeAPI", "DagStream")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + pb.Node.DagRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + pb.Node.DagResponse.getDefaultInstance())) + .setSchemaDescriptor(new NodeAPIMethodDescriptorSupplier("DagStream")) + .build(); + } + } + } + return getDagStreamMethod; + } + /** * Creates a new async stub that supports all call types for the service */ @@ -272,6 +304,16 @@ public void dag(pb.Node.DagRequest request, asyncUnimplementedUnaryCall(getDagMethod(), responseObserver); } + /** + *
+     * DagStream is like Dag but with bidirectional streams
+     * 
+ */ + public io.grpc.stub.StreamObserver dagStream( + io.grpc.stub.StreamObserver responseObserver) { + return asyncUnimplementedStreamingCall(getDagStreamMethod(), responseObserver); + } + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) .addMethod( @@ -309,6 +351,13 @@ public void dag(pb.Node.DagRequest request, pb.Node.DagRequest, pb.Node.DagResponse>( this, METHODID_DAG))) + .addMethod( + getDagStreamMethod(), + asyncBidiStreamingCall( + new MethodHandlers< + pb.Node.DagRequest, + pb.Node.DagResponse>( + this, METHODID_DAG_STREAM))) .build(); } } @@ -390,6 +439,17 @@ public void dag(pb.Node.DagRequest request, asyncUnaryCall( getChannel().newCall(getDagMethod(), getCallOptions()), request, responseObserver); } + + /** + *
+     * DagStream is like Dag but with bidirectional streams
+     * 
+ */ + public io.grpc.stub.StreamObserver dagStream( + io.grpc.stub.StreamObserver responseObserver) { + return asyncBidiStreamingCall( + getChannel().newCall(getDagStreamMethod(), getCallOptions()), responseObserver); + } } /** @@ -550,6 +610,7 @@ public com.google.common.util.concurrent.ListenableFuture d private static final int METHODID_P2P = 2; private static final int METHODID_BLOCKSTORE = 3; private static final int METHODID_DAG = 4; + private static final int METHODID_DAG_STREAM = 5; private static final class MethodHandlers implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -598,6 +659,9 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv public io.grpc.stub.StreamObserver invoke( io.grpc.stub.StreamObserver responseObserver) { switch (methodId) { + case METHODID_DAG_STREAM: + return (io.grpc.stub.StreamObserver) serviceImpl.dagStream( + (io.grpc.stub.StreamObserver) responseObserver); default: throw new AssertionError(); } @@ -654,6 +718,7 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .addMethod(getP2PMethod()) .addMethod(getBlockstoreMethod()) .addMethod(getDagMethod()) + .addMethod(getDagStreamMethod()) .build(); } } diff --git a/js/node_grpc_pb.js b/js/node_grpc_pb.js index 52acefb..00e5e54 100644 --- a/js/node_grpc_pb.js +++ b/js/node_grpc_pb.js @@ -180,6 +180,18 @@ var NodeAPIService = exports.NodeAPIService = { responseSerialize: serialize_pb_DagResponse, responseDeserialize: deserialize_pb_DagResponse, }, + // DagStream is like Dag but with bidirectional streams + dagStream: { + path: '/pb.NodeAPI/DagStream', + requestStream: true, + responseStream: true, + requestType: node_pb.DagRequest, + responseType: node_pb.DagResponse, + requestSerialize: serialize_pb_DagRequest, + requestDeserialize: deserialize_pb_DagRequest, + responseSerialize: serialize_pb_DagResponse, + responseDeserialize: deserialize_pb_DagResponse, + }, }; exports.NodeAPIClient = grpc.makeGenericClientConstructor(NodeAPIService); diff --git a/pb/node.proto b/pb/node.proto index 3b533c6..12365c5 100644 --- a/pb/node.proto +++ b/pb/node.proto @@ -16,6 +16,8 @@ service NodeAPI { rpc Blockstore(BlockstoreRequest) returns (BlockstoreResponse) { }; // Dag is a unidirectional rpc allowing manipulation of low-level ipld objects rpc Dag(DagRequest) returns (DagResponse) { }; + // DagStream is like Dag but with bidirectional streams + rpc DagStream(stream DagRequest) returns (stream DagResponse); } // P2PREQTYPE denotes the particular type of request being used in the p2p rpc diff --git a/py/node_pb2.py b/py/node_pb2.py index 964cdfb..bae85fa 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\"a\n\x11\x42lockstoreRequest\x12\x0c\n\x04\x63ids\x18\x01 \x03(\t\x12\x1e\n\x07reqType\x18\x02 \x01(\x0e\x32\r.pb.BSREQTYPE\x12\x1e\n\x07reqOpts\x18\x03 \x01(\x0e\x32\r.pb.BSREQOPTS\"/\n\x12\x42lockstoreResponse\x12\x19\n\x06\x62locks\x18\x01 \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*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\x32\xff\x01\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\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\"a\n\x11\x42lockstoreRequest\x12\x0c\n\x04\x63ids\x18\x01 \x03(\t\x12\x1e\n\x07reqType\x18\x02 \x01(\x0e\x32\r.pb.BSREQTYPE\x12\x1e\n\x07reqOpts\x18\x03 \x01(\x0e\x32\r.pb.BSREQOPTS\"/\n\x12\x42lockstoreResponse\x12\x19\n\x06\x62locks\x18\x01 \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*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\x32\xb1\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\x30\n\tDagStream\x12\x0e.pb.DagRequest\x1a\x0f.pb.DagResponse(\x01\x30\x01\x62\x06proto3') , dependencies=[util__pb2.DESCRIPTOR,]) @@ -1284,7 +1284,7 @@ index=0, serialized_options=None, serialized_start=2212, - serialized_end=2467, + serialized_end=2517, methods=[ _descriptor.MethodDescriptor( name='ConnMgmt', @@ -1331,6 +1331,15 @@ output_type=_DAGRESPONSE, serialized_options=None, ), + _descriptor.MethodDescriptor( + name='DagStream', + full_name='pb.NodeAPI.DagStream', + index=5, + containing_service=None, + input_type=_DAGREQUEST, + output_type=_DAGRESPONSE, + serialized_options=None, + ), ]) _sym_db.RegisterServiceDescriptor(_NODEAPI) diff --git a/py/node_pb2_grpc.py b/py/node_pb2_grpc.py index 3f6bb5f..5c34c2c 100644 --- a/py/node_pb2_grpc.py +++ b/py/node_pb2_grpc.py @@ -40,6 +40,11 @@ def __init__(self, channel): request_serializer=node__pb2.DagRequest.SerializeToString, response_deserializer=node__pb2.DagResponse.FromString, ) + self.DagStream = channel.stream_stream( + '/pb.NodeAPI/DagStream', + request_serializer=node__pb2.DagRequest.SerializeToString, + response_deserializer=node__pb2.DagResponse.FromString, + ) class NodeAPIServicer(object): @@ -83,6 +88,13 @@ def Dag(self, request, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def DagStream(self, request_iterator, context): + """DagStream is like Dag but with bidirectional streams + """ + 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 = { @@ -111,6 +123,11 @@ def add_NodeAPIServicer_to_server(servicer, server): request_deserializer=node__pb2.DagRequest.FromString, response_serializer=node__pb2.DagResponse.SerializeToString, ), + 'DagStream': grpc.stream_stream_rpc_method_handler( + servicer.DagStream, + request_deserializer=node__pb2.DagRequest.FromString, + response_serializer=node__pb2.DagResponse.SerializeToString, + ), } generic_handler = grpc.method_handlers_generic_handler( 'pb.NodeAPI', rpc_method_handlers) diff --git a/ts/node_pb_service.d.ts b/ts/node_pb_service.d.ts index 287dc0f..fc2bb99 100644 --- a/ts/node_pb_service.d.ts +++ b/ts/node_pb_service.d.ts @@ -50,6 +50,15 @@ type NodeAPIDag = { readonly responseType: typeof node_pb.DagResponse; }; +type NodeAPIDagStream = { + readonly methodName: string; + readonly service: typeof NodeAPI; + readonly requestStream: true; + readonly responseStream: true; + readonly requestType: typeof node_pb.DagRequest; + readonly responseType: typeof node_pb.DagResponse; +}; + export class NodeAPI { static readonly serviceName: string; static readonly ConnMgmt: NodeAPIConnMgmt; @@ -57,6 +66,7 @@ export class NodeAPI { static readonly P2P: NodeAPIP2P; static readonly Blockstore: NodeAPIBlockstore; static readonly Dag: NodeAPIDag; + static readonly DagStream: NodeAPIDagStream; } export type ServiceError = { message: string, code: number; metadata: grpc.Metadata } @@ -136,5 +146,6 @@ export class NodeAPIClient { requestMessage: node_pb.DagRequest, callback: (error: ServiceError|null, responseMessage: node_pb.DagResponse|null) => void ): UnaryResponse; + dagStream(metadata?: grpc.Metadata): BidirectionalStream; } diff --git a/ts/node_pb_service.js b/ts/node_pb_service.js index d95b318..11ca9c1 100644 --- a/ts/node_pb_service.js +++ b/ts/node_pb_service.js @@ -56,6 +56,15 @@ NodeAPI.Dag = { responseType: node_pb.DagResponse }; +NodeAPI.DagStream = { + methodName: "DagStream", + service: NodeAPI, + requestStream: true, + responseStream: true, + requestType: node_pb.DagRequest, + responseType: node_pb.DagResponse +}; + exports.NodeAPI = NodeAPI; function NodeAPIClient(serviceHost, options) { @@ -218,5 +227,50 @@ NodeAPIClient.prototype.dag = function dag(requestMessage, metadata, callback) { }; }; +NodeAPIClient.prototype.dagStream = function dagStream(metadata) { + var listeners = { + data: [], + end: [], + status: [] + }; + var client = grpc.client(NodeAPI.DagStream, { + host: this.serviceHost, + metadata: metadata, + transport: this.options.transport + }); + client.onEnd(function (status, statusMessage, trailers) { + listeners.status.forEach(function (handler) { + handler({ code: status, details: statusMessage, metadata: trailers }); + }); + listeners.end.forEach(function (handler) { + handler({ code: status, details: statusMessage, metadata: trailers }); + }); + listeners = null; + }); + client.onMessage(function (message) { + listeners.data.forEach(function (handler) { + handler(message); + }) + }); + client.start(metadata); + return { + on: function (type, handler) { + listeners[type].push(handler); + return this; + }, + write: function (requestMessage) { + client.send(requestMessage); + return this; + }, + end: function () { + client.finishSend(); + }, + cancel: function () { + listeners = null; + client.close(); + } + }; +}; + exports.NodeAPIClient = NodeAPIClient;