Closed rajesh-nodle closed 2 years ago
Can you try regenerating your static metadata for the client? When using the utility::batch
dispatchable it requires the static Call
instances to be constructed which need to match exactly those on the target node. See #356
Thanks @ascjones for pointer ...
Regarding
static metadata for the client
...
Did below step, please correct me if I am wrong ...
cargo run --release -p subxt-cli -- codegen \
| rustfmt --edition=2018 --emit=stdout \
> ~/L5-blocks/ws-02-hot-wallet/install-bin/nodle_metadata.rs
As part of codegen is there any possibility to specify
generated_type_derives = "Clone, Debug"
?
Ah I see you are not using the macro directly, why not?
Codegen should work but as you say has less options.
As part of codegen is there any possibility to specify generated_type_derives = "Clone, Debug" ?
That should be easy enough to add, but not high on the priority list at the moment. Please open an issue for it, or even better a PR :)
Sure, right now made quick hack like below, Will Soon get back with PR of cleaner solution :-)
Ah I see you are not using the macro directly, why not?
Looks like still I am missing some pieces. Right now here is my understanding ...
cargo run --release -p subxt-cli -- codegen \
| rustfmt --edition=2018 --emit=stdout \
> ~/L5-blocks/ws-02-hot-wallet/install-bin/nodle_runtime.rs
Tried both above possibilities, but still no luck, nodle chain throws same RPC error of Could not decode Call, variant doesn't exist
.
Could you please confirm the right way of getting static metadata for the client
.
Well using the macro is the preferred way, and you can do that via
cargo run --release -p subxt-cli -- metadata -f bytes > nodle_metadata.scale
But if you say you have tried this already and it still fails, then the bug is somewhere else.
Do the all the calls work individually when not sent as a batch? e.g. calling tx().balances().transfer(..)
instead of manually constructing the call.
Sorry got blocked with something else ...
Regarding examples, have taken simple use-case from existing examples/polkadot_balance_transfer.rs
With nodle chain, hit with RPC error of "Transaction has a bad signature" ...
Tried same example with
Chain | Binary | Status |
---|---|---|
Substrate | https://releases.parity.io/substrate/x86_64-debian:stretch/latest/substrate/substrate | Passed |
Polkadot | https://releases.parity.io/polkadot/x86_64-debian:stretch/v0.9.13/polkadot | Failed |
Substrate Traces
Finished dev [unoptimized + debuginfo] target(s) in 1m 12s
Running `target/debug/examples/polkadot_balance_transfer`
[2021-12-10T05:35:35Z DEBUG subxt::rpc] request state_getMetadata: Some(ArrayRef([]))
[2021-12-10T05:35:35Z DEBUG subxt::rpc] request chain_getBlockHash: Some(ArrayRef([Number(0)]))
[2021-12-10T05:35:35Z DEBUG subxt::rpc] request state_getRuntimeVersion: Some(ArrayRef([Null]))
[2021-12-10T05:35:35Z DEBUG subxt::rpc] request system_properties: Some(ArrayRef([]))
[2021-12-10T05:35:35Z DEBUG subxt::rpc] request state_getStorage: Some(ArrayRef([String("0x26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da9de1e86a9a8c739864cf3cc5ec2bea59fd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d"), Null]))
[2021-12-10T05:35:35Z DEBUG subxt::extrinsic] spec_version :: 268
[2021-12-10T05:35:35Z DEBUG subxt::extrinsic] tx_version :: 2
[2021-12-10T05:35:35Z DEBUG subxt::extrinsic] nonce :: 0
[2021-12-10T05:35:35Z DEBUG subxt::extrinsic] genesis_hash :: 0xa985ad443893d3921decd39e12d09efb33ec2a27e436b8af757cb9fb52c98a83
[2021-12-10T05:35:35Z DEBUG subxt::rpc] request author_submitExtrinsic: Some(ArrayRef([String("0x31028400d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d01c0b6870bc80e22ca5164dc2362db54b4a9cdc19f2c53c8536c3590ef4938f6306f3b8ed4e5253a5d4b87593ca48f1c41451437fce9929a1ab651dc56b3ca2680000000000600008eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48419c")]))
Balance transfer extrinsic submitted: 0xacd8…0db0
Polkadot Traces
Compiling subxt v0.15.0 (/home/popoyi/ssdbox/cauvery/L5-blocks/ws-02-hot-wallet/shamb0-subxt/subxt)
Finished dev [unoptimized + debuginfo] target(s) in 18.01s
Running `target/debug/examples/polkadot_balance_transfer`
[2021-12-10T05:16:36Z DEBUG subxt::rpc] request state_getMetadata: Some(ArrayRef([]))
[2021-12-10T05:16:36Z DEBUG subxt::rpc] request chain_getBlockHash: Some(ArrayRef([Number(0)]))
[2021-12-10T05:16:36Z DEBUG subxt::rpc] request state_getRuntimeVersion: Some(ArrayRef([Null]))
[2021-12-10T05:16:36Z DEBUG subxt::rpc] request system_properties: Some(ArrayRef([]))
[2021-12-10T05:16:36Z DEBUG subxt::rpc] request state_getStorage: Some(ArrayRef([String("0x26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da9de1e86a9a8c739864cf3cc5ec2bea59fd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d"), Null]))
[2021-12-10T05:16:36Z DEBUG subxt::extrinsic] spec_version :: 9130
[2021-12-10T05:16:36Z DEBUG subxt::extrinsic] tx_version :: 9
[2021-12-10T05:16:36Z DEBUG subxt::extrinsic] nonce :: 0
[2021-12-10T05:16:36Z DEBUG subxt::extrinsic] genesis_hash :: 0x45a8ae86a750ad6808a9f8809818207239d3ea50784b6645e6b9a1fce3752edf
[2021-12-10T05:16:36Z DEBUG subxt::rpc] request author_submitExtrinsic: Some(ArrayRef([String("0x31028400d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d01666786cb976356a6c9f6aba85abc22fbbc72716a0200639654748ebfc5b6fe34115e14243a3f863605b5b5b2247085fc0e14db7ebf5396ec8ea3d95582b1e985000000000500008eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48419c")]))
Error: Rpc(Request("{\"jsonrpc\":\"2.0\",\"error\":{\"code\":1010,\"message\":\"Invalid Transaction\",\"data\":\"Transaction has a bad signature\"},\"id\":5}"))
Used subxt master with all recent updates
Is there any update from susbstrate is missing on Polkadot-v0.9.13 ? looks like for nodle we missing the same.
Most likely a mismatch between the hardcoded DefaultExtra
and the SignedExtra
type from that version of polkadot. At the moment subxt
is hardcoded to be compatible with the latest substrate node-runtime
which may differ from polkadot. We are currently exploring solutions to this, see https://github.com/paritytech/subxt/issues/331
Perfect, its working.
Adopted SignedExtension
to the need of nodle-chain (Hard-coded) :-), now its working ...
https://github.com/NodleCode/subxt/blob/polkadot-v0.9.12/src/extrinsic/extra.rs
Verified batch commands with unit test, and its working fine ...
https://github.com/NodleCode/subxt/blob/polkadot-v0.9.12/examples/utility_batch.rs
Thanks a lot for pointer & great support ...
Hello Subxt team,
We need your support badly, bit blocked in our parachain bringup, nodle auxillay service is part of nodle chain ecosystem.
nodle auxillay service subxt integration Snippet