Documentation
¶
Index ¶
- Constants
- Variables
- func AppTx(c *cli.Context, name string, data []byte) error
- func BasecoinRoot(rootDir string) string
- func NewIBCPlugin() *ibc.IBCPlugin
- func ParseCoin(str string) (types.Coin, error)
- func ParseCoins(str string) (types.Coins, error)
- func Query(tmAddr string, key []byte) (*abci.ResponseQuery, error)
- func RegisterQuerySubcommand(cmd cli.Command)
- func RegisterStartPlugin(name string, newPlugin func() types.Plugin)
- func RegisterTxSubcommand(cmd cli.Command)
- func StripHex(s string) string
- type Address
- type BlockHex
- type BlockJSON
- type Key
Constants ¶
View Source
const EyesCacheSize = 10000
Variables ¶
View Source
var ( AddrFlag = cli.StringFlag{ Name: "address", Value: "tcp://0.0.0.0:46658", Usage: "Listen address", } EyesFlag = cli.StringFlag{ Name: "eyes", Value: "local", Usage: "MerkleEyes address, or 'local' for embedded", } WithoutTendermintFlag = cli.BoolFlag{ Name: "without-tendermint", Usage: "Run the Basecoin app without Tendermint", } )
start flags
View Source
var ( NodeFlag = cli.StringFlag{ Name: "node", Value: "tcp://localhost:46657", Usage: "Tendermint RPC address", } ToFlag = cli.StringFlag{ Name: "to", Value: "", Usage: "Destination address for the transaction", } AmountFlag = cli.StringFlag{ Name: "amount", Value: "", Usage: "Coins to send in transaction of the format <amt><coin>,<amt2><coin2>,... (eg: 1btc,2gold,5silver)", } FromFlag = cli.StringFlag{ Name: "from", Value: "key.json", Usage: "Path to a private key to sign the transaction", } SeqFlag = cli.IntFlag{ Name: "sequence", Value: 0, Usage: "Sequence number for the account", } GasFlag = cli.IntFlag{ Name: "gas", Value: 0, Usage: "The amount of gas for the transaction", } FeeFlag = cli.StringFlag{ Name: "fee", Value: "", Usage: "Coins for the transaction fee of the format <amt><coin>", } DataFlag = cli.StringFlag{ Name: "data", Value: "", Usage: "Data to send with the transaction", } NameFlag = cli.StringFlag{ Name: "name", Value: "", Usage: "Plugin to send the transaction to", } ChainIDFlag = cli.StringFlag{ Name: "chain_id", Value: "test_chain_id", Usage: "ID of the chain for replay protection", } )
View Source
var ( ProofFlag = cli.StringFlag{ Name: "proof", Usage: "hex-encoded IAVL proof", Value: "", } KeyFlag = cli.StringFlag{ Name: "key", Usage: "key to the IAVL tree", Value: "", } ValueFlag = cli.StringFlag{ Name: "value", Usage: "value in the IAVL tree", Value: "", } RootFlag = cli.StringFlag{ Name: "root", Usage: "root hash of the IAVL tree", Value: "", } )
proof flags
View Source
var ( IbcChainIDFlag = cli.StringFlag{ Name: "chain_id", Usage: "ChainID for the new blockchain", Value: "", } IbcGenesisFlag = cli.StringFlag{ Name: "genesis", Usage: "Genesis file for the new blockchain", Value: "", } IbcHeaderFlag = cli.StringFlag{ Name: "header", Usage: "Block header for an ibc update", Value: "", } IbcCommitFlag = cli.StringFlag{ Name: "commit", Usage: "Block commit for an ibc update", Value: "", } IbcFromFlag = cli.StringFlag{ Name: "from", Usage: "Source ChainID", Value: "", } IbcToFlag = cli.StringFlag{ Name: "to", Usage: "Destination ChainID", Value: "", } IbcTypeFlag = cli.StringFlag{ Name: "type", Usage: "IBC packet type (eg. coin)", Value: "", } IbcPayloadFlag = cli.StringFlag{ Name: "payload", Usage: "IBC packet payload", Value: "", } IbcPacketFlag = cli.StringFlag{ Name: "packet", Usage: "hex-encoded IBC packet", Value: "", } IbcProofFlag = cli.StringFlag{ Name: "proof", Usage: "hex-encoded proof of IBC packet from source chain", Value: "", } IbcSequenceFlag = cli.IntFlag{ Name: "sequence", Usage: "sequence number for IBC packet", Value: 0, } IbcHeightFlag = cli.IntFlag{ Name: "height", Usage: "Height the packet became egress in source chain", Value: 0, } )
View Source
var ( IbcTxCmd = cli.Command{ Name: "ibc", Usage: "an IBC transaction, for InterBlockchain Communication", Flags: TxFlags, Subcommands: []cli.Command{ IbcRegisterTxCmd, IbcUpdateTxCmd, IbcPacketTxCmd, }, } IbcRegisterTxCmd = cli.Command{ Name: "register", Usage: "Register a blockchain via IBC", Action: func(c *cli.Context) error { return cmdIBCRegisterTx(c) }, Flags: []cli.Flag{ IbcChainIDFlag, IbcGenesisFlag, }, } IbcUpdateTxCmd = cli.Command{ Name: "update", Usage: "Update the latest state of a blockchain via IBC", Action: func(c *cli.Context) error { return cmdIBCUpdateTx(c) }, Flags: []cli.Flag{ IbcHeaderFlag, IbcCommitFlag, }, } IbcPacketTxCmd = cli.Command{ Name: "packet", Usage: "Send a new packet via IBC", Subcommands: []cli.Command{ IbcPacketCreateTx, IbcPacketPostTx, }, } IbcPacketCreateTx = cli.Command{ Name: "create", Usage: "Create an egress IBC packet", Action: func(c *cli.Context) error { return cmdIBCPacketCreateTx(c) }, Flags: []cli.Flag{ IbcFromFlag, IbcToFlag, IbcTypeFlag, IbcPayloadFlag, IbcSequenceFlag, }, } IbcPacketPostTx = cli.Command{ Name: "post", Usage: "Deliver an IBC packet to another chain", Action: func(c *cli.Context) error { return cmdIBCPacketPostTx(c) }, Flags: []cli.Flag{ IbcFromFlag, IbcHeightFlag, IbcPacketFlag, IbcProofFlag, }, } )
View Source
var ( KeyCmd = cli.Command{ Name: "key", Usage: "Manage keys", ArgsUsage: "", Subcommands: []cli.Command{NewKeyCmd}, } NewKeyCmd = cli.Command{ Name: "new", Usage: "Create a new private key", ArgsUsage: "", Action: func(c *cli.Context) error { return cmdNewKey(c) }, } )
View Source
var ( QueryCmd = cli.Command{ Name: "query", Usage: "Query the merkle tree", ArgsUsage: "<key>", Action: func(c *cli.Context) error { return cmdQuery(c) }, Flags: []cli.Flag{ NodeFlag, }, } AccountCmd = cli.Command{ Name: "account", Usage: "Get details of an account", ArgsUsage: "<address>", Action: func(c *cli.Context) error { return cmdAccount(c) }, Flags: []cli.Flag{ NodeFlag, }, } BlockCmd = cli.Command{ Name: "block", Usage: "Get the header and commit of a block", ArgsUsage: "<height>", Action: func(c *cli.Context) error { return cmdBlock(c) }, Flags: []cli.Flag{ NodeFlag, }, } VerifyCmd = cli.Command{ Name: "verify", Usage: "Verify the IAVL proof", Action: func(c *cli.Context) error { return cmdVerify(c) }, Flags: []cli.Flag{ ProofFlag, KeyFlag, ValueFlag, RootFlag, }, } )
View Source
var ( TxCmd = cli.Command{ Name: "tx", Usage: "Create, sign, and broadcast a transaction", ArgsUsage: "", Subcommands: []cli.Command{ SendTxCmd, AppTxCmd, IbcTxCmd, }, } SendTxCmd = cli.Command{ Name: "send", Usage: "a SendTx transaction, for sending tokens around", ArgsUsage: "", Action: func(c *cli.Context) error { return cmdSendTx(c) }, Flags: append(TxFlags, ToFlag), } AppTxCmd = cli.Command{ Name: "app", Usage: "an AppTx transaction, for sending raw data to plugins", ArgsUsage: "", Action: func(c *cli.Context) error { return cmdAppTx(c) }, Flags: append(TxFlags, NameFlag, DataFlag), Subcommands: []cli.Command{}, } )
View Source
var InitCmd = cli.Command{ Name: "init", Usage: "Initialize a basecoin blockchain", ArgsUsage: "", Action: func(c *cli.Context) error { return cmdInit(c) }, Flags: []cli.Flag{ ChainIDFlag, }, }
View Source
var StartCmd = cli.Command{ Name: "start", Usage: "Start basecoin", ArgsUsage: "", Action: func(c *cli.Context) error { return cmdStart(c) }, Flags: []cli.Flag{ AddrFlag, EyesFlag, WithoutTendermintFlag, ChainIDFlag, }, }
View Source
var TxFlags = []cli.Flag{ NodeFlag, ChainIDFlag, FromFlag, AmountFlag, GasFlag, FeeFlag, SeqFlag, }
Functions ¶
func BasecoinRoot ¶ added in v0.3.0
func NewIBCPlugin ¶
returns a new IBC plugin to be registered with Basecoin
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
Click to show internal directories.
Click to hide internal directories.