added rest server and status endpoint added get block endpoint added latest block endpoint add 404 if height is out of bounds add version endpoint add validators endpoint export GetBlockHeight add keys endpoints add txs endpoints added verb limiters to ednpoints only output node info + json structure improvement fixed wrong body parsing github PR template crypto.Address -> sdk.Address revert to old go-wire update glide remove print statement and update glide fix #554 add .DS_Store to .gitignore Massive consolidation: queue, data storage struct, store, logic, ... Small fixes
81 lines
1.9 KiB
Go
81 lines
1.9 KiB
Go
package main
|
|
|
|
import (
|
|
"errors"
|
|
"os"
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
"github.com/tendermint/tmlibs/cli"
|
|
|
|
"github.com/cosmos/cosmos-sdk/client"
|
|
"github.com/cosmos/cosmos-sdk/client/keys"
|
|
"github.com/cosmos/cosmos-sdk/client/lcd"
|
|
"github.com/cosmos/cosmos-sdk/client/rpc"
|
|
"github.com/cosmos/cosmos-sdk/client/tx"
|
|
coolcmd "github.com/cosmos/cosmos-sdk/examples/basecoin/x/cool/commands"
|
|
"github.com/cosmos/cosmos-sdk/version"
|
|
authcmd "github.com/cosmos/cosmos-sdk/x/auth/commands"
|
|
bankcmd "github.com/cosmos/cosmos-sdk/x/bank/commands"
|
|
|
|
"github.com/cosmos/cosmos-sdk/examples/basecoin/app"
|
|
"github.com/cosmos/cosmos-sdk/examples/basecoin/types"
|
|
)
|
|
|
|
// gaiacliCmd is the entry point for this binary
|
|
var (
|
|
basecliCmd = &cobra.Command{
|
|
Use: "basecli",
|
|
Short: "Basecoin light-client",
|
|
}
|
|
)
|
|
|
|
func todoNotImplemented(_ *cobra.Command, _ []string) error {
|
|
return errors.New("TODO: Command not yet implemented")
|
|
}
|
|
|
|
func main() {
|
|
// disable sorting
|
|
cobra.EnableCommandSorting = false
|
|
|
|
// get the codec
|
|
cdc := app.MakeCodec()
|
|
|
|
// add standard rpc, and tx commands
|
|
rpc.AddCommands(basecliCmd)
|
|
basecliCmd.AddCommand(client.LineBreak)
|
|
tx.AddCommands(basecliCmd, cdc)
|
|
basecliCmd.AddCommand(client.LineBreak)
|
|
|
|
// add query/post commands (custom to binary)
|
|
basecliCmd.AddCommand(
|
|
client.GetCommands(
|
|
authcmd.GetAccountCmd("main", cdc, types.GetParseAccount(cdc)),
|
|
)...)
|
|
basecliCmd.AddCommand(
|
|
client.PostCommands(
|
|
bankcmd.SendTxCmd(cdc),
|
|
)...)
|
|
basecliCmd.AddCommand(
|
|
client.PostCommands(
|
|
coolcmd.QuizTxCmd(cdc),
|
|
)...)
|
|
basecliCmd.AddCommand(
|
|
client.PostCommands(
|
|
coolcmd.SetTrendTxCmd(cdc),
|
|
)...)
|
|
|
|
// add proxy, version and key info
|
|
basecliCmd.AddCommand(
|
|
client.LineBreak,
|
|
lcd.ServeCommand(cdc),
|
|
keys.Commands(),
|
|
client.LineBreak,
|
|
version.VersionCmd,
|
|
)
|
|
|
|
// prepare and add flags
|
|
executor := cli.PrepareMainCmd(basecliCmd, "BC", os.ExpandEnv("$HOME/.basecli"))
|
|
executor.Execute()
|
|
}
|