From e695832b8df562a92761e469e5d57310e79b5600 Mon Sep 17 00:00:00 2001 From: lkh1434 Date: Tue, 20 Feb 2024 16:50:07 +0900 Subject: [PATCH] add querier --- cmd/osmosisd/cmd/decoder/decode_server.go | 45 +++ cmd/osmosisd/cmd/decoder/decoder.go | 84 ++++++ cmd/osmosisd/cmd/decoder/decoder.pb.go | 308 ++++++++++++++++++++ cmd/osmosisd/cmd/decoder/decoder.proto | 24 ++ cmd/osmosisd/cmd/decoder/decoder_grpc.pb.go | 109 +++++++ cmd/osmosisd/cmd/root.go | 1 + go.mod | 2 +- go.work | 2 + 8 files changed, 574 insertions(+), 1 deletion(-) create mode 100644 cmd/osmosisd/cmd/decoder/decode_server.go create mode 100644 cmd/osmosisd/cmd/decoder/decoder.go create mode 100644 cmd/osmosisd/cmd/decoder/decoder.pb.go create mode 100644 cmd/osmosisd/cmd/decoder/decoder.proto create mode 100644 cmd/osmosisd/cmd/decoder/decoder_grpc.pb.go diff --git a/cmd/osmosisd/cmd/decoder/decode_server.go b/cmd/osmosisd/cmd/decoder/decode_server.go new file mode 100644 index 00000000000..5fa72736b4d --- /dev/null +++ b/cmd/osmosisd/cmd/decoder/decode_server.go @@ -0,0 +1,45 @@ +package cmd + +// DONTCOVER + +import ( + "fmt" + + "github.com/spf13/cobra" + + "github.com/osmosis-labs/osmosis/v23/app" + "github.com/osmosis-labs/osmosis/v23/cmd/osmosisd/cmd/decoder" +) + +const ( + decodeServerPort = "decodeServerPort" +) + +// decoderCmd gets cmd to run decode server +func decoderCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "decoder", + Short: "Example osmosisd decode -p 8888, which would run decoder server on specified port", + Long: "decoder command runs decoder server to decode byte array to General Cosmos messages", + RunE: func(cmd *cobra.Command, args []string) error { + decodeServerFlag, err := cmd.Flags().GetString(decodeServerPort) + if err != nil { + return err + } + + d := decoder.Decoder{ + EncodingConfig: app.MakeEncodingConfig(), + } + err = d.ListenAndServe(decodeServerFlag) + if err != nil { + fmt.Println(err) + return err + } + return nil + }, + } + + cmd.Flags().StringP(decodeServerPort, "p", "", "port to listen to") + cmd.MarkFlagRequired(decodeServerPort) + return cmd +} diff --git a/cmd/osmosisd/cmd/decoder/decoder.go b/cmd/osmosisd/cmd/decoder/decoder.go new file mode 100644 index 00000000000..f1a370cb66f --- /dev/null +++ b/cmd/osmosisd/cmd/decoder/decoder.go @@ -0,0 +1,84 @@ +package decoder + +import ( + "context" + "fmt" + "log" + "net" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/gogoproto/jsonpb" + "google.golang.org/grpc" + + "github.com/osmosis-labs/osmosis/v23/app/params" +) + +type Decoder struct { + EncodingConfig params.EncodingConfig +} + +func (d *Decoder) ListenAndServe(port string) error { + lis, err := net.Listen("tcp", fmt.Sprintf("0.0.0.0:%s", port)) + if err != nil { + log.Fatalf("failed to listen: %v", err) + return err + } + var opts []grpc.ServerOption + grpcServer := grpc.NewServer(opts...) + RegisterCosmosDecoderServer(grpcServer, d) + return grpcServer.Serve(lis) +} + +func (d *Decoder) mustEmbedUnimplementedCosmosDecoderServer() { + panic("Forward-compatibility: Unknown method!") +} + +func (d *Decoder) Decode(ctx context.Context, request *DecodeRequest) (*DecodeResponse, error) { + cosmosTx, err := d.EncodingConfig.TxConfig.TxDecoder()(request.TxByte) + + if err != nil { + fmt.Println(err) + return nil, err + } + jsonpbMarshaller := jsonpb.Marshaler{} + + var msgs []*GeneralCosmosMsg + + for _, msg := range cosmosTx.GetMsgs() { + msgString, err := jsonpbMarshaller.MarshalToString(msg) + if err != nil { + return nil, err + } + msgType := sdk.MsgTypeURL(msg) + + msgs = append(msgs, &GeneralCosmosMsg{ + Type: msgType, + Message: msgString, + Signers: getSliceFromAccAddress(msg.GetSigners()), + }) + } + + resultString, err := d.EncodingConfig.TxConfig.TxJSONEncoder()(cosmosTx) + + if err != nil { + return nil, err + } + + return &DecodeResponse{ + TxResult: string(resultString), + Msgs: msgs, + }, nil +} + +func getSliceFromAccAddress(addrs []sdk.AccAddress) []string { + var results []string + sMap := map[string]string{} + for _, s := range addrs { + if _, ok := sMap[s.String()]; ok { + continue + } + sMap[s.String()] = "exists" + results = append(results, s.String()) + } + return results +} diff --git a/cmd/osmosisd/cmd/decoder/decoder.pb.go b/cmd/osmosisd/cmd/decoder/decoder.pb.go new file mode 100644 index 00000000000..4c636ffa961 --- /dev/null +++ b/cmd/osmosisd/cmd/decoder/decoder.pb.go @@ -0,0 +1,308 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc v4.24.3 +// source: decoder.proto + +package decoder + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type GeneralCosmosMsg struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + Signers []string `protobuf:"bytes,3,rep,name=signers,proto3" json:"signers,omitempty"` +} + +func (x *GeneralCosmosMsg) Reset() { + *x = GeneralCosmosMsg{} + if protoimpl.UnsafeEnabled { + mi := &file_decoder_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GeneralCosmosMsg) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GeneralCosmosMsg) ProtoMessage() {} + +func (x *GeneralCosmosMsg) ProtoReflect() protoreflect.Message { + mi := &file_decoder_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GeneralCosmosMsg.ProtoReflect.Descriptor instead. +func (*GeneralCosmosMsg) Descriptor() ([]byte, []int) { + return file_decoder_proto_rawDescGZIP(), []int{0} +} + +func (x *GeneralCosmosMsg) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *GeneralCosmosMsg) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +func (x *GeneralCosmosMsg) GetSigners() []string { + if x != nil { + return x.Signers + } + return nil +} + +type DecodeRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TxByte []byte `protobuf:"bytes,1,opt,name=txByte,proto3" json:"txByte,omitempty"` +} + +func (x *DecodeRequest) Reset() { + *x = DecodeRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_decoder_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DecodeRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DecodeRequest) ProtoMessage() {} + +func (x *DecodeRequest) ProtoReflect() protoreflect.Message { + mi := &file_decoder_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DecodeRequest.ProtoReflect.Descriptor instead. +func (*DecodeRequest) Descriptor() ([]byte, []int) { + return file_decoder_proto_rawDescGZIP(), []int{1} +} + +func (x *DecodeRequest) GetTxByte() []byte { + if x != nil { + return x.TxByte + } + return nil +} + +type DecodeResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Msgs []*GeneralCosmosMsg `protobuf:"bytes,1,rep,name=msgs,proto3" json:"msgs,omitempty"` + TxResult string `protobuf:"bytes,2,opt,name=txResult,proto3" json:"txResult,omitempty"` +} + +func (x *DecodeResponse) Reset() { + *x = DecodeResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_decoder_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DecodeResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DecodeResponse) ProtoMessage() {} + +func (x *DecodeResponse) ProtoReflect() protoreflect.Message { + mi := &file_decoder_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DecodeResponse.ProtoReflect.Descriptor instead. +func (*DecodeResponse) Descriptor() ([]byte, []int) { + return file_decoder_proto_rawDescGZIP(), []int{2} +} + +func (x *DecodeResponse) GetMsgs() []*GeneralCosmosMsg { + if x != nil { + return x.Msgs + } + return nil +} + +func (x *DecodeResponse) GetTxResult() string { + if x != nil { + return x.TxResult + } + return "" +} + +var File_decoder_proto protoreflect.FileDescriptor + +var file_decoder_proto_rawDesc = []byte{ + 0x0a, 0x0d, 0x64, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x07, 0x64, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x72, 0x22, 0x5a, 0x0a, 0x10, 0x47, 0x65, 0x6e, 0x65, + 0x72, 0x61, 0x6c, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x4d, 0x73, 0x67, 0x12, 0x12, 0x0a, 0x04, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x69, + 0x67, 0x6e, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x73, 0x69, 0x67, + 0x6e, 0x65, 0x72, 0x73, 0x22, 0x27, 0x0a, 0x0d, 0x44, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x78, 0x42, 0x79, 0x74, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x74, 0x78, 0x42, 0x79, 0x74, 0x65, 0x22, 0x5b, 0x0a, + 0x0e, 0x44, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x2d, 0x0a, 0x04, 0x6d, 0x73, 0x67, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, + 0x64, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x43, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x4d, 0x73, 0x67, 0x52, 0x04, 0x6d, 0x73, 0x67, 0x73, 0x12, 0x1a, + 0x0a, 0x08, 0x74, 0x78, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x74, 0x78, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x32, 0x4c, 0x0a, 0x0d, 0x43, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x44, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x72, 0x12, 0x3b, 0x0a, 0x06, 0x44, + 0x65, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x2e, 0x64, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x72, 0x2e, + 0x44, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, + 0x64, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x3e, 0x5a, 0x3c, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x69, 0x73, 0x2d, 0x6c, + 0x61, 0x62, 0x73, 0x2f, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x69, 0x73, 0x2f, 0x76, 0x32, 0x33, 0x2f, + 0x63, 0x6d, 0x64, 0x2f, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x69, 0x73, 0x64, 0x2f, 0x63, 0x6d, 0x64, + 0x2f, 0x64, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_decoder_proto_rawDescOnce sync.Once + file_decoder_proto_rawDescData = file_decoder_proto_rawDesc +) + +func file_decoder_proto_rawDescGZIP() []byte { + file_decoder_proto_rawDescOnce.Do(func() { + file_decoder_proto_rawDescData = protoimpl.X.CompressGZIP(file_decoder_proto_rawDescData) + }) + return file_decoder_proto_rawDescData +} + +var file_decoder_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_decoder_proto_goTypes = []interface{}{ + (*GeneralCosmosMsg)(nil), // 0: decoder.GeneralCosmosMsg + (*DecodeRequest)(nil), // 1: decoder.DecodeRequest + (*DecodeResponse)(nil), // 2: decoder.DecodeResponse +} +var file_decoder_proto_depIdxs = []int32{ + 0, // 0: decoder.DecodeResponse.msgs:type_name -> decoder.GeneralCosmosMsg + 1, // 1: decoder.CosmosDecoder.Decode:input_type -> decoder.DecodeRequest + 2, // 2: decoder.CosmosDecoder.Decode:output_type -> decoder.DecodeResponse + 2, // [2:3] is the sub-list for method output_type + 1, // [1:2] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_decoder_proto_init() } +func file_decoder_proto_init() { + if File_decoder_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_decoder_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GeneralCosmosMsg); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_decoder_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DecodeRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_decoder_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DecodeResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_decoder_proto_rawDesc, + NumEnums: 0, + NumMessages: 3, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_decoder_proto_goTypes, + DependencyIndexes: file_decoder_proto_depIdxs, + MessageInfos: file_decoder_proto_msgTypes, + }.Build() + File_decoder_proto = out.File + file_decoder_proto_rawDesc = nil + file_decoder_proto_goTypes = nil + file_decoder_proto_depIdxs = nil +} diff --git a/cmd/osmosisd/cmd/decoder/decoder.proto b/cmd/osmosisd/cmd/decoder/decoder.proto new file mode 100644 index 00000000000..45b1f633503 --- /dev/null +++ b/cmd/osmosisd/cmd/decoder/decoder.proto @@ -0,0 +1,24 @@ +syntax = "proto3"; +package decoder; + +option go_package = "github.com/osmosis-labs/osmosis/v23/cmd/osmosisd/cmd/decoder"; + +message GeneralCosmosMsg { + string type = 1; + string message = 2; + repeated string signers = 3; +} + +message DecodeRequest { + bytes txByte = 1; +} + +message DecodeResponse { + repeated GeneralCosmosMsg msgs = 1; + string txResult = 2; +} + +// Service proto +service CosmosDecoder { + rpc Decode(DecodeRequest) returns (DecodeResponse) {} +} \ No newline at end of file diff --git a/cmd/osmosisd/cmd/decoder/decoder_grpc.pb.go b/cmd/osmosisd/cmd/decoder/decoder_grpc.pb.go new file mode 100644 index 00000000000..f0cf8a25d26 --- /dev/null +++ b/cmd/osmosisd/cmd/decoder/decoder_grpc.pb.go @@ -0,0 +1,109 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.24.3 +// source: decoder.proto + +package decoder + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + CosmosDecoder_Decode_FullMethodName = "/decoder.CosmosDecoder/Decode" +) + +// CosmosDecoderClient is the client API for CosmosDecoder service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type CosmosDecoderClient interface { + Decode(ctx context.Context, in *DecodeRequest, opts ...grpc.CallOption) (*DecodeResponse, error) +} + +type cosmosDecoderClient struct { + cc grpc.ClientConnInterface +} + +func NewCosmosDecoderClient(cc grpc.ClientConnInterface) CosmosDecoderClient { + return &cosmosDecoderClient{cc} +} + +func (c *cosmosDecoderClient) Decode(ctx context.Context, in *DecodeRequest, opts ...grpc.CallOption) (*DecodeResponse, error) { + out := new(DecodeResponse) + err := c.cc.Invoke(ctx, CosmosDecoder_Decode_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// CosmosDecoderServer is the server API for CosmosDecoder service. +// All implementations must embed UnimplementedCosmosDecoderServer +// for forward compatibility +type CosmosDecoderServer interface { + Decode(context.Context, *DecodeRequest) (*DecodeResponse, error) + mustEmbedUnimplementedCosmosDecoderServer() +} + +// UnimplementedCosmosDecoderServer must be embedded to have forward compatible implementations. +type UnimplementedCosmosDecoderServer struct { +} + +func (UnimplementedCosmosDecoderServer) Decode(context.Context, *DecodeRequest) (*DecodeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Decode not implemented") +} +func (UnimplementedCosmosDecoderServer) mustEmbedUnimplementedCosmosDecoderServer() {} + +// UnsafeCosmosDecoderServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to CosmosDecoderServer will +// result in compilation errors. +type UnsafeCosmosDecoderServer interface { + mustEmbedUnimplementedCosmosDecoderServer() +} + +func RegisterCosmosDecoderServer(s grpc.ServiceRegistrar, srv CosmosDecoderServer) { + s.RegisterService(&CosmosDecoder_ServiceDesc, srv) +} + +func _CosmosDecoder_Decode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DecodeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CosmosDecoderServer).Decode(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: CosmosDecoder_Decode_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CosmosDecoderServer).Decode(ctx, req.(*DecodeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// CosmosDecoder_ServiceDesc is the grpc.ServiceDesc for CosmosDecoder service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var CosmosDecoder_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "decoder.CosmosDecoder", + HandlerType: (*CosmosDecoderServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Decode", + Handler: _CosmosDecoder_Decode_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "decoder.proto", +} diff --git a/cmd/osmosisd/cmd/root.go b/cmd/osmosisd/cmd/root.go index a2f1cdb372d..9c5e64d1f07 100644 --- a/cmd/osmosisd/cmd/root.go +++ b/cmd/osmosisd/cmd/root.go @@ -683,6 +683,7 @@ func initRootCmd(rootCmd *cobra.Command, encodingConfig params.EncodingConfig) { PrintEnvironmentCmd(), PrintAllEnvironmentCmd(), UpdateAssetListCmd(osmosis.DefaultNodeHome, osmosis.ModuleBasics), + decoderCmd(), ) server.AddCommands(rootCmd, osmosis.DefaultNodeHome, newApp, createOsmosisAppAndExport, addModuleInitFlags) diff --git a/go.mod b/go.mod index 42505c63f30..09fd3b53ed5 100644 --- a/go.mod +++ b/go.mod @@ -382,7 +382,7 @@ replace ( github.com/CosmWasm/wasmd => github.com/osmosis-labs/wasmd v0.45.0-osmo // cometbft is replaced to print custom app hash logs. Using branch osmo-v23/v0.37.4. - github.com/cometbft/cometbft => github.com/osmosis-labs/cometbft v0.37.4-v23-osmo-1 + github.com/cometbft/cometbft => github.com/lkh1434/osmosis-labs-cometbft v0.37.4-v23-osmo-1-querier // v1.0.0-beta.3 is incompatible, so we use v1.0.0-beta.2 github.com/cosmos/cosmos-proto => github.com/cosmos/cosmos-proto v1.0.0-beta.2 diff --git a/go.work b/go.work index e0c11d30fea..93d1d138db6 100644 --- a/go.work +++ b/go.work @@ -11,3 +11,5 @@ use ./x/ibc-hooks use ./x/epochs replace github.com/onsi/ginkgo => github.com/onsi/ginkgo v1.16.5 + +replace github.com/cometbft/cometbft => github.com/lkh1434/osmosis-labs-cometbft v0.37.4-v23-osmo-1-querier \ No newline at end of file