-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ordering Transaction Results Issue #72
Comments
@LiraLemur As You asked on the chat here is full code (I'm not professional python programmer):
The problematic is changing order of transactions, I'm trying its at the function:
The logs of the function is:
The same problem is with another combinations from: https://iroha.readthedocs.io/en/main/develop/api/queries.html#result-pagination :
but the field
So the question is: how to change order of transactions fetched with query |
Config file and genesis.block, and keys of admin and nodes are the same as here: https://github.com/hyperledger/iroha/tree/main/example the only difference in config file is in database connection string and blockchain path. |
Hello, I added ordering_sequence as query params in iroha.py. I made a PR: #73 that should fix the problem. |
* Add ordering sequence to params Makes possible to add ordering sequence to Query. Fixes #72 Signed-off-by: Rafik Naccache <[email protected]> * Add :param ordering_sequence: Signed-off-by: Rafik Naccache <[email protected]> * Fix wrong example for :param ordering_sequence: Signed-off-by: Rafik Naccache <[email protected]> * fix wrong ordering message construction in query After more documentation I got to the way to construct to ordering object Signed-off-by: Rafik Naccache <[email protected]> * remove redundant OR clause to manage ordering_sequence Signed-off-by: Rafik Naccache <[email protected]>
* Add ordering sequence to params in query (#73) * Add ordering sequence to params Makes possible to add ordering sequence to Query. Fixes #72 Signed-off-by: Rafik Naccache <[email protected]> * Add :param ordering_sequence: Signed-off-by: Rafik Naccache <[email protected]> * Fix wrong example for :param ordering_sequence: Signed-off-by: Rafik Naccache <[email protected]> * fix wrong ordering message construction in query After more documentation I got to the way to construct to ordering object Signed-off-by: Rafik Naccache <[email protected]> * remove redundant OR clause to manage ordering_sequence Signed-off-by: Rafik Naccache <[email protected]> * Correction after review Signed-off-by: Grzegorz Bazior <[email protected]> * Migrated from main branch also protobuf files Signed-off-by: G.Bazior <[email protected]> * Updated proto files with script download-schema.py Signed-off-by: G.Bazior <[email protected]> * Updated generated from protobuf python files (script compile-proto.py) Signed-off-by: G.Bazior <[email protected]> Co-authored-by: Rafik NACCACHE <[email protected]>
* Add ordering sequence to params Makes possible to add ordering sequence to Query. Fixes hyperledger-iroha#72 Signed-off-by: Rafik Naccache <[email protected]> * Add :param ordering_sequence: Signed-off-by: Rafik Naccache <[email protected]> * Fix wrong example for :param ordering_sequence: Signed-off-by: Rafik Naccache <[email protected]> * fix wrong ordering message construction in query After more documentation I got to the way to construct to ordering object Signed-off-by: Rafik Naccache <[email protected]> * remove redundant OR clause to manage ordering_sequence Signed-off-by: Rafik Naccache <[email protected]>
* Add ordering sequence to params Makes possible to add ordering sequence to Query. Fixes hyperledger-iroha#72 Signed-off-by: Rafik Naccache <[email protected]> * Add :param ordering_sequence: Signed-off-by: Rafik Naccache <[email protected]> * Fix wrong example for :param ordering_sequence: Signed-off-by: Rafik Naccache <[email protected]> * fix wrong ordering message construction in query After more documentation I got to the way to construct to ordering object Signed-off-by: Rafik Naccache <[email protected]> * remove redundant OR clause to manage ordering_sequence Signed-off-by: Rafik Naccache <[email protected]> Signed-off-by: G.Bazior <[email protected]>
* Extending TxPaginationMeta in queries (#77) * quries extended * example added * docs comment added * schema changed * formatting fixed * ordering added * edge case fix, now 0 passed as height or timestamp is passing * PaginationMeta in GetPendingTransactions * examples/query_transactions.py Signed-off-by: Piotr Pawlowski <[email protected]> Signed-off-by: G.Bazior <[email protected]> * Update proto files and generated python files to support Iroha 1.4 (#96) * Update proto files with script `download-schema.py` Signed-off-by: Grzegorz Bazior <[email protected]> * Generated python files from protobuf files with script `compile-proto.py` Signed-off-by: G.Bazior <[email protected]> Co-authored-by: Grzegorz Bazior <[email protected]> Signed-off-by: G.Bazior <[email protected]> * Corrected merge - rerun scripts: download-schema.py and compile-proto.py Signed-off-by: G.Bazior <[email protected]> * Tab -> spaces Signed-off-by: G.Bazior <[email protected]> * Add ability to provide custom TLS cert (#63) Signed-off-by: Stepan Lavrentev <[email protected]> Signed-off-by: G.Bazior <[email protected]> * Add ordering sequence to params in query (#73) * Add ordering sequence to params Makes possible to add ordering sequence to Query. Fixes #72 Signed-off-by: Rafik Naccache <[email protected]> * Add :param ordering_sequence: Signed-off-by: Rafik Naccache <[email protected]> * Fix wrong example for :param ordering_sequence: Signed-off-by: Rafik Naccache <[email protected]> * fix wrong ordering message construction in query After more documentation I got to the way to construct to ordering object Signed-off-by: Rafik Naccache <[email protected]> * remove redundant OR clause to manage ordering_sequence Signed-off-by: Rafik Naccache <[email protected]> Signed-off-by: G.Bazior <[email protected]> * Extending TxPaginationMeta in queries (#77) * quries extended * example added * docs comment added * schema changed * formatting fixed * ordering added * edge case fix, now 0 passed as height or timestamp is passing * PaginationMeta in GetPendingTransactions * examples/query_transactions.py Signed-off-by: Piotr Pawlowski <[email protected]> Signed-off-by: G.Bazior <[email protected]> * Added missing changes from Pawlak00@b6d7f42 corrected in #77 Signed-off-by: G.Bazior <[email protected]> Co-authored-by: Piotr Pawłowski <[email protected]> Co-authored-by: Grzegorz Bazior <[email protected]> Co-authored-by: Stepan Lavrentev <[email protected]> Co-authored-by: Rafik NACCACHE <[email protected]>
* Extending TxPaginationMeta in queries (#77) * quries extended * example added * docs comment added * schema changed * formatting fixed * ordering added * edge case fix, now 0 passed as height or timestamp is passing * PaginationMeta in GetPendingTransactions * examples/query_transactions.py Signed-off-by: Piotr Pawlowski <[email protected]> Signed-off-by: G.Bazior <[email protected]> * Update proto files and generated python files to support Iroha 1.4 (#96) * Update proto files with script `download-schema.py` Signed-off-by: Grzegorz Bazior <[email protected]> * Generated python files from protobuf files with script `compile-proto.py` Signed-off-by: G.Bazior <[email protected]> Co-authored-by: Grzegorz Bazior <[email protected]> Signed-off-by: G.Bazior <[email protected]> * Corrected merge - rerun scripts: download-schema.py and compile-proto.py Signed-off-by: G.Bazior <[email protected]> * Tab -> spaces Signed-off-by: G.Bazior <[email protected]> * Add ability to provide custom TLS cert (#63) Signed-off-by: Stepan Lavrentev <[email protected]> Signed-off-by: G.Bazior <[email protected]> * Add ordering sequence to params in query (#73) * Add ordering sequence to params Makes possible to add ordering sequence to Query. Fixes #72 Signed-off-by: Rafik Naccache <[email protected]> * Add :param ordering_sequence: Signed-off-by: Rafik Naccache <[email protected]> * Fix wrong example for :param ordering_sequence: Signed-off-by: Rafik Naccache <[email protected]> * fix wrong ordering message construction in query After more documentation I got to the way to construct to ordering object Signed-off-by: Rafik Naccache <[email protected]> * remove redundant OR clause to manage ordering_sequence Signed-off-by: Rafik Naccache <[email protected]> Signed-off-by: G.Bazior <[email protected]> * Extending TxPaginationMeta in queries (#77) * quries extended * example added * docs comment added * schema changed * formatting fixed * ordering added * edge case fix, now 0 passed as height or timestamp is passing * PaginationMeta in GetPendingTransactions * examples/query_transactions.py Signed-off-by: Piotr Pawlowski <[email protected]> Signed-off-by: G.Bazior <[email protected]> * Added missing changes from Pawlak00@b6d7f42 corrected in #77 Signed-off-by: G.Bazior <[email protected]> * Examples refactor + added example of MST developed by Leo (#103) * Refactoring of example tx-example.py Signed-off-by: G.Bazior <[email protected]> * Added sample of MST transactions. The code was originally developed by Leo: https://github.com/iptelephony/jubilant-engine but he agreed to add his code to examples Signed-off-by: G.Bazior <[email protected]> * Generated protobuf files with protobuf 3.12.4 on Ubuntu 21.04 (#104) Signed-off-by: G.Bazior <[email protected]> * Serious refactoring + improvements + adding new examples for Iroha 1 (#107) * Update README * Refactoring in tls-example.py * A little refactoring of batch-example.py * Small refactoring of blocks-query.py * Small refactoring of infinite-blocks-stream.py * Added sample how to use ordering of result transactions * Refacroting in query_transactions.py * Renamed file with convention used in other files * Added examples in comments * Some refactoring in examples + added docstring in each file * chmod +x * Updated iroha version from 1.4 -> 1.5 Signed-off-by: G.Bazior <[email protected]> * Add autorestart to iroha Signed-off-by: Alexey Rodionov <[email protected]> * Cherry-pick fix Signed-off-by: G.Bazior <[email protected]> * Generated python files from protobuf on Ubuntu:20.04 Signed-off-by: G.Bazior <[email protected]> * Dependencies fix Signed-off-by: G.Bazior <[email protected]> * Added space in logging after review Signed-off-by: G.Bazior <[email protected]> * Made import in code more readable after review Signed-off-by: G.Bazior <[email protected]> Signed-off-by: Piotr Pawlowski <[email protected]> Signed-off-by: G.Bazior <[email protected]> Signed-off-by: Stepan Lavrentev <[email protected]> Signed-off-by: Rafik Naccache <[email protected]> Signed-off-by: Alexey Rodionov <[email protected]> Co-authored-by: Piotr Pawłowski <[email protected]> Co-authored-by: Grzegorz Bazior <[email protected]> Co-authored-by: Stepan Lavrentev <[email protected]> Co-authored-by: Rafik NACCACHE <[email protected]> Co-authored-by: Alexey Rodionov <[email protected]>
https://iroha.readthedocs.io/en/main/develop/api/queries.html#result-pagination seems not to be working very well:
by @baziorek:
"I've tried:
pagination_meta = queries_pb2.TxPaginationMeta()
pagination_meta.ordering.sequence = [queries_pb2.kCreatedTime, queries_pb2.kAscending]
But for each try I'm seeing problem, e.g. for above:
AttributeError: Assignment not allowed to repeated field "sequence" in protocol message object."
The text was updated successfully, but these errors were encountered: