commands

package
v0.5.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 2, 2017 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

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 GenesisJSON = `` /* 606-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 = `` /* 368-byte string literal not displayed */
View Source
var Key2JSON = `` /* 368-byte string literal not displayed */
View Source
var PrivValJSON = `` /* 475-byte string literal not displayed */
View Source
var RelayCmd = &cobra.Command{
	Use:   "relay",
	Short: "Start basecoin relayer to relay IBC packets between chains",
	RunE:  relayCmd,
}
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,
}
View Source
var VersionCmd = &cobra.Command{
	Use:   "version",
	Short: "Show version info",
	Run: func(cmd *cobra.Command, args []string) {
		fmt.Println(version.Version)
	},
}

Functions

func AppTx

func AppTx(name string, data []byte) error

func NewIBCPlugin

func NewIBCPlugin() *ibc.IBCPlugin

returns a new IBC plugin to be registered with Basecoin

func Query

func Query(tmAddr string, key []byte) (*abci.ResultQuery, error)

func QuickVersionCmd added in v0.4.0

func QuickVersionCmd(version string) *cobra.Command

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

func RegisterQuerySubcommand(cmd *cobra.Command)

Register a subcommand of QueryCmd for plugin specific query functionality

func RegisterStartPlugin

func RegisterStartPlugin(name string, newPlugin func() types.Plugin)

RegisterStartPlugin is used to enable a plugin

func RegisterTxSubcommand

func RegisterTxSubcommand(cmd *cobra.Command)

Register a subcommand of TxCmd to craft transactions for plugins

func StripHex

func StripHex(s string) string

Types

type Address added in v0.3.0

type Address [20]byte

func (Address) MarshalJSON added in v0.3.0

func (a Address) MarshalJSON() ([]byte, error)

func (*Address) UnmarshalJSON added in v0.3.0

func (a *Address) UnmarshalJSON(addrHex []byte) error

type BlockHex

type BlockHex struct {
	Header data.Bytes `json:"header"`
	Commit data.Bytes `json:"commit"`
}

type BlockJSON

type BlockJSON struct {
	Header *tmtypes.Header `json:"header"`
	Commit *tmtypes.Commit `json:"commit"`
}

type Flag2Register added in v0.4.0

type Flag2Register struct {
	Pointer interface{}
	Use     string
	Value   interface{}
	Desc    string
}

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)

type Key

type Key struct {
	Address Address        `json:"address"`
	PubKey  crypto.PubKey  `json:"pub_key"`
	PrivKey crypto.PrivKey `json:"priv_key"`
}

func LoadKey

func LoadKey(keyFile string) (*Key, error)

func (*Key) Sign

func (k *Key) Sign(msg []byte) crypto.Signature

Implements Signer

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL