Closed bostontrader closed 3 years ago
You mentioned you used a canvas node (https://github.com/paritytech/canvas-node)? In that case you need to use the 'canvas' type_registry_preset:
substrate = substrateinterface.SubstrateInterface(
url="ws://127.0.0.1:9944",
ss58_format=42,
type_registry_preset='canvas'
)
I have updated the example located at https://github.com/polkascan/py-substrate-interface/blob/master/examples/create_and_exec_contract.py so it matches current version, that might be helpful too.
Thanks a lot @arjanz! That was the magic bullet I've been looking for for a long time! :-)
I'm trying to use this library to deploy an ink contract onto my local canvas v0.1.6 node. Doing this works just fine using the canvas-ui web page.
However, when I use this library I get the error:
substrateinterface.exceptions.SubstrateRequestException: {'code': 1002, 'message': 'Verification Error: Runtime error: Execution failed: ApiError(FailedToConvertParameter { function: "validate_transaction", parameter: "tx", error: Error { cause: None, desc: "Could not decode
MultiAddress
, variant doesn\\'t exist" } })', 'data': 'RuntimeApi("Execution failed: ApiError(FailedToConvertParameter { function: \"validate_transaction\", parameter: \"tx\", error: Error { cause: None, desc: \"Could not decodeMultiAddress
, variant doesn\\\\'t exist\" } })")'}The actual code that I'm using to do this comes from this library's "deploy a contract" example, slightly modified to use the flipper contract from my local machine...
substrate = substrateinterface.SubstrateInterface( url="ws://127.0.0.1:9944", ss58_format=42, type_registry_preset='development' )
My intuition presently suggests that I'm tripping over some versioning incompatibility. I'm also uneasy about the ss58_format and type_registry_preset params. The example says that this works for "Substrate 2.0.0-533bbbd" and I'm pretty certain I'm using substrate 3. If I rebuild using substrate 2 then I'll probably have to downgrade ink and rebuild my contract. Before I do that I hope that I can find some easier advice/insight/repair via this issue.
Thanks for the help.