Skip to content
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

Make Observer compatible with v11 rpc.get_transactions #18

Open
martin-braun opened this issue Jun 18, 2023 · 0 comments
Open

Make Observer compatible with v11 rpc.get_transactions #18

martin-braun opened this issue Jun 18, 2023 · 0 comments

Comments

@martin-braun
Copy link

martin-braun commented Jun 18, 2023

v11 oxend returns transactions such as:

{'block_height': 1346532, 'block_timestamp': 1687119982, 'burned': 0, 'extra': {'pubkey': ['9b6bbbdd5d95c61d8607a064b37c4f1a698c1c40967423a8ce099f091d7eed6c', 'a5a8665140ff7d7e16b7ff1f5774d853fb9e86568c44306c7e959d769bd7e1f2'], 'sn_winner': '15c4735336fe811ccd12214ae172fbe04cfb8679b5e9255fab325bba66e30b31'}, 'fee': 0, 'output_indices': [5373787, 5373788], 'output_unlock_times': [1346562, 1346562], 'prunable_hash': 'c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470', 'pruned': '040282985282985282985201ffe497520299b2a5cd58027ae2305171a553747b49638946860d37609516cf9c8e6a06da55a9fe33b2e00f99b2a5cd58026527bcddbb41e0ca74e1ebc1cfefbcf6cda0b08fee5d8c74f2eed3fced6259de63019b6bbbdd5d95c61d8607a064b37c4f1a698c1c40967423a8ce099f091d7eed6c01a5a8665140ff7d7e16b7ff1f5774d853fb9e86568c44306c7e959d769bd7e1f27215c4735336fe811ccd12214ae172fbe04cfb8679b5e9255fab325bba66e30b310000', 'rct_signatures': {'type': 0}, 'size': 195, 'tx_hash': 'aa25357f961be3d3f3554d152c581061695b73e07df384991997f0b38f0dadbd', 'type': 0, 'unlock_time': 1346562, 'version': 4, 'vin': [{'gen': {'height': 1346532}}], 'vout': [{'amount': 23784413465, 'target': {'key': '7ae2305171a553747b49638946860d37609516cf9c8e6a06da55a9fe33b2e00f'}}, {'amount': 23784413465, 'target': {'key': '6527bcddbb41e0ca74e1ebc1cfefbcf6cda0b08fee5d8c74f2eed3fced6259de'}}]}

So, there is no info, thus the observer tries to parse info from as_json, but this is missing since v11, hence:

KeyError: 'as_json'Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/lib/python3/dist-packages/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/lib/python3/dist-packages/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/lib/python3/dist-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/usr/lib/python3/dist-packages/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/lib/python3/dist-packages/flask/app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/media/psf/Home/git/gh/oxen-io/oxen-observer/observer.py", line 330, in main
    txs = parse_txs(tx_req(omq, oxend, txids, cache_key='mempool').get())
  File "/media/psf/Home/git/gh/oxen-io/oxen-observer/observer.py", line 642, in parse_txs
    tx['info'] = json.loads(tx["as_json"])
KeyError: 'as_json'

See

tx['info'] = json.loads(tx["as_json"])

@martin-braun martin-braun changed the title Observer can't read transactions: KeyError: 'as_json' Make Observer compatible with v11 rpc.get_transactions Sep 21, 2023
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