Clean up comments
This commit is contained in:
parent
483ed6d87a
commit
0133723aca
|
@ -27,13 +27,12 @@ import (
|
|||
// BaseCli - main basecoin client command
|
||||
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.
|
||||
Short: "Light client for Tendermint",
|
||||
Long: `Basecli is a certifying light client for the basecoin abci app.
|
||||
|
||||
This is a useful tool, but also serves to demonstrate how one can configure
|
||||
tmcli to work for any custom abci app.
|
||||
`,
|
||||
It leverages the power of the tendermint consensus algorithm get full
|
||||
cryptographic proof of all queries while only syncing a fraction of the
|
||||
block headers.`,
|
||||
}
|
||||
|
||||
func main() {
|
||||
|
|
|
@ -35,7 +35,6 @@ func main() {
|
|||
// out own init command to not require argument
|
||||
InitCmd,
|
||||
commands.StartCmd,
|
||||
//commands.RelayCmd,
|
||||
commands.UnsafeResetAllCmd,
|
||||
commands.VersionCmd,
|
||||
)
|
||||
|
|
|
@ -21,7 +21,7 @@ import (
|
|||
// EyesCli - main basecoin client command
|
||||
var EyesCli = &cobra.Command{
|
||||
Use: "eyescli",
|
||||
Short: "Light client for tendermint",
|
||||
Short: "Light client for Tendermint",
|
||||
Long: `EyesCli is the light client for a merkle key-value store (eyes)`,
|
||||
}
|
||||
|
||||
|
@ -33,7 +33,7 @@ func main() {
|
|||
// These are default parsers, but optional in your app (you can remove key)
|
||||
query.TxQueryCmd,
|
||||
query.KeyQueryCmd,
|
||||
// this is out custom parser
|
||||
// this is our custom parser
|
||||
etccmd.EtcQueryCmd,
|
||||
)
|
||||
|
||||
|
|
|
@ -22,9 +22,10 @@ var RemoveTxCmd = &cobra.Command{
|
|||
RunE: commands.RequireInit(removeTxCmd),
|
||||
}
|
||||
|
||||
//nolint
|
||||
const (
|
||||
FlagKey = "key"
|
||||
// FlagKey is the cli flag to set the key
|
||||
FlagKey = "key"
|
||||
// FlagValue is the cli flag to set the value
|
||||
FlagValue = "value"
|
||||
)
|
||||
|
||||
|
|
|
@ -73,7 +73,8 @@ func (h Handler) DeliverTx(ctx basecoin.Context, store state.SimpleDB, tx baseco
|
|||
return
|
||||
}
|
||||
|
||||
// doSetTx write to the store, overwriting any previous value
|
||||
// doSetTx writes to the store, overwriting any previous value
|
||||
// note that an empty response in DeliverTx is OK with no log or data returned
|
||||
func (h Handler) doSetTx(ctx basecoin.Context, store state.SimpleDB, tx SetTx) (res basecoin.DeliverResult, err error) {
|
||||
data := NewData(tx.Value, ctx.BlockHeight())
|
||||
store.Set(tx.Key, wire.BinaryBytes(data))
|
||||
|
@ -81,6 +82,7 @@ func (h Handler) doSetTx(ctx basecoin.Context, store state.SimpleDB, tx SetTx) (
|
|||
}
|
||||
|
||||
// doRemoveTx deletes the value from the store and returns the last value
|
||||
// here we let res.Data to return the value over abci
|
||||
func (h Handler) doRemoveTx(ctx basecoin.Context, store state.SimpleDB, tx RemoveTx) (res basecoin.DeliverResult, err error) {
|
||||
// we set res.Data so it gets returned to the client over the abci interface
|
||||
res.Data = store.Get(tx.Key)
|
||||
|
|
|
@ -5,7 +5,7 @@ import "github.com/tendermint/go-wire/data"
|
|||
// Data is the struct we use to store in the merkle tree
|
||||
type Data struct {
|
||||
// SetAt is the block height this was set at
|
||||
SetAt uint64 `json:"created_at"`
|
||||
SetAt uint64 `json:"set_at"`
|
||||
// Value is the data that was stored.
|
||||
// data.Bytes is like []byte but json encodes as hex not base64
|
||||
Value data.Bytes `json:"value"`
|
||||
|
|
|
@ -20,14 +20,14 @@ oneTimeSetUp() {
|
|||
export EYE_HOME=${SERVE_DIR}
|
||||
${SERVER_EXE} init --chain-id=$CHAIN_ID >>$SERVER_LOG
|
||||
startServer $SERVE_DIR $SERVER_LOG
|
||||
if [ $? != 0 ]; then return 1; fi
|
||||
[ $? = 0 ] || return 1
|
||||
|
||||
# Set up client - make sure you use the proper prefix if you set
|
||||
# a custom CLIENT_EXE
|
||||
export EYE_HOME=${BASE_DIR}/client
|
||||
|
||||
initClient $CHAIN_ID
|
||||
if [ $? != 0 ]; then return 1; fi
|
||||
[ $? = 0 ] || return 1
|
||||
|
||||
printf "...Testing may begin!\n\n\n"
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue