-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Added generated statik file, otherwise LCD is unusable for apps importing the SDK #2673
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #2673 +/- ##
===========================================
+ Coverage 58.7% 58.72% +0.02%
===========================================
Files 152 152
Lines 9445 9445
===========================================
+ Hits 5545 5547 +2
+ Misses 3530 3528 -2
Partials 370 370 |
@fedekunze Is there a reason we generate this file dynamically or part of the build process? Can we have it as a static file? |
related to #2647 ... they pretty much go together afaict |
@alexanderbez I guess we can have as a static file. Better ask @HaoyangLiu |
@fedekunze If the |
I've recently changed the way the LCD is exposed for clients to register routes. Is this PR still required? |
@jackzampolin I don't remember the exact error anymore - IIRC without this you can't import this package without a panic at runtime |
@samalba I'm updating our application tutorial now and will see if this is still an issue. You should check out how we are exposing the LCD to app developers now: https://github.com/cosmos/cosmos-sdk/blob/master/cmd/gaia/cmd/gaiacli/main.go#L157-L158 |
Sounds good, thanks @jackzampolin. Since the new method RegisterSwaggerUI still uses statik's fs, it will miss the generated data at Runtime without this file: https://github.com/cosmos/cosmos-sdk/blob/master/cmd/gaia/cmd/gaiacli/main.go#L170 I'll simply try with the tutorial, easy to check. EDIT: I closed the issue by mistake... |
@samalba That swagger file only describes the gaia routes. Users would need to write their own swagger file to describe the routes in their app anyway. We need a way to make this more modular. |
I have an app that uses the Cosmos-SDK. I need to add support for LCD, it fails to compile because the generated file statik.go file does not exist in my vendor directory. It's currently generated from the SDK Makefile, which means that all apps vendoring the SDK will miss the file.
I suggest simply adding the statik.go file in the SDK repos so any Cosmos app can enable the LCD support.