Client error: Execution failed: Other: Exported method Metadata_metadata_at_version is not found
Closed this issue · 2 comments
tensorajack commented
Receiving the following error:
Traceback (most recent call last):
File "/Users/userDocuments/Github/Patrol/patrol/validation/substrate_transaction_data.py", line 98, in <module>
asyncio.run(main())
File "/Users/user/.pyenv/versions/3.11.11/lib/python3.11/asyncio/runners.py", line 190, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "/Users/user/.pyenv/versions/3.11.11/lib/python3.11/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/user/.pyenv/versions/3.11.11/lib/python3.11/asyncio/base_events.py", line 654, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/Users/user/Documents/Github/Patrol/patrol/validation/substrate_transaction_data.py", line 94, in main
await validate_transaction_data(substrate, edge)
File "/Users/user/Documents/Github/Patrol/patrol/validation/substrate_transaction_data.py", line 42, in validate_transaction_data
events = await substrate.get_events(block_hash=block_hash)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/user/Documents/Github/Patrol/.venv/lib/python3.11/site-packages/async_substrate_interface/async_substrate.py", line 1782, in get_events
storage_obj = await self.query(
^^^^^^^^^^^^^^^^^
File "/Users/user/Documents/Github/Patrol/.venv/lib/python3.11/site-packages/async_substrate_interface/async_substrate.py", line 2935, in query
await self.init_runtime(block_hash=block_hash)
File "/Users/user/Documents/Github/Patrol/.venv/lib/python3.11/site-packages/async_substrate_interface/async_substrate.py", line 1120, in init_runtime
runtime = await get_runtime(block_hash, block_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/user/Documents/Github/Patrol/.venv/lib/python3.11/site-packages/async_substrate_interface/async_substrate.py", line 1061, in get_runtime
) = await self._load_registry_at_block(block_hash=runtime_block_hash)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/user/Documents/Github/Patrol/.venv/lib/python3.11/site-packages/async_substrate_interface/async_substrate.py", line 817, in _load_registry_at_block
metadata_rpc_result = await self.rpc_request(
^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/user/Documents/Github/Patrol/.venv/lib/python3.11/site-packages/async_substrate_interface/async_substrate.py", line 2085, in rpc_request
raise SubstrateRequestException(result[payload_id][0]["error"]["message"])
async_substrate_interface.errors.SubstrateRequestException: Client error: Execution failed: Other: Exported method Metadata_metadata_at_version is not found
When calling block hash: 0x101350435d31faf0d4707549b25be19a907d77b68bb500d394526544e77b1f6e
With the following code:
import asyncio
from async_substrate_interface import AsyncSubstrateInterface
async def main():
url = "wss://archive.chain.opentensor.ai:443/"
substrate = AsyncSubstrateInterface(url=url)
await substrate.initialize()
block_hash = "0x101350435d31faf0d4707549b25be19a907d77b68bb500d394526544e77b1f6e"
events = await substrate.get_events(block_hash=block_hash)
print(events)
if __name__ == "__main__":
asyncio.run(main())
thewhaleking commented
Block number is 1746484
thewhaleking commented
Hi @tensorajack,
Unfortunately this block is too old and doesn't have the Metadata V15. We considered adding it for legacy support, but it would add bloat for niche use-cases. We recommend using https://github.com/polkascan/py-substrate-interface for this.
I am adding in a catch to let users know about this, so thanks for finding this.