Questions tagged [substrateinterface]
The substrateinterface tag has no usage guidance.
34
questions
0
votes
1
answer
38
views
How to find polkadot js API implementation in rust susbtrate
https://polkadot.js.org/docs/substrate/storage#accountaccountid32-framesystemaccountinfo
account(AccountId32): FrameSystemAccountInfo
interface: api.query.system.account
summary: The full account ...
4
votes
1
answer
61
views
the trait `std::clone::Clone` is not implemented for `Nominations<T>`
I was making a new event in the function nominate of Staking pallet which is going to show when the nominator is going to be added. But i facing one issue
#[pallet::call_index(5)]
#[pallet::weight(...
0
votes
1
answer
18
views
construct_runtime macro panics in a mock environment while it builds in normal runtime [closed]
Trying to create a mock environment for testing a pallet, but getting an error msg failed to resolve: could not find tt_error_token in the crate root whenever trying to add my pallet in the mock ...
0
votes
0
answers
18
views
How to traverse extrinsics executed via substrate interface
I am interacting with the substrate node using substrate interfact. I am using following command to submit extrinsic to be executed by the runtime:
extrinsic = substrate.create_signed_extrinsic(
...
1
vote
1
answer
46
views
how to Decrease the unbonding Time in substrate?
i am working on substrate blockchain its era time and epoch are set too 2 minutes and when i changed unbonding duration to 4 min in blockchain it is working fine . when i have added evm base to to ...
1
vote
1
answer
33
views
Pagination issues in py-substrate-interface
It is not clear how to use pagination in py-substrate-interface. In the sample code below, there are only 32 records so all the query should be complete, but result.loading_complete shows false.
from ...
1
vote
2
answers
99
views
How To Adjust The Fees On A Running Substrate Chain?
Fees for transactions in our test net are too high and we would like to adjust them to be some factor lower across the board. Is there a simple way to do that using a call from the Polkadot.js apps ...
1
vote
1
answer
19
views
Pallet Call Indicies are Conflicting Error
This error cropped up somewhat unexpectedly, and I am not sure how it came to be. Nevertheless, it appears that 2 runtime calls, set_commission (a new function being added in the PR in question) and ...
1
vote
1
answer
65
views
How to get a list of all the smart contract account ids and WASM blobs on a parachain
I would like to figure out how to get a list of all the smart contracts account ids and WASM blobs that have been uploaded to a specific parachain, ideally into python using the substrate interface. ...
0
votes
1
answer
35
views
Get a block based on timestamp from python substrate interface
Is it possible to get either block_number or block_hash of the nearest block for a given timestamp from python substrate interface?
For example if i pass timestamp of 2022-11-28 10:00:00 (+UTC) I ...
0
votes
1
answer
18
views
final_checks() on Executive module
Inside final_checks(header: &System::Header) method
fn final_checks() {
let new_header = <frame_system::Pallet::<System>>::finalize();
...
let storage_root = new_header....
0
votes
1
answer
45
views
How to start a local substrate node using python substrate interface
I am using python substrate Interface (https://github.com/polkascan/py-substrate-interface) to interact with the substrate node.
How to start my local substrate-node-template using python for ...
0
votes
1
answer
62
views
How to get specific extrinsic using python substrate interface
I am using python substrate Interface (https://github.com/polkascan/py-substrate-interface) to interact with the substrate node.
I need to execute Pallet::Balances::transfer twice by combine both of ...
0
votes
1
answer
70
views
How to submit a transaction form the root/sudo acount using python substrate interface
I am using Python Substrate Interface (https://github.com/polkascan/py-substrate-interface) to interact with the substrate node.
I need to execute Pallet::Balances::force_transfer function, this ...
3
votes
1
answer
64
views
Substrate learning resources
Can any one please point to me some very good step by step resource/course to learn substrate? I cant find any resource/course that guide you step by step starting from substrate architecture and ...
6
votes
2
answers
75
views
How to generate node information?
How can i generate this information while starting my chain???
0
votes
0
answers
10
views
How to interact with the pre-defined public address
I want to interact with the pre-defined public address. I want to use a map function to hide the public address with any name I want
0
votes
2
answers
71
views
How to subscribe the new pending transaction of polkadot in substrate python
How can i subscribe to the new pending transactions of polkadot by using substrate interface python
1
vote
2
answers
57
views
Python substrate-interface discovering which params need to be passed into query function for parallel API?
I am trying to find the correct parameters to pass into the query function for the substrate interface module when interacting with the parallel api to interact with their AMM. I attempted to modify ...
0
votes
2
answers
77
views
How can I create a currencies.transfer transaction?
I have created a transaction by @substrate/txwrapper-orml
import {methods as substrateMethods} from "@substrate/txwrapper-orml";
export const methods = {
currencies: substrateMethods....
1
vote
2
answers
75
views
How to determine what parameter to pass into substrate.query() to query a storage_function from polkascan's py-substrate-interface?
I am trying to use py-substrate-interface to query the acalaOracle.value for Acala/Karura. Below I show a screenshot of how to get the data using polkadot{js}. Here is the python code I am trying:
...
2
votes
1
answer
129
views
How to get the balance for a specific account using py-substrate
The following code will return the balance for a few random accounts? How would I pass in a specific account that I am interested in?
url = 'wss://karura.polkawallet.io'
substrate = ...
3
votes
2
answers
208
views
How key-values database and Merkle Tree works together on Substrate
I have been looking deep dive into Substrate and trying to understand things behind the hood, especially storage API.
I am really keen to explore more in the Merkle abstraction between Storage API and ...
1
vote
0
answers
76
views
How do externalities work in runtime?
What makes me confused about the runtime is the Externalities. I found the definition in sp_externalities, moreover I found that the pub fn set_and_run_with_externalities(ext: &mut dyn ...
2
votes
1
answer
120
views
How to obtain the staking amount for non-active validators?
Using substrate-interface I'm trying to get the amount of DOT in staking for non-active validators, those that are waiting.
I can get the active validators' amount by using the storage_function ...
3
votes
1
answer
39
views
Access The Unbonding Amount With Substrate Query
I'm trying to measure the unbonding amount directly from a substrate-interface query.
Here's the amount I'm interested in:
I can get some account information with this query:
value = self....
5
votes
2
answers
194
views
How to find how many transactions are pending from address to be added to block?
In my application, I need to fire multiple transactions from same address, and want to create statusCheck() function, which will let me know how many transactions of total are still pending to be ...
3
votes
1
answer
121
views
How to understand [runtime-interface] and `Externalities`?
I am struggling with #[runtime_interface] the whole day. here is the Runtime Interface Trait Defination, the expanded macro is too long to paste here, here is a expanded macro. I have lots of ...
4
votes
1
answer
93
views
How to convert substrate Specific Types(Option<BalanceOf<T>> ) to Rust Primitive types (U64)?
I don't know how can I convert Option<BalanceOf> (subtrate specific type)to u64 (rust primitive types)?
I followed this article( How do you convert between Substrate specific types and Rust ...
0
votes
0
answers
42
views
How to solve " ValueError: Element count of value (1) doesn\'t match type_definition (2)" when I teleport ksm in kusama to ksm in statemine? [duplicate]
I want to teleport the ksm in kusama to ksm in statemine. I use the code
call = _substrate.compose_call(
call_module='XcmPallet',
call_function='limited_teleport_assets',
...
1
vote
1
answer
78
views
Can generate an address by mnemonic with the sdk substrate-interface?
I want to generate an kusama address. The substrate-interface can make it?Or how to generate an ss58 format address by python
0
votes
1
answer
60
views
How to solve the issue"Element "asset_id" of struct is missing in given value" when I send a token transaction
I send the transaction using the substrate interface.
I get the key pair and call:
call_module = "Assets"
call_function = 'transfer'
call_params = {
"id": asset_id,
"...
1
vote
1
answer
89
views
How to decode and encode transactions by using substrate?
I want to decode blocks and transactions from the Node. I want to use https://github.com/paritytech/substrate . But I can not find methods about it. Could you tell me where it is ?
0
votes
1
answer
78
views
Retrieve reason of fail substrate rpc call
I would like to know if there is a way for understanding why a rpc call via python substrate-interface is failing.
On my case, I'm using python substrateinterface lib. And in function "...