Documentation
¶
Index ¶
- Constants
- Variables
- func AppTx(name string, data []byte) error
- func BasecoinRoot(rootDir string) string
- func ExecuteWithDebug(RootCmd *cobra.Command)
- func NewIBCPlugin() *ibc.IBCPlugin
- func Query(tmAddr string, key []byte) (*abci.ResponseQuery, error)
- func QuickVersionCmd(version string) *cobra.Command
- func RegisterFlags(c *cobra.Command, flags []Flag2Register)
- func RegisterPersistentFlags(c *cobra.Command, flags []Flag2Register)
- func RegisterQuerySubcommand(cmd *cobra.Command)
- func RegisterStartPlugin(name string, newPlugin func() types.Plugin)
- func RegisterTxSubcommand(cmd *cobra.Command)
- func StripHex(s string) string
- type Address
- type BlockHex
- type BlockJSON
- type Flag2Register
- type Key
Constants ¶
View Source
const EyesCacheSize = 10000
TODO: move to config file
Variables ¶
View Source
var ( IBCTxCmd = &cobra.Command{ Use: "ibc", Short: "An IBC transaction, for InterBlockchain Communication", } IBCRegisterTxCmd = &cobra.Command{ Use: "register", Short: "Register a blockchain via IBC", RunE: ibcRegisterTxCmd, } IBCUpdateTxCmd = &cobra.Command{ Use: "update", Short: "Update the latest state of a blockchain via IBC", RunE: ibcUpdateTxCmd, } IBCPacketTxCmd = &cobra.Command{ Use: "packet", Short: "Send a new packet via IBC", } IBCPacketCreateTxCmd = &cobra.Command{ Use: "create", Short: "Create an egress IBC packet", RunE: ibcPacketCreateTxCmd, } IBCPacketPostTxCmd = &cobra.Command{ Use: "post", Short: "Deliver an IBC packet to another chain", RunE: ibcPacketPostTxCmd, } )
commands
View Source
var ( KeyCmd = &cobra.Command{ Use: "key", Short: "Manage keys", } NewKeyCmd = &cobra.Command{ Use: "new", Short: "Create a new private key", RunE: newKeyCmd, } )
commands
View Source
var ( QueryCmd = &cobra.Command{ Use: "query [key]", Short: "Query the merkle tree", RunE: queryCmd, } AccountCmd = &cobra.Command{ Use: "account [address]", Short: "Get details of an account", RunE: accountCmd, } BlockCmd = &cobra.Command{ Use: "block [height]", Short: "Get the header and commit of a block", RunE: blockCmd, } VerifyCmd = &cobra.Command{ Use: "verify", Short: "Verify the IAVL proof", RunE: verifyCmd, } )
commands
View Source
var ( TxCmd = &cobra.Command{ Use: "tx", Short: "Create, sign, and broadcast a transaction", } SendTxCmd = &cobra.Command{ Use: "send", Short: "A SendTx transaction, for sending tokens around", RunE: sendTxCmd, } AppTxCmd = &cobra.Command{ Use: "app", Short: "An AppTx transaction, for sending raw data to plugins", RunE: appTxCmd, } )
commands
View Source
var DefaultHome = ".basecoin"
This variable can be overwritten by plugin applications if they require a different working directory
View Source
var GenesisJSON = `` /* 568-byte string literal not displayed */
View Source
var (
InitCmd = &cobra.Command{
Use: "init",
Short: "Initialize a basecoin blockchain",
RunE: initCmd,
}
)
commands
View Source
var Key1JSON = `` /* 355-byte string literal not displayed */
View Source
var Key2JSON = `` /* 355-byte string literal not displayed */
View Source
var PrivValJSON = `` /* 409-byte string literal not displayed */
View Source
var StartCmd = &cobra.Command{
Use: "start",
Short: "Start basecoin",
RunE: startCmd,
}
View Source
var UnsafeResetAllCmd = &cobra.Command{
Use: "unsafe_reset_all",
Short: "Reset all blockchain data",
RunE: unsafeResetAllCmd,
}
Functions ¶
func BasecoinRoot ¶ added in v0.3.0
func ExecuteWithDebug ¶ added in v0.4.0
Add debugging flag and execute the root command
func NewIBCPlugin ¶
returns a new IBC plugin to be registered with Basecoin
func QuickVersionCmd ¶ added in v0.4.0
Returns a version command based on version input
func RegisterFlags ¶ added in v0.4.0
func RegisterFlags(c *cobra.Command, flags []Flag2Register)
register flag utils
func RegisterPersistentFlags ¶ added in v0.4.0
func RegisterPersistentFlags(c *cobra.Command, flags []Flag2Register)
func RegisterQuerySubcommand ¶
Register a subcommand of QueryCmd for plugin specific query functionality
func RegisterStartPlugin ¶
RegisterStartPlugin is used to enable a plugin
func RegisterTxSubcommand ¶
Register a subcommand of TxCmd to craft transactions for plugins
Types ¶
type Address ¶ added in v0.3.0
type Address [20]byte
func (Address) MarshalJSON ¶ added in v0.3.0
func (*Address) UnmarshalJSON ¶ added in v0.3.0
type Flag2Register ¶ added in v0.4.0
Quickly registering flags can be quickly achieved through using the utility functions RegisterFlags, and RegisterPersistentFlags. Ex:
flags := []Flag2Register{
{&myStringFlag, "mystringflag", "foobar", "description of what this flag does"},
{&myBoolFlag, "myboolflag", false, "description of what this flag does"},
{&myInt64Flag, "myintflag", 333, "description of what this flag does"},
}
RegisterFlags(MyCobraCmd, flags)
Click to show internal directories.
Click to hide internal directories.