Skip to content

Commit

Permalink
examples: update golang version (#443)
Browse files Browse the repository at this point in the history
Co-authored-by: gagliardetto <[email protected]>
  • Loading branch information
mhughdo and gagliardetto authored Oct 24, 2024
1 parent 5096395 commit 348b67a
Show file tree
Hide file tree
Showing 6 changed files with 282 additions and 2,074 deletions.
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

0 comments on commit 348b67a

Please sign in to comment.