Skip to content

A demo of the gRPC service using a Python client and Go server

Notifications You must be signed in to change notification settings

zerovirus123/grpc-service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 

Repository files navigation

GRPC Service

A simple demonstration of a gRPC protocol, using a Python client and a Golang server.

Instructions

Go into the grpc-service directory and follow the instructions.

Setting up the Client Environment

Create a virtual environment with python -m venv venv

Activate the virtual environment with source venv/bin/activate

Install the dependencies pip install -r requirements.txt

Convert Proto to Client gRPC Code

To convert greet.proto interfaces to gRPC code, run python -m grpc_tools.protoc -I proto --python_out=. --grpc_python_out=. proto/greet.proto

Convert Proto to Server gRPC Code

First install the protocol buffer compiler.

For Linux users, run apt install -y protobuf-compiler.

For Mac users, run brew install protobuf

Windows user can find the binaries at the release page.

Install Go plugins for the protocol buffer compiler go get -u github.com/golang/protobuf/protoc-gen-go

In the Makefile's directory, run make generate-protobuf

Run Server

Make sure that your system has Go working.

Run the server with go run .

About

A demo of the gRPC service using a Python client and Go server

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published