From 8e032f850a0535380aea0227ecb34b334a0bf55a Mon Sep 17 00:00:00 2001 From: HaoyangLiu Date: Sun, 2 Sep 2018 20:30:59 +0800 Subject: [PATCH] Rename rest-server to lite-server and add README to clarify how to update API docs --- client/lcd/README.md | 20 ++++++++++++++++++++ client/lcd/root.go | 6 +++--- 2 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 client/lcd/README.md diff --git a/client/lcd/README.md b/client/lcd/README.md new file mode 100644 index 0000000000..5bcc59cdfd --- /dev/null +++ b/client/lcd/README.md @@ -0,0 +1,20 @@ +# How to update API docs + +Due to the rest handlers and related data structures are distributed in many sub-folds, currently there is no tool which can automatically extract all APIs information and generate API docs. So here we have to write APIs' docs manually. + +## Steps + +* Install the command line tool first. +``` +go get github.com/rakyll/statik +``` +* Directly Edit API docs: client/lcd/swaggerui/swagger.json + +* Edit API docs within this [website](https://app.swaggerhub.com). Please refer to this [link](https://app.swaggerhub.com/help/index) for how to use the about website to edit API docs. + +* Download swagger.json and replace the old swagger.json under client/lcd/swaggerui folds + +* Regenerate statik.go file +``` +statik -src=client/lcd/swaggerui -dest=client/lcd +``` \ No newline at end of file diff --git a/client/lcd/root.go b/client/lcd/root.go index 291dea5c91..80139abe10 100644 --- a/client/lcd/root.go +++ b/client/lcd/root.go @@ -34,8 +34,8 @@ func ServeCommand(cdc *wire.Codec) *cobra.Command { flagMaxOpenConnections := "max-open" cmd := &cobra.Command{ - Use: "rest-server", - Short: "Start LCD (light-client daemon), a local REST server", + Use: "lite-server", + Short: "Start Gaia-lite server daemon, a local REST server", RunE: func(cmd *cobra.Command, args []string) error { listenAddr := viper.GetString(flagListenAddr) router := createHandler(cdc) @@ -58,7 +58,7 @@ func ServeCommand(cdc *wire.Codec) *cobra.Command { return err } - logger.Info("REST server started") + logger.Info("Gaia-lite server started") // wait forever and cleanup cmn.TrapSignal(func() {