python voting_server.py
python voting_client.py
The client calls the gRPC stub method, which sends a proto request to the server, and then the client checks if the response value is correct.
We chose python as the programming language for this project.
The gRPC tool generates the basic servicer class from the project proto file and we need to implement the derived classes of the basic servicer.
The client just calls the gRPC stub directly.
The client just calls the gRPC stub directly, and then the client checks if the response value is expected value.
# PreAuth
response = stub.PreAuth(voting_pb2.VoterName(name='Client'))
if response.value == b'00001':
print("PreAuth successful")
else:
print("PreAuth failed")