mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-01 13:47:07 +00:00
add counter app in python
This commit is contained in:
@@ -45,6 +45,13 @@ func main() {
|
||||
cmdConsole(app, c)
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "echo",
|
||||
Usage: "Have the application echo a message",
|
||||
Action: func(c *cli.Context) {
|
||||
cmdEcho(c)
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "info",
|
||||
Usage: "Get some info about the application",
|
||||
@@ -140,6 +147,19 @@ func cmdConsole(app *cli.App, c *cli.Context) {
|
||||
}
|
||||
}
|
||||
|
||||
// Have the application echo a message
|
||||
func cmdEcho(c *cli.Context) {
|
||||
args := c.Args()
|
||||
if len(args) != 1 {
|
||||
Exit("echo takes 1 argument")
|
||||
}
|
||||
res, err := makeRequest(conn, types.RequestEcho{args[0]})
|
||||
if err != nil {
|
||||
Exit(err.Error())
|
||||
}
|
||||
fmt.Println(res)
|
||||
}
|
||||
|
||||
// Get some info from the application
|
||||
func cmdInfo(c *cli.Context) {
|
||||
res, err := makeRequest(conn, types.RequestInfo{})
|
||||
|
||||
Reference in New Issue
Block a user