Skip to content

Getting a client library version error for asset queries #232

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

Open
awhitenose opened this issue Apr 24, 2025 · 0 comments
Open

Getting a client library version error for asset queries #232

awhitenose opened this issue Apr 24, 2025 · 0 comments

Comments

@awhitenose
Copy link

With the recent Iroha (main branch) and recent iroha-python (main branch) all built with the suggested nightly Rust, I'm getting the below error message when trying to run any asset related queries from the Python code.

`$ python3 test1.py
['garden_of_live_flowers', 'genesis', 'wonderland']
Traceback (most recent call last):
File "/Users/alex/Projects/iroha/iroha-user1@domain1/test1.py", line 17, in
print(cl.query_all_assets())
^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Other(Failed to decode response from Iroha. You are likely using a version of the client library that is incompatible with the version of the peer software

Caused by:
0: Could not decode QueryResponse::Iterable.0:
0: Could not decode QueryOutput::batch:
0: Could not decode QueryOutputBatchBoxTuple::tuple:
0: Could not decode QueryOutputBatchBox::Asset.0:
0: Could not decode Asset::value:
0: Could not decode AssetValue, variant doesn't exist

1: Could not decode QueryOutput::batch:
1: Could not decode QueryOutputBatchBoxTuple::tuple:
1: Could not decode QueryOutputBatchBox::Asset.0:
1: Could not decode Asset::value:
1: Could not decode AssetValue, variant doesn't exist

2: Could not decode QueryOutputBatchBoxTuple::tuple:
2: Could not decode QueryOutputBatchBox::Asset.0:
2: Could not decode Asset::value:
2: Could not decode AssetValue, variant doesn't exist

3: Could not decode QueryOutputBatchBox::Asset.0:
3: Could not decode Asset::value:
3: Could not decode AssetValue, variant doesn't exist

4: Could not decode Asset::value:
4: Could not decode AssetValue, variant doesn't exist

5: Could not decode AssetValue, variant doesn't exist

Location:
/Users/alex/.cargo/git/checkouts/iroha-1d6ef83dc136cea3/339a7fc/crates/iroha/src/query.rs:58:17
`

My code is very simple and I was going to use Python package for initial experiments. So it seems to work for querying the domains and account but not assets. Iroha CLI tool works and displays the info but not this python code.
`
import json
from iroha2 import Client, KeyPair

cfg = json.loads(open("config.json").read())
cfg['key_pair'] = KeyPair.from_json(open("keypair.json").read())
cl = Client.create(**cfg)

print(cl.query_all_domains())
print(cl.query_all_assets())
`

I'd like to use the recent version of both Iroha and the Python package. My another attempt with building iroha-python from stable failed on building but that's a separate question.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant