« Back to Index

gRPC: a REAL beginners guide

View original Gist on GitHub

gRPC beginners guide.md

Compiler

The protoc compiler is written in C++ and needs to be built from source:

Note: here details shell dependencies required

Go Example

This generates:

testing-helloworld/
└── helloworld.pb.go

0 directories, 1 file

Note: the client/server you downloaded reference their own pb.go
/src/google.golang.org/grpc/examples/helloworld/helloworld/helloworld.pb.go
If you want, you can create your own client/server code to be sure…

Replace the line:

pb "google.golang.org/grpc/examples/helloworld/helloworld"

With:

pb "github.com/wherever/you/cloned/grpc/examples/testing-helloworld"

Now you should be able to run:

go run testing-server.go

And verify using either the existing Go client you downloaded (see above) or an existing Ruby client (see below).

Ruby Example

Mixing Server and Client

You can mix and match servers and clients.

e.g. have a Go server running with a Ruby client connecting, and vice versa

Custom Services

You’ll find that if you want to write your own proto files and compile them, having the protoc compiler itself is not enough. You also need to build grpc (https://github.com/grpc/grpc/blob/master/INSTALL.md) from source too :-/