- go1.18.3
- gRPC
- Protocol Buffer : libprotoc 3.21.1
- grpcurl.exe dev build
- GNU Make 4.3
To get a local copy up and running follow these simple steps.
- Clone the repo
git clone https://github.com/rafiulhc/grpc-blockchain-endpoints.git
- Install required packages mentioned above
make grpc
MAC or Linux
./bin/grpc/server
for windows
./bin/grpc/server.exe
MAC or Linux
./bin/grpc/client
for windows
./bin/grpc/client.exe
grpcurl -plaintext localhost:50051 list
grpcurl -plaintext localhost:50051 list grpc.GetLatestBlockService
grpcurl -plaintext localhost:50051 describe grpc.GetLatestBlockService.GetLatestBlock
Invoking an RPC on a trusted server (e.g. TLS without self-signed key or custom CA) that requires no client certs and supports server reflection is the simplest thing to do with grpcurl. This minimal invocation sends an empty request body:
grpcurl -plaintext localhost:50051 grpc.GetLatestBlockService.GetLatestBlock
go test
After running the command in terminal if block from gRPC call and direct API call match, should show the tests results....
None
Rafiul Hasan - Linkedin Twitter - rafiul.hasan.chowdhury@gmail.com
Project Link: https://github.com/rafiulhc/grpc-blockchain-endpoints