Build both the server and the client with the cargo build subcommand.
If you want to specify binary, use the --bin parameter with the name of a binary.
Also, you can use cargo watch tool for building.
If you use the cargo watch tool, then the build.rs script will generate files with gRPC types and watch will continuously restart the build. To prevent this, you can set the --ignore argument to the command with a pattern of files' names to ignore. For our example, we have to run the cargo watch --ignore 'src/ring*' command.
When both binaries are built, run three instances in separate terminals:
RUST_LOG=grpc_ring=trace ADDRESS=127.0.0.1:4444 NEXT=127.0.0.1:5555 target/debug/grpc-ring
RUST_LOG=grpc_ring=trace ADDRESS=127.0.0.1:5555 NEXT=127.0.0.1:6666 target/debug/grpc-ring
RUST_LOG=grpc_ring=trace ADDRESS=127.0.0.1:6666 NEXT=127.0.0.1:4444 target/debug/grpc-ring
When all of the services start, use a client to send a request to the first service:
NEXT=127.0.0.1:4444 target/debug/grpc-ring-client
This command will call a remote method, start_roll_call, and you will see similar server logs to what you saw in the preceding JSON-RPC example.