https://github.com/amoghk04/hpe-grpc
HPE Career Preview Program Repository for gRPC configuration for VASA/vVols
https://github.com/amoghk04/hpe-grpc
computer-network grpc protobuf3 vsphere
Last synced: about 1 month ago
JSON representation
HPE Career Preview Program Repository for gRPC configuration for VASA/vVols
- Host: GitHub
- URL: https://github.com/amoghk04/hpe-grpc
- Owner: Amoghk04
- License: gpl-3.0
- Created: 2025-02-04T16:51:11.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-26T11:53:57.000Z (over 1 year ago)
- Last Synced: 2025-02-26T12:36:19.935Z (over 1 year ago)
- Topics: computer-network, grpc, protobuf3, vsphere
- Language: C++
- Homepage:
- Size: 28.9 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# HPE-grpc
HPE Career Preview Program Repository for gRPC configuration for VASA/vVols
# Files
- grpc/server.cpp -> The main grpc server file
- grpc/client.cpp -> The main grpc client file
- grpc/service.proto -> The proto file for grpc
- grpc/CMakeLists.txt -> CMake file for building the application
# Installation and Running Steps
It is made to run only on Linux systems, so make sure to have a Linux VM or Linux OS on your system.
### Run the following commands
Clone the repo
```console
git clone https://github.com/Amoghk04/HPE-grpc.git
```
Make sure you have downloaded the protobuf and grpc modules beforehand, else run the below commands
```console
sudo apt update
sudo apt install -y cmake g++ autoconf libtool pkg-config
git clone --recurse-submodules -b v1.70.1 https://github.com/grpc/grpc
cd grpc
mkdir -p cmake/build
cd cmake/build
cmake -DgRPC_BUILD_TESTS=OFF -DCMAKE_INSTALL_PREFIX=/usr/local ../..
make -j$(nproc)
sudo make install
```
After the modules are installed, confirm you have the latest version of protobuf
```console
protoc --version
```
It must be 3.21.12(at the time of writing this readme file), if it is not then run the commands
```console
sudo apt update
sudo apt install -y protobuf-compiler libprotobuf-dev libgrpc++-dev
```
Now build the proto file by going inside the grpc directory and typing the command
```console
protoc --proto_path=. --cpp_out=. --grpc_out=. --plugin=protoc-gen-grpc=`which grpc_cpp_plugin` service.proto
```
This generates
service.pb.h and service.pb.cc (Protobuf messages)
service.grpc.pb.h and service.grpc.pb.cc (gRPC stubs)
Now create a build directory inside /grpc and create the CMake files
```console
mkdir build
cd build
cmake ..
```
After the build is finished, run the below command
```console
make -j$(nproc)
```
Now your server and client are ready to talk via gRPC, start by opening 2 terminals inside the /gRPC/build directory and running
```console
./server
```
and
```console
./client
```