turtle11311 / fault-tolerance-pr1

fault-tolerance NYCU 2021 semester 1 project1

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

fault-tolerance NYCU 2021 semester 1 project1

License:MIT License


Languages

Language:Python 100.0%