pub(crate) fn main() -> Result<(), Box<dyn Error>>Expand description
Main entry point for the ZKPass client.
Usage
This program starts a client to interact with a server implementing the ZKPass Chaum-Pedersen protocol. It requires command-line arguments to specify its configuration and to perform authentication.
Starting the Client from the Command Line
-
Open Terminal or Command Prompt: Ensure you have a terminal or command prompt window open.
-
Navigate to the Project Directory: Use the
cdcommand to navigate to the directory where the client code is located.cd path/to/project_directory -
Build the Project (if needed): If you haven’t already built your Rust project, build it using the
cargo buildcommand.cargo build -
Run the Client: Start the client using the
cargo runcommand followed by the necessary options.cargo run -- --host <host_address> --port <port_number> --secret <secret_passcode> --user <user_name> --modp <modp_type> --type <protocol_type> --curve <elliptic_curve_type>Replace
<host_address>,<port_number>,<secret_passcode>,<user_name>,<modp_type>,<protocol_type>, and<elliptic_curve_type>with appropriate values.
Command Line Options
--hostor-h: Sets the host address of the ZKPass server. Defaults to “[::1]” if not specified.--portor-p: Sets the port number of the ZKPass server. Defaults to 50051 if not specified.--secretor-s: Sets the secret passcode for authentication. Optional.--useror-u: Sets the username for authentication. Defaults to “foo” if not specified.--modpor-m: Sets the type of the RFC log group to use. Required if--typeis “discrete_log”.--typeor-t: Sets the type of the Chaum-Pedersen protocol to use. Possible values: “discrete_log”, “elliptic_curve”.--curveor-c: Sets the elliptic curve type. Required if--typeis “elliptic_curve”.
Example Usage
To connect to a server on localhost, port 50051, using the elliptic curve protocol with user “alice”:
cargo run -- --host [::1] --port 50051 --user alice --type elliptic_curve --curve ec25519
Remember to replace the values in the command with those suitable for your setup, and that the server must be serving the same protocol (type, modp, curve) as the client.