#!/bin/sh echo "0. Ensure that protoc is installed." if which protoc; then echo "OK" else echo "Please install protoc and be sure that it is in your search path." exit fi echo "1. Set gopath and search path" export GOPATH=`pwd`/go export PATH=$GOPATH/bin:$PATH echo "2. Get the Go plugin for protoc" go get -a github.com/golang/protobuf/protoc-gen-go echo "3. Run protoc to generate the service API code" mkdir -p go/src/echo protoc ../echo.proto --proto_path=.. --go_out=plugins=grpc:go/src/echo echo "4. Get the server and client dependencies" go get server go get client echo "5. Build the server and client" go build server go build client echo "6. Stop any previously-running instances of the server" killall server echo "7. Start the server" ./server & echo "8. Run the client" sleep 1 # give the server some time to start ./client -m "Remember the milk." ./client -m "Testing" -n 3 -update