diff --git a/.gitignore b/.gitignore index c7daf8810..635e5a8fa 100755 --- a/.gitignore +++ b/.gitignore @@ -95,6 +95,7 @@ logs/ configs/logs.json tmp/ tmp* +tmp-swagger-gen/ # ===== Environment & Secrets ===== .env @@ -121,5 +122,8 @@ COMPLETION_SUMMARY.md data/ compose/ heighliner* -**/*.swagger.yaml +# Ignore individual module swagger files (generated in tmp directory) +tmp-swagger-gen/**/*.swagger.json +# Allow the final combined swagger.yaml +!client/docs/swagger-ui/swagger.yaml .mcp.json diff --git a/api/dex/module/v1/module.pulsar.go b/api/dex/module/v1/module.pulsar.go index cde52cafb..32da27c2a 100644 --- a/api/dex/module/v1/module.pulsar.go +++ b/api/dex/module/v1/module.pulsar.go @@ -2,16 +2,15 @@ package modulev1 import ( - fmt "fmt" - io "io" - reflect "reflect" - sync "sync" - _ "cosmossdk.io/api/cosmos/app/v1alpha1" + fmt "fmt" runtime "github.com/cosmos/cosmos-proto/runtime" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" ) var ( diff --git a/api/dex/v1/events.pulsar.go b/api/dex/v1/events.pulsar.go index a97b41e5c..190fc64d7 100644 --- a/api/dex/v1/events.pulsar.go +++ b/api/dex/v1/events.pulsar.go @@ -2,17 +2,16 @@ package dexv1 import ( - fmt "fmt" - io "io" - reflect "reflect" - sync "sync" - v1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" + fmt "fmt" runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" ) var ( diff --git a/api/dex/v1/genesis.pulsar.go b/api/dex/v1/genesis.pulsar.go index 6f1efe7a0..fb47082bc 100644 --- a/api/dex/v1/genesis.pulsar.go +++ b/api/dex/v1/genesis.pulsar.go @@ -3,15 +3,14 @@ package dexv1 import ( fmt "fmt" - io "io" - reflect "reflect" - sync "sync" - runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" ) var _ protoreflect.List = (*_GenesisState_3_list)(nil) diff --git a/api/dex/v1/ica.pulsar.go b/api/dex/v1/ica.pulsar.go index ee19e6590..eeab3b267 100644 --- a/api/dex/v1/ica.pulsar.go +++ b/api/dex/v1/ica.pulsar.go @@ -2,12 +2,8 @@ package dexv1 import ( - fmt "fmt" - io "io" - reflect "reflect" - sync "sync" - v1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" + fmt "fmt" _ "github.com/cosmos/cosmos-proto" runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" @@ -15,6 +11,9 @@ import ( protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" timestamppb "google.golang.org/protobuf/types/known/timestamppb" + io "io" + reflect "reflect" + sync "sync" ) var _ protoreflect.List = (*_InterchainDEXAccount_7_list)(nil) diff --git a/api/dex/v1/query.pulsar.go b/api/dex/v1/query.pulsar.go index 3ae79e5e6..c2534a140 100644 --- a/api/dex/v1/query.pulsar.go +++ b/api/dex/v1/query.pulsar.go @@ -2,19 +2,18 @@ package dexv1 import ( - fmt "fmt" - io "io" - reflect "reflect" - sync "sync" - v1beta1 "cosmossdk.io/api/cosmos/base/query/v1beta1" v1beta11 "cosmossdk.io/api/cosmos/base/v1beta1" + fmt "fmt" runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" ) var ( diff --git a/api/dex/v1/query_grpc.pb.go b/api/dex/v1/query_grpc.pb.go index d63a92dc2..f7458b620 100644 --- a/api/dex/v1/query_grpc.pb.go +++ b/api/dex/v1/query_grpc.pb.go @@ -8,7 +8,6 @@ package dexv1 import ( context "context" - grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" diff --git a/api/dex/v1/tx.pulsar.go b/api/dex/v1/tx.pulsar.go index 2a6b01af2..d154fbdc8 100644 --- a/api/dex/v1/tx.pulsar.go +++ b/api/dex/v1/tx.pulsar.go @@ -2,13 +2,9 @@ package dexv1 import ( - fmt "fmt" - io "io" - reflect "reflect" - sync "sync" - v1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" _ "cosmossdk.io/api/cosmos/msg/v1" + fmt "fmt" _ "github.com/cosmos/cosmos-proto" runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" @@ -16,6 +12,9 @@ import ( protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" timestamppb "google.golang.org/protobuf/types/known/timestamppb" + io "io" + reflect "reflect" + sync "sync" ) var _ protoreflect.List = (*_MsgRegisterDEXAccount_3_list)(nil) diff --git a/api/dex/v1/tx_grpc.pb.go b/api/dex/v1/tx_grpc.pb.go index 64f7b552d..6b6c38630 100644 --- a/api/dex/v1/tx_grpc.pb.go +++ b/api/dex/v1/tx_grpc.pb.go @@ -8,7 +8,6 @@ package dexv1 import ( context "context" - grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" diff --git a/api/did/module/v1/module.pulsar.go b/api/did/module/v1/module.pulsar.go index 294d221a0..6f75cf625 100644 --- a/api/did/module/v1/module.pulsar.go +++ b/api/did/module/v1/module.pulsar.go @@ -2,16 +2,15 @@ package modulev1 import ( - fmt "fmt" - io "io" - reflect "reflect" - sync "sync" - _ "cosmossdk.io/api/cosmos/app/v1alpha1" + fmt "fmt" runtime "github.com/cosmos/cosmos-proto/runtime" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" ) var ( diff --git a/api/did/v1/events.pulsar.go b/api/did/v1/events.pulsar.go index c130ec980..f1d8ee9be 100644 --- a/api/did/v1/events.pulsar.go +++ b/api/did/v1/events.pulsar.go @@ -3,16 +3,15 @@ package didv1 import ( fmt "fmt" - io "io" - reflect "reflect" - sync "sync" - runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" timestamppb "google.golang.org/protobuf/types/known/timestamppb" + io "io" + reflect "reflect" + sync "sync" ) var _ protoreflect.List = (*_EventDIDCreated_3_list)(nil) diff --git a/api/did/v1/genesis.pulsar.go b/api/did/v1/genesis.pulsar.go index 7f70c65d9..191de3822 100644 --- a/api/did/v1/genesis.pulsar.go +++ b/api/did/v1/genesis.pulsar.go @@ -2,17 +2,16 @@ package didv1 import ( - fmt "fmt" - io "io" - reflect "reflect" - sync "sync" - _ "cosmossdk.io/api/amino" + fmt "fmt" runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" ) var ( diff --git a/api/did/v1/query.pulsar.go b/api/did/v1/query.pulsar.go index afcdb9ee9..d5dd5fad2 100644 --- a/api/did/v1/query.pulsar.go +++ b/api/did/v1/query.pulsar.go @@ -2,19 +2,18 @@ package didv1 import ( - fmt "fmt" - io "io" - reflect "reflect" - sort "sort" - sync "sync" - v1beta1 "cosmossdk.io/api/cosmos/base/query/v1beta1" + fmt "fmt" runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sort "sort" + sync "sync" ) var ( diff --git a/api/did/v1/query_grpc.pb.go b/api/did/v1/query_grpc.pb.go index 2fd939320..856b2299f 100644 --- a/api/did/v1/query_grpc.pb.go +++ b/api/did/v1/query_grpc.pb.go @@ -8,7 +8,6 @@ package didv1 import ( context "context" - grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" diff --git a/api/did/v1/state.cosmos_orm.go b/api/did/v1/state.cosmos_orm.go index 0ef5725e1..594023a68 100644 --- a/api/did/v1/state.cosmos_orm.go +++ b/api/did/v1/state.cosmos_orm.go @@ -4,7 +4,6 @@ package didv1 import ( context "context" - ormlist "cosmossdk.io/orm/model/ormlist" ormtable "cosmossdk.io/orm/model/ormtable" ormerrors "cosmossdk.io/orm/types/ormerrors" diff --git a/api/did/v1/state.pulsar.go b/api/did/v1/state.pulsar.go index 96629b3a6..255393fc5 100644 --- a/api/did/v1/state.pulsar.go +++ b/api/did/v1/state.pulsar.go @@ -2,16 +2,15 @@ package didv1 import ( - fmt "fmt" - io "io" - reflect "reflect" - sync "sync" - _ "cosmossdk.io/api/cosmos/orm/v1" + fmt "fmt" runtime "github.com/cosmos/cosmos-proto/runtime" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" ) var ( diff --git a/api/did/v1/tx.pulsar.go b/api/did/v1/tx.pulsar.go index f4b25c1d5..eaac10851 100644 --- a/api/did/v1/tx.pulsar.go +++ b/api/did/v1/tx.pulsar.go @@ -2,18 +2,17 @@ package didv1 import ( - fmt "fmt" - io "io" - reflect "reflect" - sync "sync" - _ "cosmossdk.io/api/cosmos/msg/v1" + fmt "fmt" _ "github.com/cosmos/cosmos-proto" runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" ) var ( diff --git a/api/did/v1/tx_grpc.pb.go b/api/did/v1/tx_grpc.pb.go index 2cbf7a687..25a516aa0 100644 --- a/api/did/v1/tx_grpc.pb.go +++ b/api/did/v1/tx_grpc.pb.go @@ -8,7 +8,6 @@ package didv1 import ( context "context" - grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" diff --git a/api/did/v1/types.pulsar.go b/api/did/v1/types.pulsar.go index 960be138d..f79f4063d 100644 --- a/api/did/v1/types.pulsar.go +++ b/api/did/v1/types.pulsar.go @@ -2,18 +2,17 @@ package didv1 import ( - fmt "fmt" - io "io" - reflect "reflect" - sort "sort" - sync "sync" - _ "cosmossdk.io/api/amino" + fmt "fmt" runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sort "sort" + sync "sync" ) var ( diff --git a/api/dwn/module/v1/module.pulsar.go b/api/dwn/module/v1/module.pulsar.go index 76c71a77f..6ad35af0d 100644 --- a/api/dwn/module/v1/module.pulsar.go +++ b/api/dwn/module/v1/module.pulsar.go @@ -2,16 +2,15 @@ package modulev1 import ( - fmt "fmt" - io "io" - reflect "reflect" - sync "sync" - _ "cosmossdk.io/api/cosmos/app/v1alpha1" + fmt "fmt" runtime "github.com/cosmos/cosmos-proto/runtime" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" ) var ( diff --git a/api/dwn/v1/events.pulsar.go b/api/dwn/v1/events.pulsar.go index 57885fa05..f76d81862 100644 --- a/api/dwn/v1/events.pulsar.go +++ b/api/dwn/v1/events.pulsar.go @@ -3,16 +3,15 @@ package dwnv1 import ( fmt "fmt" - io "io" - reflect "reflect" - sync "sync" - runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" timestamppb "google.golang.org/protobuf/types/known/timestamppb" + io "io" + reflect "reflect" + sync "sync" ) var ( diff --git a/api/dwn/v1/genesis.pulsar.go b/api/dwn/v1/genesis.pulsar.go index dbcc24b2d..6ec49a6e6 100644 --- a/api/dwn/v1/genesis.pulsar.go +++ b/api/dwn/v1/genesis.pulsar.go @@ -2,17 +2,16 @@ package dwnv1 import ( - fmt "fmt" - io "io" - reflect "reflect" - sync "sync" - _ "cosmossdk.io/api/amino" + fmt "fmt" runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" ) var _ protoreflect.List = (*_GenesisState_2_list)(nil) diff --git a/api/dwn/v1/query.pulsar.go b/api/dwn/v1/query.pulsar.go index c2c0e7aab..3611d8e6b 100644 --- a/api/dwn/v1/query.pulsar.go +++ b/api/dwn/v1/query.pulsar.go @@ -2,18 +2,17 @@ package dwnv1 import ( - fmt "fmt" - io "io" - reflect "reflect" - sync "sync" - v1beta1 "cosmossdk.io/api/cosmos/base/query/v1beta1" + fmt "fmt" runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" ) var ( diff --git a/api/dwn/v1/query_grpc.pb.go b/api/dwn/v1/query_grpc.pb.go index 723549935..e1b96b314 100644 --- a/api/dwn/v1/query_grpc.pb.go +++ b/api/dwn/v1/query_grpc.pb.go @@ -8,7 +8,6 @@ package dwnv1 import ( context "context" - grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" diff --git a/api/dwn/v1/state.cosmos_orm.go b/api/dwn/v1/state.cosmos_orm.go index b4d508056..60c3a193d 100644 --- a/api/dwn/v1/state.cosmos_orm.go +++ b/api/dwn/v1/state.cosmos_orm.go @@ -4,7 +4,6 @@ package dwnv1 import ( context "context" - ormlist "cosmossdk.io/orm/model/ormlist" ormtable "cosmossdk.io/orm/model/ormtable" ormerrors "cosmossdk.io/orm/types/ormerrors" diff --git a/api/dwn/v1/state.pulsar.go b/api/dwn/v1/state.pulsar.go index b182051e2..a730b9d0d 100644 --- a/api/dwn/v1/state.pulsar.go +++ b/api/dwn/v1/state.pulsar.go @@ -2,16 +2,15 @@ package dwnv1 import ( - fmt "fmt" - io "io" - reflect "reflect" - sync "sync" - _ "cosmossdk.io/api/cosmos/orm/v1" + fmt "fmt" runtime "github.com/cosmos/cosmos-proto/runtime" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" ) var _ protoreflect.List = (*_EncryptionMetadata_6_list)(nil) diff --git a/api/dwn/v1/tx.pulsar.go b/api/dwn/v1/tx.pulsar.go index ddd2e0549..62fd46971 100644 --- a/api/dwn/v1/tx.pulsar.go +++ b/api/dwn/v1/tx.pulsar.go @@ -2,18 +2,17 @@ package dwnv1 import ( - fmt "fmt" - io "io" - reflect "reflect" - sync "sync" - _ "cosmossdk.io/api/cosmos/msg/v1" + fmt "fmt" _ "github.com/cosmos/cosmos-proto" runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" ) var ( diff --git a/api/dwn/v1/tx_grpc.pb.go b/api/dwn/v1/tx_grpc.pb.go index 575947185..f29e30799 100644 --- a/api/dwn/v1/tx_grpc.pb.go +++ b/api/dwn/v1/tx_grpc.pb.go @@ -8,7 +8,6 @@ package dwnv1 import ( context "context" - grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" diff --git a/api/svc/module/v1/module.pulsar.go b/api/svc/module/v1/module.pulsar.go index 24b6aca7a..de3301f49 100644 --- a/api/svc/module/v1/module.pulsar.go +++ b/api/svc/module/v1/module.pulsar.go @@ -2,16 +2,15 @@ package modulev1 import ( - fmt "fmt" - io "io" - reflect "reflect" - sync "sync" - _ "cosmossdk.io/api/cosmos/app/v1alpha1" + fmt "fmt" runtime "github.com/cosmos/cosmos-proto/runtime" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" ) var ( diff --git a/api/svc/v1/events.pulsar.go b/api/svc/v1/events.pulsar.go index cfe71bdf7..50d8d95a2 100644 --- a/api/svc/v1/events.pulsar.go +++ b/api/svc/v1/events.pulsar.go @@ -3,16 +3,15 @@ package svcv1 import ( fmt "fmt" - io "io" - reflect "reflect" - sync "sync" - runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" timestamppb "google.golang.org/protobuf/types/known/timestamppb" + io "io" + reflect "reflect" + sync "sync" ) var ( diff --git a/api/svc/v1/genesis.pulsar.go b/api/svc/v1/genesis.pulsar.go index 259b4e9f9..17b31d649 100644 --- a/api/svc/v1/genesis.pulsar.go +++ b/api/svc/v1/genesis.pulsar.go @@ -2,19 +2,18 @@ package svcv1 import ( - fmt "fmt" - io "io" - reflect "reflect" - sync "sync" - _ "cosmossdk.io/api/amino" v1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" + fmt "fmt" _ "github.com/cosmos/cosmos-proto" runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" ) var _ protoreflect.List = (*_GenesisState_2_list)(nil) diff --git a/api/svc/v1/query.pulsar.go b/api/svc/v1/query.pulsar.go index f8cf3a44e..132f7c70c 100644 --- a/api/svc/v1/query.pulsar.go +++ b/api/svc/v1/query.pulsar.go @@ -3,16 +3,15 @@ package svcv1 import ( fmt "fmt" - io "io" - reflect "reflect" - sort "sort" - sync "sync" - runtime "github.com/cosmos/cosmos-proto/runtime" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sort "sort" + sync "sync" ) var ( diff --git a/api/svc/v1/query_grpc.pb.go b/api/svc/v1/query_grpc.pb.go index cf449aaa7..790deaf4c 100644 --- a/api/svc/v1/query_grpc.pb.go +++ b/api/svc/v1/query_grpc.pb.go @@ -8,7 +8,6 @@ package svcv1 import ( context "context" - grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" diff --git a/api/svc/v1/state.cosmos_orm.go b/api/svc/v1/state.cosmos_orm.go index 511fc1377..231aba763 100644 --- a/api/svc/v1/state.cosmos_orm.go +++ b/api/svc/v1/state.cosmos_orm.go @@ -4,7 +4,6 @@ package svcv1 import ( context "context" - ormlist "cosmossdk.io/orm/model/ormlist" ormtable "cosmossdk.io/orm/model/ormtable" ormerrors "cosmossdk.io/orm/types/ormerrors" diff --git a/api/svc/v1/state.pulsar.go b/api/svc/v1/state.pulsar.go index e782b46d2..c6edd4158 100644 --- a/api/svc/v1/state.pulsar.go +++ b/api/svc/v1/state.pulsar.go @@ -2,17 +2,16 @@ package svcv1 import ( - fmt "fmt" - io "io" - reflect "reflect" - sort "sort" - sync "sync" - _ "cosmossdk.io/api/cosmos/orm/v1" + fmt "fmt" runtime "github.com/cosmos/cosmos-proto/runtime" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sort "sort" + sync "sync" ) var _ protoreflect.List = (*_Service_5_list)(nil) diff --git a/api/svc/v1/tx.pulsar.go b/api/svc/v1/tx.pulsar.go index 20191e951..3212751f7 100644 --- a/api/svc/v1/tx.pulsar.go +++ b/api/svc/v1/tx.pulsar.go @@ -2,18 +2,17 @@ package svcv1 import ( - fmt "fmt" - io "io" - reflect "reflect" - sync "sync" - _ "cosmossdk.io/api/cosmos/msg/v1" + fmt "fmt" _ "github.com/cosmos/cosmos-proto" runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" ) var ( diff --git a/api/svc/v1/tx_grpc.pb.go b/api/svc/v1/tx_grpc.pb.go index 4ad2d4e8a..cd3fa2c92 100644 --- a/api/svc/v1/tx_grpc.pb.go +++ b/api/svc/v1/tx_grpc.pb.go @@ -8,7 +8,6 @@ package svcv1 import ( context "context" - grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" diff --git a/proto/Makefile b/proto/Makefile index 2372333d7..449161fb3 100644 --- a/proto/Makefile +++ b/proto/Makefile @@ -55,9 +55,18 @@ test: ############################################################################### swagger-gen: @gum log --level info "Generating OpenAPI documentation..." - @buf generate --template buf.gen.openapi.yaml - @gum log --level info "✅ OpenAPI documentation generated in docs/static/openapi/" - @gum log --level info "✅ Merged API specification: docs/static/openapi/sonr.swagger.yaml" + @$(protoImage) buf generate --template proto/buf.gen.openapi.yaml + @gum log --level info "Combining swagger files into unified specification..." + @mkdir -p $(GIT_ROOT)/client/docs/swagger-ui + @npx swagger-combine $(GIT_ROOT)/client/docs/config.json \ + -o $(GIT_ROOT)/client/docs/swagger-ui/swagger.yaml \ + -f yaml \ + --continueOnConflictingPaths true \ + --includeDefinitions true + @gum log --level info "Cleaning up temporary files..." + @rm -rf $(GIT_ROOT)/tmp-swagger-gen + @gum log --level info "✅ OpenAPI documentation generated successfully" + @gum log --level info "✅ Unified API specification: client/docs/swagger-ui/swagger.yaml" push: @npx buf push diff --git a/proto/buf.gen.openapi.yaml b/proto/buf.gen.openapi.yaml index f12e7f365..2ba4ba21b 100644 --- a/proto/buf.gen.openapi.yaml +++ b/proto/buf.gen.openapi.yaml @@ -1,15 +1,16 @@ version: v1 plugins: # Generate OpenAPI v2 (Swagger) documentation + # Follows Cosmos SDK standard approach: generate to tmp directory, then combine - name: openapiv2 - out: ../docs/static/openapi + out: ../tmp-swagger-gen opt: - logtostderr=true + - fqn_for_swagger_name=true - simple_operation_ids=true - - openapi_naming_strategy=simple - json_names_for_fields=true - allow_merge=false - - output_format=yaml + - output_format=json # Generate methods without HTTP bindings - generate_unbound_methods=true # Include service tags diff --git a/scripts/lib/config.sh b/scripts/lib/config.sh index d6b8f73cd..4afbd0d10 100755 --- a/scripts/lib/config.sh +++ b/scripts/lib/config.sh @@ -25,6 +25,36 @@ set_toml_value() { ensure_file "$file" + # Check if we're using Docker and the file is owned by root + if [[ "${USE_DOCKER:-false}" == "true" ]] && [[ "$(stat -c %u "$file" 2>/dev/null || echo 0)" == "0" ]]; then + # Use Docker to modify the file to avoid permission issues + # Escape special characters for sed + local escaped_value + escaped_value=$(printf '%s\n' "$value" | sed 's/[[\.*^$()+?{|]/\\&/g') + + # Check if value is a JSON array/object (starts with [ or {) - don't quote it + local sed_replacement + if [[ "$value" =~ ^\[.*\]$ ]] || [[ "$value" =~ ^\{.*\}$ ]]; then + sed_replacement="$key = $escaped_value" + else + sed_replacement="$key = \"$escaped_value\"" + fi + + docker run --rm -i \ + -v "$(dirname "$file"):$(dirname "$file")" \ + --entrypoint sh \ + onsonr/snrd:latest \ + -c "sed -i 's|^\s*$key\s*=.*|$sed_replacement|g' '$file'" + + if [ $? -eq 0 ]; then + log_success "Set $key = $value in $file (Docker sed)" + return 0 + else + log_error "Failed to set $section.$key in $file" + return 1 + fi + fi + if [[ "$CRUDINI_AVAILABLE" == "true" ]]; then if crudini --set "$file" "$section" "$key" "$value" 2>/dev/null; then log_success "Set $section.$key = $value in $file" @@ -39,8 +69,16 @@ set_toml_value() { local escaped_value escaped_value=$(printf '%s\n' "$value" | sed 's/[[\.*^$()+?{|]/\\&/g') + # Check if value is a JSON array/object (starts with [ or {) - don't quote it + local sed_replacement + if [[ "$value" =~ ^\[.*\]$ ]] || [[ "$value" =~ ^\{.*\}$ ]]; then + sed_replacement="$key = $escaped_value" + else + sed_replacement="$key = \"$escaped_value\"" + fi + # Try to find and replace the line - if sed -i "s|^\s*$key\s*=.*|$key = \"$escaped_value\"|g" "$file"; then + if sed -i "s|^\s*$key\s*=.*|$sed_replacement|g" "$file"; then log_success "Set $key = $value in $file (using sed)" return 0 fi diff --git a/scripts/lib/env.sh b/scripts/lib/env.sh index d2aac8417..072a21c97 100755 --- a/scripts/lib/env.sh +++ b/scripts/lib/env.sh @@ -120,8 +120,14 @@ retry() { # Initialize environment init_env() { + local skip_binary_check="${1:-false}" + require_cmd jq - ensure_binary + + # Only check for binary if not skipping (allows Docker mode to be decided later) + if [[ "$skip_binary_check" != "true" ]]; then + ensure_binary + fi # Set up cleanup trap trap cleanup EXIT diff --git a/scripts/lib/genesis.sh b/scripts/lib/genesis.sh index 86ce85f06..13b55f421 100755 --- a/scripts/lib/genesis.sh +++ b/scripts/lib/genesis.sh @@ -51,21 +51,53 @@ generate_vrf_key() { local vrf_key_path="$chain_dir/vrf_secret.key" # Ensure directory exists - mkdir -p "$chain_dir" + mkdir -p "$chain_dir" 2>/dev/null || true - # Convert hex to binary and write to file - echo -n "$vrf_key_hex" | xxd -r -p > "$vrf_key_path" + # Check if we're using Docker and the directory is owned by root + if [[ "${USE_DOCKER:-false}" == "true" ]] && [[ "$(stat -c %u "$chain_dir" 2>/dev/null || echo 0)" == "0" ]]; then + # Use Docker to create the VRF key file + docker run --rm -i \ + -v "$chain_dir:$chain_dir" \ + --entrypoint sh \ + onsonr/snrd:latest \ + -c "echo -n '$vrf_key_hex' | xxd -r -p > '$vrf_key_path' && chmod 0600 '$vrf_key_path'" - # Set restrictive permissions (owner read/write only) - chmod 0600 "$vrf_key_path" + if [ $? -ne 0 ]; then + log_error "Failed to create VRF key using Docker" + return 1 + fi + else + # Convert hex to binary and write to file + echo -n "$vrf_key_hex" | xxd -r -p > "$vrf_key_path" + + # Set restrictive permissions (owner read/write only) + chmod 0600 "$vrf_key_path" + fi # Validate file was created with correct size (64 bytes) local file_size - file_size=$(wc -c < "$vrf_key_path") + if [[ "${USE_DOCKER:-false}" == "true" ]]; then + # Use Docker to check file size for root-owned files + file_size=$(docker run --rm -i \ + -v "$chain_dir:$chain_dir" \ + --entrypoint sh \ + onsonr/snrd:latest \ + -c "wc -c < '$vrf_key_path' 2>/dev/null || echo 0") + else + file_size=$(wc -c < "$vrf_key_path" 2>/dev/null || echo 0) + fi if [[ $file_size -ne 64 ]]; then log_error "VRF key file has incorrect size: ${file_size} bytes" - rm -f "$vrf_key_path" + if [[ "${USE_DOCKER:-false}" == "true" ]]; then + docker run --rm -i \ + -v "$chain_dir:$chain_dir" \ + --entrypoint sh \ + onsonr/snrd:latest \ + -c "rm -f '$vrf_key_path'" + else + rm -f "$vrf_key_path" + fi return 1 fi @@ -110,9 +142,10 @@ update_genesis_params() { set_json_string "$genesis_file" 'app_state.gov.params.max_deposit_period' "30s" set_json_string "$genesis_file" 'app_state.gov.params.min_deposit[0].amount' "10" set_json_string "$genesis_file" 'app_state.gov.params.voting_period' "30s" - set_json_string "$genesis_file" 'app_state.gov.params.quorum' "0.000000000000000000" - set_json_string "$genesis_file" 'app_state.gov.params.threshold' "0.000000000000000000" - set_json_string "$genesis_file" 'app_state.gov.params.veto_threshold' "0.000000000000000000" + set_json_string "$genesis_file" 'app_state.gov.params.expedited_voting_period' "15s" + set_json_string "$genesis_file" 'app_state.gov.params.quorum' "0.334000000000000000" + set_json_string "$genesis_file" 'app_state.gov.params.threshold' "0.500000000000000000" + set_json_string "$genesis_file" 'app_state.gov.params.veto_threshold' "0.334000000000000000" fi # Update EVM parameters if present diff --git a/scripts/lib/jq_patch.sh b/scripts/lib/jq_patch.sh index 0de952568..6591bf4c8 100755 --- a/scripts/lib/jq_patch.sh +++ b/scripts/lib/jq_patch.sh @@ -18,6 +18,24 @@ patch_json() { log_info "Patching $file with: $jq_expr" + # Check if we're using Docker and the file is owned by root + if [[ "${USE_DOCKER:-false}" == "true" ]] && [[ "$(stat -c %u "$file" 2>/dev/null || echo 0)" == "0" ]]; then + # Use Docker to patch the file to avoid permission issues + docker run --rm -i \ + -v "$(dirname "$file"):$(dirname "$file")" \ + --entrypoint sh \ + onsonr/snrd:latest \ + -c "jq -r '$jq_expr' '$file' > '${file}.tmp' && mv '${file}.tmp' '$file'" + + if [ $? -eq 0 ]; then + log_success "Successfully patched $file" + return 0 + else + log_error "Failed to patch JSON file: $file" + return 1 + fi + fi + # Create temp file in same directory to avoid cross-filesystem issues local temp_file temp_file="$(dirname "$file")/.tmp.$(basename "$file").$$" diff --git a/scripts/lib/keys.sh b/scripts/lib/keys.sh index 9100c13bf..0b693d683 100755 --- a/scripts/lib/keys.sh +++ b/scripts/lib/keys.sh @@ -22,13 +22,21 @@ import_mnemonic() { return 1 fi - # Use Docker wrapper if needed - if is_docker; then + # Use run_binary wrapper if available (for Docker mode), otherwise use CHAIN_BIN directly + if [ "$(type -t run_binary)" = "function" ]; then + # run_binary is available, use it (handles Docker automatically, including --home) + echo "$mnemonic" | run_binary keys add "$key_name" \ + --keyring-backend "$KEYRING_BACKEND" \ + --algo "$algo" \ + --recover + elif is_docker; then + # We're inside Docker container echo "$mnemonic" | $CHAIN_BIN keys add "$key_name" \ --keyring-backend "$KEYRING_BACKEND" \ --algo "$algo" \ --recover else + # Local execution echo "$mnemonic" | $CHAIN_BIN keys add "$key_name" \ --keyring-backend "$KEYRING_BACKEND" \ --algo "$algo" \ diff --git a/scripts/test_node.sh b/scripts/test_node.sh index d3f8bcee9..989126c73 100755 --- a/scripts/test_node.sh +++ b/scripts/test_node.sh @@ -9,20 +9,28 @@ set -euo pipefail # Source helper libraries # Get the directory of this script reliably -SCRIPT_DIR="/usr/local/lib/sonr-scripts" +# Check if we're running in Docker (where scripts are installed to /usr/local/lib/sonr-scripts) +# or locally (where scripts are in the repo's scripts/lib directory) +if [ -d "/usr/local/lib/sonr-scripts" ]; then + SCRIPT_DIR="/usr/local/lib/sonr-scripts" +else + # Get the directory where this script is located + SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/lib" && pwd)" +fi source "${SCRIPT_DIR}/env.sh" source "${SCRIPT_DIR}/config.sh" source "${SCRIPT_DIR}/keys.sh" source "${SCRIPT_DIR}/genesis.sh" -# Initialize environment -init_env +# Initialize environment (skip binary check as we'll handle Docker/binary detection later) +init_env true # Set defaults for test node export KEY="${KEY:-acc0}" export KEY2="${KEY2:-acc1}" export MONIKER="${MONIKER:-localvalidator}" export KEYALGO="${KEYALGO:-eth_secp256k1}" +export KEYRING="${KEYRING:-test}" # Configurable ports export RPC="${RPC:-26657}" @@ -47,7 +55,7 @@ export CLEAN="${CLEAN:-false}" export DOCKER_DETACHED="${DOCKER_DETACHED:-false}" # Check if binary exists, if not use Docker (or force Docker if requested) -USE_DOCKER=false +export USE_DOCKER=false if [[ "${FORCE_DOCKER}" == "true" ]] || ! command -v "$CHAIN_BIN" >/dev/null 2>&1; then # Check if Docker is available and use it if command -v docker >/dev/null 2>&1; then @@ -58,14 +66,14 @@ if [[ "${FORCE_DOCKER}" == "true" ]] || ! command -v "$CHAIN_BIN" >/dev/null 2>& fi if docker image inspect onsonr/snrd:latest >/dev/null 2>&1; then log_info "Using Docker image onsonr/snrd:latest" - USE_DOCKER=true + export USE_DOCKER=true else log_info "Docker image onsonr/snrd:latest not found. Pulling image..." docker pull onsonr/snrd:latest || { log_error "Failed to pull onsonr/snrd:latest. Please ensure Docker is running and you have internet access." exit 1 } - USE_DOCKER=true + export USE_DOCKER=true fi else log_error "Binary $CHAIN_BIN not found. Please either:" @@ -80,28 +88,32 @@ run_binary() { if [[ "${USE_DOCKER}" == "true" ]]; then # Ensure the directory exists on the host mkdir -p "${HOME_DIR}" - # Determine if we're in a TTY - DOCKER_TTY_FLAG="" - if [ -t 0 ]; then - DOCKER_TTY_FLAG="-it" - fi - # Mount home directory to container's /root/.sonr - docker run --rm ${DOCKER_TTY_FLAG} \ + # Use -i for interactive (stdin) only, not -t (tty) + # This allows piping to work properly + # Run as root in Docker, fix permissions after + docker run --rm -i \ -v "${HOME_DIR}:/root/.sonr" \ --network host \ onsonr/snrd:latest \ snrd --home /root/.sonr "$@" + # Fix permissions on files created by Docker + chmod -R u+rwX "${HOME_DIR}" 2>/dev/null || true else ${CHAIN_BIN} "$@" fi } +export -f run_binary # Set client configuration set_config() { + # Skip if config directory doesn't exist yet (will be set later during initialization) + if [[ ! -d "${HOME_DIR}/config" ]]; then + return 0 + fi run_binary config set client chain-id "${CHAIN_ID}" run_binary config set client keyring-backend "${KEYRING}" } -set_config +# Don't call set_config here - it will be called after chain init in from_scratch() from_scratch() { # Fresh install on current branch (skip if using Docker or SKIP_INSTALL is true) @@ -115,18 +127,34 @@ from_scratch() { log_error "HOME_DIR must be more than 2 characters long" return 1 fi - rm -rf "${HOME_DIR}" + + # Handle permission issues from Docker-created files + if [ -d "${HOME_DIR}" ]; then + # Try to fix permissions first + chmod -R u+rwX "${HOME_DIR}" 2>/dev/null || true + + # Now try to remove + if ! rm -rf "${HOME_DIR}" 2>/dev/null; then + log_warn "Could not remove ${HOME_DIR} due to permission issues" + log_info "Attempting cleanup with Docker..." + if command -v docker >/dev/null 2>&1; then + # Use a simple busybox container to clean up with proper permissions + docker run --rm -v "${HOME_DIR}:/data" --user root busybox sh -c "rm -rf /data/* /data/.[!.]* 2>/dev/null || true" 2>/dev/null || true + # Try to remove the directory again + rm -rf "${HOME_DIR}" 2>/dev/null || { + log_error "Failed to clean ${HOME_DIR}. Please run: sudo rm -rf ${HOME_DIR}" + log_error "Then run 'make localnet' again" + return 1 + } + else + log_error "Failed to clean ${HOME_DIR}. Please run: sudo rm -rf ${HOME_DIR}" + return 1 + fi + fi + fi log_info "Removed existing chain directory: ${HOME_DIR}" - # Reset configuration - set_config - - # Add test keys - log_info "Adding test keys..." - import_mnemonic "${KEY}" "${SONR_MNEMONIC_1}" "$KEYALGO" - import_mnemonic "${KEY2}" "${SONR_MNEMONIC_2}" "$KEYALGO" - - # Initialize chain + # Initialize chain (must be done before adding keys) log_info "Initializing chain with moniker: $MONIKER" if [[ "${USE_DOCKER}" == "true" ]]; then docker run --rm \ @@ -134,10 +162,20 @@ from_scratch() { --network host \ onsonr/snrd:latest \ snrd --home /root/.sonr init "${MONIKER}" --chain-id "${CHAIN_ID}" --default-denom "${DENOM}" + # Fix permissions on files created by Docker + chmod -R u+rwX "${HOME_DIR}" 2>/dev/null || true else ${CHAIN_BIN} init "${MONIKER}" --chain-id "${CHAIN_ID}" --default-denom "${DENOM}" --home "${HOME_DIR}" fi + # Now that chain is initialized, set client configuration + set_config + + # Add test keys (must be done after chain init) + log_info "Adding test keys..." + import_mnemonic "${KEY}" "${SONR_MNEMONIC_1}" "$KEYALGO" + import_mnemonic "${KEY2}" "${SONR_MNEMONIC_2}" "$KEYALGO" + # Update genesis parameters log_info "Updating genesis parameters..." update_genesis_params @@ -209,7 +247,7 @@ configure_node "$HOME_DIR" \ --rest-port "$REST" \ --grpc-port "$GRPC" \ --grpc-web-port "$GRPC_WEB" \ - --json-rpc-port "$JSON_RPC" \ + --json-rpc-port "$JSON_RPC" "$JSON_RPC_WS" \ --rosetta-port "$ROSETTA" \ --min-gas-prices "0${DENOM}" \ --pruning nothing