-
Hi, Since the network I am working on is not registered, in the Can anyone direct me to the right documents? Edit:- How do I generate this type registry for my network? Thank you, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Probably you don't need to specify a If the runtime is pre-V14 or there are some exotic changes to the default Substrate implementation, you will need some custom type definitions (or overrides). First you can check if a PolkadotJS type registry JSON file exists, for example for Polymesh there is one maintained here: https://github.com/PolymeshAssociation/polymesh-types/blob/main/polymesh_schema.json Then you convert the format to match the py-scale-codec format (most different is format for custom_type_registry = load_type_registry_file("my-custom-types.json")
substrate = SubstrateInterface(
url="ws://127.0.0.1:9944",
ss58_format=42,
type_registry=custom_type_registry
)
Example file for Moonbeam (exceptions are address and signature definitions): {
"runtime_id": 900,
"types": {
"EthereumAddress": "H160",
"Address": "EthereumAddress",
"LookupSource": "EthereumAddress",
"AccountId": "EthereumAddress",
"ExtrinsicSignature": "EcdsaSignature"
}
} Example for Acala (exception is different {
"types": {
"MultiSignature": {
"type": "enum",
"type_mapping": [
[
"Ed25519",
"Ed25519Signature"
],
[
"Sr25519",
"Sr25519Signature"
],
[
"Ecdsa",
"EcdsaSignature"
],
[
"Ethereum",
"[u8; 65]"
],
[
"Eip712",
"[u8; 65]"
]
]
}
}
} |
Beta Was this translation helpful? Give feedback.
Probably you don't need to specify a
type_registry_preset
, if your network utilisesMetadataV14
. Before V14, type definitions were required to be administered manually, as described here: polkascan/py-scale-codec#94 (comment)If the runtime is pre-V14 or there are some exotic changes to the default Substrate implementation, you will need some custom type definitions (or overrides). First you can check if a PolkadotJS type registry JSON file exists, for example for Polymesh there is one maintained here: https://github.com/PolymeshAssociation/polymesh-types/blob/main/polymesh_schema.json
Then you convert the format to match the py-scale-codec format (most different is format for
Enum
andSt…