How to communicate with Neo via gRPC in Go

How to communicate with Neo via gRPC in Go

πŸ“Œ
For smooth practice, the following query should be run to prepare tables and data.
CREATE TAG TABLE IF NOT EXISTS EXAMPLE (
    NAME VARCHAR(20) PRIMARY KEY,
    TIME DATETIME BASETIME,
    VALUE DOUBLE SUMMARIZED
);

gRPC version of wave generator example is also available. Since it doesn’t need to define custom data structures for payload, relatively less lines of code are needed comparing to HTTP.

Step 1.

Create directory grpc_wave

mkdir grpc_wave && cd grpc_wave

Step 2.

Find full source code from github

Step 3.

Copy source code and save it as grpc_wave.go or run script below in the directory.

curl -o grpc_wave.go "https://raw.githubusercontent.com/machbase/neo-docs/main/examples/go/grpc_wave/grpc_wave.go"

Step 4.

Initialize go mod and prepare dependent modules.

go mod init wave && go mod tidy

Step 5.

go run .
Last updated on