proofs

package
v0.10.3 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2017 License: Apache-2.0 Imports: 10 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var KeyCmd = &cobra.Command{
	Use:   "key [key]",
	Short: "Handle proofs for state of abci app",
	Long: `This will look up a given key in the abci app, verify the proof,
and output it as hex.

If you want json output, use an app-specific command that knows key and value structure.`,
	RunE: commands.RequireInit(doKeyQuery),
}
View Source
var RootCmd = &cobra.Command{
	Use:   "query",
	Short: "Get and store merkle proofs for blockchain data",
	Long: `Proofs allows you to validate data and merkle proofs.

These proofs tie the data to a checkpoint, which is managed by "seeds".
Here we can validate these proofs and import/export them to prove specific
data to other peers as needed.
`,
}

RootCmd represents the base command when called without any subcommands

View Source
var TxCmd = &cobra.Command{
	Use:   "tx [txhash]",
	Short: "Handle proofs of commited txs",
	Long: `Proofs allows you to validate abci state with merkle proofs.

These proofs tie the data to a checkpoint, which is managed by "seeds".
Here we can validate these proofs and import/export them to prove specific
data to other peers as needed.
`,
	RunE: commands.RequireInit(doTxQuery),
}
View Source
var TxPresenters = proofs.NewPresenters()

Functions

func GetAndParseAppProof added in v0.10.1

func GetAndParseAppProof(key []byte, data interface{}) (lc.Proof, error)

GetAndParseAppProof does most of the work of the query commands, but is quite opinionated, so if you want more control, set up the items and call GetProof directly. Notably, it always uses go-wire.ReadBinaryBytes to deserialize, and Height and Node from standard flags.

It will try to get the proof for the given key. If it is successful, it will return the proof and also unserialize proof.Data into the data argument (so pass in a pointer to the appropriate struct)

func GetHeight added in v0.10.1

func GetHeight() int

func GetProof added in v0.10.1

func GetProof(node client.Client, prover lc.Prover, key []byte, height int) (proof lc.Proof, err error)

GetProof performs the get command directly from the proof (not from the CLI)

func OutputProof added in v0.10.1

func OutputProof(info interface{}, height uint64) error

OutputProof prints the proof to stdout reuse this for printing proofs and we should enhance this for text/json, better presentation of height

func ParseHexKey added in v0.10.1

func ParseHexKey(args []string, argname string) ([]byte, error)

ParseHexKey parses the key flag as hex and converts to bytes or returns error argname is used to customize the error message

Types

This section is empty.

Jump to

Keyboard shortcuts

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