1. 安装依赖(rust 基本依赖就不说了,须要配置环境变量)git
protoc 参考: https://github.com/google/protobuf/releases/tag/v3.5.1
https://github.com/rongfengliang/grpc-rustdemo
a. 项目clone git clone https://github.com/rongfengliang/grpc-rustdemo b.依赖包下载 cargo update && cargo build c. 构建 client: cd src/bin cargo build --bin client --release server: cd src/bin cargo build --bin server --release d. 运行(由于项目代码使用了docker-compose 须要进行本地host,也能够修改代码) cd target/release 先运行server 后运行client 备注: host 修改 127.0.0.1 rpcserver
docker-compose build 具体dockerfile docker-compose.yml 能够参考源码,都是比较简单的
https://github.com/rongfengliang/grpc-rustdemo