Conversation
Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com>
Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com>
Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com>
Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com>
Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com>
Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com>
Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com>
Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com>
Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com>
Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com>
Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com>
Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #3880 +/- ##
==========================================
+ Coverage 65.65% 66.88% +1.23%
==========================================
Files 217 219 +2
Lines 18198 18205 +7
==========================================
+ Hits 11948 12177 +229
+ Misses 5382 5139 -243
- Partials 868 889 +21
|
Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com>
|
This is definition of ResponseInfo message from proto file but it's tendermint/abci/types/types.proto Lines 137 to 145 in 62f97a6 But in swagger file you have: tendermint/docs/spec/rpc/swagger.yaml Lines 2115 to 2118 in a9ae00b i.e only 3 fields are specified vs 5. also general issue of having omitempty everywhere in generated types means non of the fileds of generated types are actually required #3882 |
Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com>
|
Thanks for cathing this @safareli! I will adapt the swagger and double-check what else could have been falling under this category. |
|
@mircea-c can we have this in place of https://tendermint.com/rpc/#introduction, when its merged? |
|
@mircea-c @marbar3778 To get this working we should deploy just once the index.html I added in the same folder of the swagger file (if it's an S3 bucket let's just be sure they are both reachable permission-wise) and every time we want to update the RPC docs, just replace |
Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com>
Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com>
Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com>
That's cleaner, thanks! Co-Authored-By: Anton Kaliaev <anton.kalyaev@gmail.com>
Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com>
Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com>
Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com>
Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com>
Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com>
…lumes Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com>
If I understand correctly, to switch to Swagger (from Slate) we would have to edit the https://github.com/tendermint/tendermint.com/blob/master/Makefile#L48 so that it would copy |
Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com>
Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com>
Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com>
Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com>
|
A follow-up PR could make the network a bit more interesting to tests, adding addresses, transactions hashes to look at etc |
thanethomson
left a comment
There was a problem hiding this comment.
So happy to see contract tests! 🎉 🕺
| @@ -0,0 +1,2680 @@ | |||
| swagger: "2.0" | |||
| info: | |||
| version: "0.32.1" | |||
There was a problem hiding this comment.
Will we have to manually update the version each time?
| description: Evidence APIs | ||
| schemes: | ||
| - https | ||
| host: stargate.cosmos.network:26657 |
There was a problem hiding this comment.
Should we be using this address here? Due to the more generic nature of Tendermint, I'd imagine we'd need to provide an address that's relevant to a broader user base. The default for Tendermint configuration at the moment is to bind to 127.0.0.1, so should we perhaps not just use:
| host: stargate.cosmos.network:26657 | |
| host: localhost:26657 |
There was a problem hiding this comment.
I do believe this is so when a user comes to the swagger docs they can hit the endpoint and get results back instead of having to spin a local node to be able to test it. similar to the try it out button here: https://cosmos.network/rpc/#/ICS0/get_node_info
There was a problem hiding this comment.
Perhaps we should look into setting up a Tendermint/kvstore node here instead then, running the latest version of Tendermint? Something generic where users can follow along in the Tendermint documentation to interact with the server.
| - name: Evidence | ||
| description: Evidence APIs | ||
| schemes: | ||
| - https |
There was a problem hiding this comment.
By default we expose an HTTP interface - could we add that in here?
| - "hash" | ||
| properties: | ||
| code: | ||
| type: "string" |
There was a problem hiding this comment.
Right now this is actually an integer. See #3898 - I'm sure we're going to rather tend towards representing all integers as integers instead of strings in future.
There was a problem hiding this comment.
I've tried adding this comment twice now and GitHub seems to consistently get the line number wrong somehow in the preview 🤷♂. Just in case, I'm referring to docs/spec/rpc/swagger.yaml#2666.
| contract_tests: | ||
| working_directory: /home/circleci/.go_workspace/src/github.com/tendermint/tendermint | ||
| machine: | ||
| image: circleci/classic:latest |
There was a problem hiding this comment.
why not default one or nodejs?
There was a problem hiding this comment.
For this @sabau mentioned its either start in node and download go or start in go and download node, he chose node.
| steps: | ||
| - checkout | ||
| - run: | ||
| name: Test RPC endpoints agsainst swagger documentation |
There was a problem hiding this comment.
| name: Test RPC endpoints agsainst swagger documentation | |
| name: Test RPC endpoints against swagger documentation |
| ### RPC Testing | ||
|
|
||
| If you contribute to the RPC endpoints it's important to document your changes in the [Swagger file](./docs/spec/rpc/swagger.yaml) | ||
| To test your changes you should install `nodejs` version `v11.15.*` and run: |
There was a problem hiding this comment.
don't think we need version here
tac0turtle
left a comment
There was a problem hiding this comment.
⚡️ created follow up an issue for nonaddressed comments, @sabau thank you for your contributions
|
When would this be hosted on tendermint website? |
Describing statically the RPC implementation with swagger
Closes: #2880, #2419
The initial goal was to introduce proper annotations:
swaggobut I hit a limitation in the usage of aliases https://github.com/sabau/tendermint/tree/2880-swagger-rpc-docsgo-swaggerbut they don't support go modules yet, even thoughgo-swaggeritself is using them https://github.com/sabau/tendermint/tree/2880-go-swagger-rpcWith both, workarounds to make it work are possible but may create a brittle solution that will soon need to be refactored once go modules are supported (or aliases in the case of
swaggo)The first part of the definitions is organized, the second half is left as it will look once auto-generated, so we can see the differences