cosmos-sdk/client/lcd/root.go

37 lines
1.0 KiB
Go
Raw Normal View History

package lcd
import (
"errors"
"github.com/spf13/cobra"
"github.com/cosmos/cosmos-sdk/client"
)
const (
flagBind = "bind"
flagCORS = "cors"
)
// XXX: remove this when not needed
func todoNotImplemented(_ *cobra.Command, _ []string) error {
return errors.New("TODO: Command not yet implemented")
}
// ServeCommand will generate a long-running rest server
// (aka Light Client Daemon) that exposes functionality similar
// to the cli, but over rest
func ServeCommand() *cobra.Command {
cmd := &cobra.Command{
Use: "serve",
Short: "Start LCD (light-client daemon), a local REST server",
RunE: todoNotImplemented,
}
// TODO: handle unix sockets also?
cmd.Flags().StringP(flagBind, "b", "localhost:1317", "Interface and port that server binds to")
cmd.Flags().String(flagCORS, "", "Set to domains that can make CORS requests (* for all)")
cmd.Flags().StringP(client.FlagChainID, "c", "", "ID of chain we connect to")
cmd.Flags().StringP(client.FlagNode, "n", "tcp://localhost:46657", "Node to connect to")
return cmd
}