-
Notifications
You must be signed in to change notification settings - Fork 47
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
Is Polymesh compatible with substrate? #1334
Comments
We have our own Polkadot.js webapp here: |
This works, thanks for your reply! |
What |
I used polkascan-lib to decode and call, |
That library says that it supports most |
Maybe it needs some extra info for the |
Yes, I have tried most of the substrate coins successfully, but the polymesh has been failing to decode, maybe there are some infos missing. Thank you for your willingness to help me, cause I have not updated this library synchronously for a long time, so it is not clear whether it is the problem with the library or the types I configured, I will try again |
I am going to try that python library locally here. |
Found the problem. Most substrate chains have their Add these line to the
I think you can download that file and use a local file instead of the built-in type registry files. I will open a PR with |
It works! Thank you very much! |
Here is another way to patch in those types: from substrateinterface import SubstrateInterface, Keypair
from substrateinterface.exceptions import SubstrateRequestException
# import logging
# logging.basicConfig(level=logging.DEBUG)
custom_types = {
"types": {
"polymesh_runtime_develop::runtime::Event": "*::Event",
"polymesh_runtime_testnet::runtime::Event": "*::Event",
"polymesh_runtime_mainnet::runtime::Event": "*::Event",
}
}
try:
substrate = SubstrateInterface(
url="wss://mainnet-rpc.polymesh.network",
type_registry=custom_types,
)
except ConnectionRefusedError:
print("⚠️ No local Substrate node running")
exit()
events = substrate.get_events()
for event in events:
print(f'* {event.value}') |
Ok, now I am using a local JSON file 😄, I recorded the way you said. |
Hi guys, As @Neopallium pointed out, the path used for the I suspect though this is because a recent change in Substrate (paritytech/substrate#11981) so I made a generic solution for this. I just released a fix in |
@arjanz Confirmed that works. Thanks for the quick fix. |
Hi, I tried to call substrate.get_events, but the data I got could not be decoded successfully. Is there any special type? I am currently referring to https://github.com/ PolymeshAssociation/Polymesh/blob/develop/polymesh_schema.json
Btw, the polkadot.js.org could not display block details which has transfer event like me: https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fmainnet-rpc.polymesh.network#/explorer/query/4921857
The text was updated successfully, but these errors were encountered: