cosmos-sdk/cmd/basecli/main.go

52 lines
1.4 KiB
Go
Raw Normal View History

2017-04-27 14:17:06 -07:00
package main
import (
"os"
"github.com/spf13/cobra"
keycmd "github.com/tendermint/go-crypto/cmd"
"github.com/tendermint/light-client/commands"
"github.com/tendermint/light-client/commands/proofs"
2017-05-16 11:21:55 -07:00
"github.com/tendermint/light-client/commands/proxy"
2017-04-27 14:17:06 -07:00
"github.com/tendermint/light-client/commands/seeds"
"github.com/tendermint/light-client/commands/txs"
"github.com/tendermint/tmlibs/cli"
2017-04-27 14:17:06 -07:00
)
// BaseCli represents the base command when called without any subcommands
var BaseCli = &cobra.Command{
Use: "basecli",
Short: "Light client for tendermint",
Long: `Basecli is an version of tmcli including custom logic to
present a nice (not raw hex) interface to the basecoin blockchain structure.
This is a useful tool, but also serves to demonstrate how one can configure
tmcli to work for any custom abci app.
`,
}
2017-05-01 00:05:54 -07:00
func main() {
2017-04-27 14:17:06 -07:00
commands.AddBasicFlags(BaseCli)
2017-05-01 00:05:54 -07:00
//initialize proofs and txs
2017-04-27 14:17:06 -07:00
proofs.StatePresenters.Register("account", AccountPresenter{})
proofs.StatePresenters.Register("counter", CounterPresenter{})
2017-04-27 14:17:06 -07:00
proofs.TxPresenters.Register("base", BaseTxPresenter{})
2017-05-16 14:53:58 -07:00
2017-04-27 14:17:06 -07:00
txs.Register("send", SendTxMaker{})
2017-05-16 14:53:58 -07:00
txs.Register("counter", CounterTxMaker{})
2017-04-27 14:17:06 -07:00
2017-05-01 00:05:54 -07:00
// set up the various commands to use
BaseCli.AddCommand(
keycmd.RootCmd,
commands.InitCmd,
seeds.RootCmd,
proofs.RootCmd,
txs.RootCmd,
2017-05-16 11:21:55 -07:00
proxy.RootCmd,
2017-05-01 00:05:54 -07:00
)
cmd := cli.PrepareMainCmd(BaseCli, "BC", os.ExpandEnv("$HOME/.basecli"))
cmd.Execute()
2017-04-27 14:17:06 -07:00
}