tendermint / light-client

DEPRECATED: A light client for tendermint, supporting signatures, proofs, and validation (see github.com/tendermint/tendermint/lite)
Other
17 stars 9 forks source link

Add query flags to light client #13

Closed rigelrozanski closed 7 years ago

rigelrozanski commented 7 years ago

For consistency I believe it makes sense to include a light client (tmcli and basecli) query command which can be accessed in a similar way to in the native applications... Is there not a way to currently do this already? If so, let me know here, but yeah nonetheless still makes sense to include as a second level command beside tx

ethanfrey commented 7 years ago

There is a command called "proof", which does what query does. Plus like 3 levels of cryptogrpahic checks before accepting any answer.

There should be no functionality in light-client that trusts an answer without proof. Or course there is a little now, but as the rpc advances that should drop to 0, so people can build on it and just trust the results.

Is that a good enough answer? Or is there something I am missing?

rigelrozanski commented 7 years ago

Okay so right now basecli proof has state get, how would one query an account using this? Are we just missing a bit of functionality to query an account from state, which might be in the form state get account which would add the state key automatically to the presented hex account? Makes sense?

ethanfrey commented 7 years ago

I think I did this... basecli proof state get --app=account --key=deadbeef or something like this.

Let's talk about this

ethanfrey commented 7 years ago

No complaints after this explanation, closing issue.

rigelrozanski commented 7 years ago

HEY! I've got some complaints... I think that we need the ability to add flags to the query command, not sufficient to not be able to query without flags, with the trackomatron plugin, I need the ability to query for specific lists of profiles, The only way I know of to query right now through the light cli would be to do something like

basecli proof state get --app=account --key=$ME

I can add a new presenter which will enable new unmarshalling structs under app, but this doesn't allow me to add modifiers to how information should be queried... any ideas? I'm thinking we proof to be more versatile for plugins like txs currently is... thoughts?

rigelrozanski commented 7 years ago

Check out the complexity of the query functionality I need: definitely need options above simply providing the key to query... mostly surrounds querying lists of profiles or invoices https://github.com/tendermint/trackomatron/blob/master/cmd/tracko/commands/query.go

rigelrozanski commented 7 years ago

Another, note it might actually be okay, an light-client application will just need to build its own query commands which call a loop of proof state get for making more complex queries... Will test out, leave this issue open until this is successfully resolved. ALSO this all changes if a reimplementation of basecoin includes batch queries

ethanfrey commented 7 years ago

Bigger refactor on all the query stuff and now addressed by changes in pr #21