/fault-tolerance-pr1

fault-tolerance NYCU 2021 semester 1 project1

Primary LanguagePythonMIT LicenseMIT

Online Electronic Voting – Part I. RPC Interface

How to run server

python voting_server.py

How to run client

python voting_client.py

The Design

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. design diagram

Implemtentation

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. Servicer UML

The client just calls the gRPC stub directly.

Evaluation

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")