Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrbrt committed Nov 18, 2024
1 parent 1722c18 commit 28c7ddf
Show file tree
Hide file tree
Showing 10 changed files with 118 additions and 44 deletions.
2 changes: 1 addition & 1 deletion client/grpc/cmtservice/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ func (s queryServer) ABCIQuery(ctx context.Context, req *ABCIQueryRequest) (*ABC
func RegisterTendermintService(
clientCtx client.Context,
server gogogrpc.Server,
iRegistry codectypes.InterfaceRegistry,
_ codectypes.InterfaceRegistry,
queryFn abciQueryFn,
) {
node, err := clientCtx.GetNode()
Expand Down
10 changes: 7 additions & 3 deletions server/v2/api/grpc/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func New[T transaction.Tx](
interfaceRegistry server.InterfaceRegistry,
queryHandlers map[string]appmodulev2.Handler,
queryable func(ctx context.Context, version uint64, msg transaction.Msg) (transaction.Msg, error),
extraGRPCHandlers []func(*grpc.Server),
extraGRPCHandlers []func(*grpc.Server) error,
cfg server.ConfigMap,
cfgOptions ...CfgOption,
) (*Server[T], error) {
Expand All @@ -70,7 +70,7 @@ func New[T transaction.Tx](
grpc.UnknownServiceHandler(makeUnknownServiceHandler(queryHandlers, queryable)),
)

// register V2 grpc handlers
// register grpc query handler v2
RegisterServiceServer(grpcSrv, &v2Service{queryHandlers, queryable})

// register node service
Expand All @@ -80,8 +80,12 @@ func New[T transaction.Tx](
gogoreflection.Register(grpcSrv, slices.Collect(maps.Keys(queryHandlers)), logger.With("sub-module", "grpc-reflection"))

// register extra handlers on the grpc server
var err error
for _, fn := range extraGRPCHandlers {
fn(grpcSrv)
err = errors.Join(err, fn(grpcSrv))
}
if err != nil {
return nil, fmt.Errorf("failed to register extra gRPC handlers: %w", err)
}

srv.grpcSrv = grpcSrv
Expand Down
2 changes: 1 addition & 1 deletion server/v2/cometbft/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ func (c *Consensus[T]) Query(ctx context.Context, req *abciproto.QueryRequest) (
resp, err = c.handlerQueryApp(ctx, path, req)

case QueryPathStore:
resp, err = c.handleQueryStore(path, c.store, req)
resp, err = c.handleQueryStore(path, req)

case QueryPathP2P:
resp, err = c.handleQueryP2P(path)
Expand Down
1 change: 0 additions & 1 deletion server/v2/cometbft/client/grpc/service.go

This file was deleted.

13 changes: 12 additions & 1 deletion server/v2/cometbft/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ require (
github.com/spf13/cobra v1.8.1
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.9.0
google.golang.org/grpc v1.68.0
google.golang.org/protobuf v1.35.2
sigs.k8s.io/yaml v1.4.0
)
Expand All @@ -54,7 +55,9 @@ require (
filippo.io/edwards25519 v1.1.0 // indirect
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect
github.com/99designs/keyring v1.2.2 // indirect
github.com/DataDog/datadog-go v4.8.3+incompatible // indirect
github.com/DataDog/zstd v1.5.5 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bgentry/speakeasy v0.2.0 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.4 // indirect
Expand All @@ -74,6 +77,7 @@ require (
github.com/cosmos/cosmos-proto v1.0.0-beta.5 // indirect
github.com/cosmos/crypto v0.1.2 // indirect
github.com/cosmos/go-bip39 v1.0.0 // indirect
github.com/cosmos/gogogateway v1.2.0 // indirect
github.com/cosmos/iavl v1.3.1 // indirect
github.com/cosmos/ics23/go v0.11.0 // indirect
github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect
Expand All @@ -86,12 +90,14 @@ require (
github.com/dvsekhvalnov/jose2go v1.6.0 // indirect
github.com/emicklei/dot v1.6.2 // indirect
github.com/fatih/color v1.18.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/fsnotify/fsnotify v1.8.0 // indirect
github.com/getsentry/sentry-go v0.27.0 // indirect
github.com/go-kit/kit v0.13.0 // indirect
github.com/go-kit/log v0.2.1 // indirect
github.com/go-logfmt/logfmt v0.6.0 // indirect
github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect
github.com/gogo/googleapis v1.4.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.4 // indirect
Expand All @@ -101,7 +107,10 @@ require (
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/orderedcode v0.0.1 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gorilla/handlers v1.5.2 // indirect
github.com/gorilla/mux v1.8.1 // indirect
github.com/gorilla/websocket v1.5.3 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect
github.com/hashicorp/go-hclog v1.6.3 // indirect
Expand All @@ -113,6 +122,7 @@ require (
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/hashicorp/yamux v0.1.2 // indirect
github.com/hdevalence/ed25519consensus v0.2.0 // indirect
github.com/huandu/skiplist v1.2.1 // indirect
github.com/iancoleman/strcase v0.3.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jmhodges/levigo v1.0.0 // indirect
Expand Down Expand Up @@ -167,15 +177,16 @@ require (
golang.org/x/arch v0.12.0 // indirect
golang.org/x/crypto v0.29.0 // indirect
golang.org/x/exp v0.0.0-20240531132922-fd00a4e0eefc // indirect
golang.org/x/mod v0.18.0 // indirect
golang.org/x/net v0.30.0 // indirect
golang.org/x/sync v0.9.0 // indirect
golang.org/x/sys v0.27.0 // indirect
golang.org/x/term v0.26.0 // indirect
golang.org/x/text v0.20.0 // indirect
golang.org/x/tools v0.22.0 // indirect
google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect
google.golang.org/grpc v1.68.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
gotest.tools/v3 v3.5.1 // indirect
Expand Down
Loading

0 comments on commit 28c7ddf

Please sign in to comment.