Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

examples: fix errors when running Golang example #443

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 23 additions & 7 deletions examples/golang/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,43 @@ This example can contains errors or be behind of the latest stable version, plea

This is a sample golang client for the Solana gRPC interface.

Requires golang 1.17
Requires golang 1.21

Sample usage:

```
go1.17 run ./cmd/grpc-client/ -endpoint https://api.rpcpool.com:443 -x-token <token> -slots
go run ./cmd/grpc-client/ -endpoint https://api.rpcpool.com:443 -x-token <token> -slots
```

You can also make non SSL connections:

```
go1.17 run ./cmd/grpc-client/ -endpoint http://api.rpcpool.com:80 -x-token <token> -blocks
````
go run ./cmd/grpc-client/ -endpoint http://api.rpcpool.com:80 -x-token <token> -blocks
```

## Updating protofiles

Make sure you have protoc installed for go:
Make sure you have protoc installed:

```bash
$ protoc --version
libprotoc 28.3
```

And the golang plugins:

```bash
$ go list -f '{{.Path}} {{.Version}}' -m google.golang.org/protobuf
google.golang.org/protobuf v1.35.1
$ go list -f '{{.Path}} {{.Version}}' -m google.golang.org/grpc
google.golang.org/grpc v1.67.1
```

If you don't have the protobuf go plugins installed, you can install them with:

```
$ go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28
$ go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2
$ go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.35.1
$ go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.5.1
```

If you have `dnf` package manager:
Expand Down
15 changes: 7 additions & 8 deletions examples/golang/go.mod
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
module github.com/rpcpool/yellowstone-grpc/examples/golang

go 1.17
go 1.21

require (
golang.org/x/net v0.5.0 // indirect
google.golang.org/genproto v0.0.0-20230202175211-008b39050e57 // indirect
google.golang.org/grpc v1.52.3
google.golang.org/protobuf v1.28.1
google.golang.org/grpc v1.67.1
google.golang.org/protobuf v1.35.1
)

require (
github.com/golang/protobuf v1.5.2 // indirect
golang.org/x/sys v0.4.0 // indirect
golang.org/x/text v0.6.0 // indirect
golang.org/x/net v0.28.0 // indirect
golang.org/x/sys v0.24.0 // indirect
golang.org/x/text v0.17.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 // indirect
)
Loading