Skip to content

Commit

Permalink
fix: update proto stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
winprn committed Dec 17, 2024
1 parent 7fafcce commit c9d6a38
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 24 deletions.
56 changes: 36 additions & 20 deletions packages/node/src/proto/drp/node/v1/rpc_grpc_pb.js
Original file line number Diff line number Diff line change
@@ -1,62 +1,78 @@
import * as node_src_proto_rpc_pb from './rpc_pb.js';

function serialize_drp_node_GetDRPHashGraphRequest(arg) {
let encoded = node_src_proto_rpc_pb.GetDRPHashGraphRequest.encode(arg).finish()
return Buffer.from(encoded);
let encoded =
node_src_proto_rpc_pb.GetDRPHashGraphRequest.encode(arg).finish();
return Buffer.from(encoded);
}

function deserialize_drp_node_GetDRPHashGraphRequest(buffer_arg) {
return node_src_proto_rpc_pb.GetDRPHashGraphRequest.decode(new Uint8Array(buffer_arg));
return node_src_proto_rpc_pb.GetDRPHashGraphRequest.decode(
new Uint8Array(buffer_arg)
);
}

function serialize_drp_node_GetDRPHashGraphResponse(arg) {
let encoded = node_src_proto_rpc_pb.GetDRPHashGraphResponse.encode(arg).finish()
return Buffer.from(encoded);
let encoded =
node_src_proto_rpc_pb.GetDRPHashGraphResponse.encode(arg).finish();
return Buffer.from(encoded);
}

function deserialize_drp_node_GetDRPHashGraphResponse(buffer_arg) {
return node_src_proto_rpc_pb.GetDRPHashGraphResponse.decode(new Uint8Array(buffer_arg));
return node_src_proto_rpc_pb.GetDRPHashGraphResponse.decode(
new Uint8Array(buffer_arg)
);
}

function serialize_drp_node_SubscribeDRPRequest(arg) {
let encoded = node_src_proto_rpc_pb.SubscribeDRPRequest.encode(arg).finish()
return Buffer.from(encoded);
let encoded = node_src_proto_rpc_pb.SubscribeDRPRequest.encode(arg).finish();
return Buffer.from(encoded);
}

function deserialize_drp_node_SubscribeDRPRequest(buffer_arg) {
return node_src_proto_rpc_pb.SubscribeDRPRequest.decode(new Uint8Array(buffer_arg));
return node_src_proto_rpc_pb.SubscribeDRPRequest.decode(
new Uint8Array(buffer_arg)
);
}

function serialize_drp_node_SubscribeDRPResponse(arg) {
let encoded = node_src_proto_rpc_pb.SubscribeDRPResponse.encode(arg).finish()
let encoded = node_src_proto_rpc_pb.SubscribeDRPResponse.encode(arg).finish();
return Buffer.from(encoded);
}

function deserialize_drp_node_SubscribeDRPResponse(buffer_arg) {
return node_src_proto_rpc_pb.SubscribeDRPResponse.decode(new Uint8Array(buffer_arg));
return node_src_proto_rpc_pb.SubscribeDRPResponse.decode(
new Uint8Array(buffer_arg)
);
}

function serialize_drp_node_UnsubscribeDRPRequest(arg) {
let encoded = node_src_proto_rpc_pb.UnsubscribeDRPRequest.encode(arg).finish()
return Buffer.from(encoded);
let encoded =
node_src_proto_rpc_pb.UnsubscribeDRPRequest.encode(arg).finish();
return Buffer.from(encoded);
}

function deserialize_drp_node_UnsubscribeDRPRequest(buffer_arg) {
return node_src_proto_rpc_pb.UnsubscribeDRPRequest.decode(new Uint8Array(buffer_arg));
return node_src_proto_rpc_pb.UnsubscribeDRPRequest.decode(
new Uint8Array(buffer_arg)
);
}

function serialize_drp_node_UnsubscribeDRPResponse(arg) {
let encoded = node_src_proto_rpc_pb.UnsubscribeDRPResponse.encode(arg).finish()
return Buffer.from(encoded);
let encoded =
node_src_proto_rpc_pb.UnsubscribeDRPResponse.encode(arg).finish();
return Buffer.from(encoded);
}

function deserialize_drp_node_UnsubscribeDRPResponse(buffer_arg) {
return node_src_proto_rpc_pb.UnsubscribeDRPResponse.decode(new Uint8Array(buffer_arg));
return node_src_proto_rpc_pb.UnsubscribeDRPResponse.decode(
new Uint8Array(buffer_arg)
);
}

export const DRPRpcService = {
subscribeDRP: {
path: '/drp.node.drpRpc/subscribeDRP',
path: '/drp.node.v1.DrpRpcService/SubscribeDRP',
requestStream: false,
responseStream: false,
requestType: node_src_proto_rpc_pb.SubscribeDRPRequest,
Expand All @@ -67,7 +83,7 @@ export const DRPRpcService = {
responseDeserialize: deserialize_drp_node_SubscribeDRPResponse,
},
unsubscribeDRP: {
path: '/drp.node.drpRpc/unsubscribeDRP',
path: '/drp.node.v1.DrpRpcService/UnsubscribeDRP',
requestStream: false,
responseStream: false,
requestType: node_src_proto_rpc_pb.UnsubscribeDRPRequest,
Expand All @@ -78,7 +94,7 @@ export const DRPRpcService = {
responseDeserialize: deserialize_drp_node_UnsubscribeDRPResponse,
},
getDRPHashGraph: {
path: '/drp.node.drpRpc/getDRPHashGraph',
path: '/drp.node.v1.DrpRpcService/GetDRPHashGraph',
requestStream: false,
responseStream: false,
requestType: node_src_proto_rpc_pb.GetDRPHashGraphRequest,
Expand Down
9 changes: 5 additions & 4 deletions packages/node/src/rpc/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ import type {
UnsubscribeDRPRequest,
UnsubscribeDRPResponse,
} from "../proto/drp/node/v1/rpc_pb.js";
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
const PROTO_PATH = path.resolve(__dirname, "../proto/topology/node/rpc.proto");

export function init(node: DRPNode) {
function subscribeDRP(
Expand Down Expand Up @@ -77,7 +74,11 @@ export function init(node: DRPNode) {
callback(null, response);
}

const packageDefinition = protoLoader.loadSync(PROTO_PATH);
const protoPath = path.resolve(
dirname(fileURLToPath(import.meta.url)),
"../proto/drp/node/v1/rpc.proto",
);
const packageDefinition = protoLoader.loadSync(protoPath);
const reflectionService = new reflection.ReflectionService(packageDefinition);

const server = new grpc.Server();
Expand Down

0 comments on commit c9d6a38

Please sign in to comment.