35 lines
		
	
	
		
			841 B
		
	
	
	
		
			Markdown
		
	
	
	
	
	
			
		
		
	
	
			35 lines
		
	
	
		
			841 B
		
	
	
	
		
			Markdown
		
	
	
	
	
	
| # BDChain gRPC API 指南
 | |
| 
 | |
| ## 编译 Go 版本 gRPC
 | |
| 
 | |
| ### 安装
 | |
| 
 | |
| - [Protocol Buffers 3](https://github.com/protocolbuffers/protobuf/releases)
 | |
|   - 下载对应版本,并将可执行程序 `protoc` 的目录加入到环境变量 `PATH` 中
 | |
| - Go > 1.6
 | |
|     ```bash
 | |
|     # 安装 Go 版本相关插件
 | |
|     go get -u google.golang.org/grpc
 | |
|     go get -u github.com/golang/protobuf/protoc-gen-go
 | |
|     ```
 | |
| - Node.js
 | |
|     ```bash
 | |
|     npm install -g grpc-tools
 | |
|     ```
 | |
| - Web
 | |
|     ```bash
 | |
|     git clone https://github.com/grpc/grpc-web
 | |
|     cd grpc-web
 | |
|     sudo make install-plugin
 | |
|     ```
 | |
| 
 | |
| 参考资料:
 | |
| 
 | |
| - [Go Quick Start](https://grpc.io/docs/quickstart/go.html#prerequisites)
 | |
| - [gRPC Go FAQ](https://github.com/grpc/grpc-go#faq)
 | |
| 
 | |
| ### 编译
 | |
| 
 | |
| - 在本项目打开控制台,或者切换工作路径到本项目
 | |
| - 执行 `./scripts/gen-{{platform}}`
 |