gRPC Pack
Simpler use of grpc in Node.js.
Install
$ npm install grpc-pack or yarn add grpc-pack
Usage
Single Proto
-
Model and Service
syntax = "proto3";package service;service Greetermessage Namemessage Message
Server
const
Client
const
Separate Proto Model and Service
-
Service
syntax="proto3";package service;option go_package = "github.com/zoobc/zoobc-core/common/service";import "model/block.proto";import "google/api/annotations.proto";// BlockService represent request on Blockchain's Blockservice BlockService {rpc GetBlocks(model.GetBlocksRequest) returns (model.GetBlocksResponse) {option (google.api.http) = {get: "/v1/block/GetBlocks"};}} -
Model
// Block represent the block data structure stored in the databasemessage Block// BlockExtendedInfo represent the Block data plus part of block data not to be persisted to databasemessage BlockExtendedInfo// GetBlocksRequest create request to get a list blockmessage GetBlocksRequestmessage GetBlocksResponse
Server
const
Client
const
License
This project is licensed under the MIT License - see the LICENSE file for details