A simple demonstration of a gRPC protocol, using a Python client and a Golang server.
Go into the grpc-service
directory and follow the instructions.
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
To convert greet.proto interfaces to gRPC code, run python -m grpc_tools.protoc -I proto --python_out=. --grpc_python_out=. proto/greet.proto
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
Make sure that your system has Go working.
Run the server with go run .