Swagger
This readme contains information related to the Swagger UI for Provenance.
Activation
In order to have the Swagger UI available on your node, it must be turned on in the config.
- If the file
build/run/provenanced/config/app.toml
does not yet exist run this command:
> make build run-config
- Enable the api and swagger features:
> build/provenanced --home build/run/provenanced config set api.enable true api.swagger true
- Start the node:
> make run
- If you are refreshing the browser, hard refresh, e.g.
cmd
+ shift
+ r
.
Location
The swagger UI can be found at the /swagger/
path on your node.
For example, if running locally, it will be at http://localhost:1317/swagger/
If you don't get any response (or you get a connection refused):
- Make sure it has been activated:
> build/provenanced --home build/run/provenanced config get api.enabled api.swagger
- Make sure your firewall is allowing traffic port
1317
.
- Make sure that port
1317
is the port defined in the api.address
config value:
> build/provenanced --home build/run/provenanced config get api.address
Updating
Any time changes are made to the proto files (/proto
or third_party/proto
), the Swagger UI files need to be updated too.
If the Cosmos-SDK version has been changed since the last time the swagger files were generated, the swagger_third_party.yaml
file needs to be updated first.
To get a new version of swagger_third_party.yaml
:
- In this repo, identify the version of Cosmos-SDK being used.
- Clone our fork of the Cosmos-SDK repo locally and navigate to it.
- In that repo, check out the tag for the version identified earlier.
- In that repo, run
make proto-swagger-gen
.
- Copy the resulting
client/docs/swagger-ui/swagger.yaml
file from that repo to client/docs/swagger_third_party.yaml
in this repo.
Finally, to update the rest of the swagger files (regardless of whether the 3rd party file needed updating), run this command:
> make proto-swagger-gen
Commit any files with changes so they can be included in a PR.
You will need to make build
again in order to see any changes in your browser.