Use this tag for questions about the Polkadot blockchain network platform. General questions about Polkadot should be asked at https://substrate.stackexchange.com
Questions tagged [polkadot]
203 questions
2
votes
0 answers
How to decode extrinsic at json-RPC call's data(byte code)
I call json-RPC through the terminal and get the data as below.
extrinsics is raw byte, but I'm using polkadot-js(SCALE codec?) to decode it.
But I don't know which method to call.
"block": {
"extrinsics":…

PaperFrog
- 155
- 5
2
votes
1 answer
Tightly Coupling pallet error: ambiguous associated type `Currency` in bounds of `T`
I have following config file, I added schelling game pallet as tightly coupling pallet:
use frame_support::{
traits::{Currency, ExistenceRequirement, Get, ReservableCurrency, WithdrawReasons},
};
#[pallet::config]
pub trait Config:…

Amiya Behera
- 2,210
- 19
- 32
2
votes
0 answers
How to calculate total transaction fees paid by users?
I want to calculate total transaction fees paid by users by using a substrate-api-sidecar on any substrate-based chain.
I tried reading two docs on calculating fees but none could help me out in deducing what to look for while querying a block.…

Aviral Srivastava
- 4,058
- 8
- 29
- 81
2
votes
1 answer
How does specifying a function name with no body work while using with Macros in Rust?
I have a code in which a function name is specified, it is referenced twice later on. This function is placed right below the macros declaration:
#[subxt::subxt(runtime_metadata_path = "polkadot_metadata.scale")]
pub mod polkadot {}
This looks to…

Aviral Srivastava
- 4,058
- 8
- 29
- 81
2
votes
1 answer
Adding Pallets to Substrate
This is a very basic question, but I am following the "nicks" tutorial from the Substrate network, and it's not very clear how - after I have added the pallet - I install or "pull in" these dependencies so I can inspect the code. I was expecting…

Mike M
- 4,879
- 5
- 38
- 58
2
votes
1 answer
the trait `parity_scale_codec::Encode` is not implemented for `std::collections::BTreeMap`
Here is my struct:
#[derive(PartialEq, Eq, PartialOrd, Ord, Default, Clone, Encode, Decode, TypeInfo)]
#[cfg_attr(feature = "std", derive(Debug))]
pub struct SortitionSumTree {
pub k: u128,
pub stack: Vec,
pub nodes:…

Amiya Behera
- 2,210
- 19
- 32
2
votes
0 answers
Use rand package in substrate
I want to use rand package, specially WeightedIndex distribution in substrate.
https://paritytech.github.io/substrate/master/rand/distributions/struct.WeightedIndex.html
This is the code so far:
use rand::distributions::WeightedIndex;
…

Amiya Behera
- 2,210
- 19
- 32
2
votes
1 answer
Polkadot tx-wrapper offline signing
What does ExtrinsicPayload exactly do? I want to replicate the logic but something is missing.
import {
getRegistry
} from '@substrate/txwrapper-polkadot';
const registry = getRegistry({
chainName: 'Polkadot',
specName,
…

Amin Talebi
- 363
- 1
- 7
2
votes
2 answers
"State Database error: Expected pruning mode: constrained" when running sync for RMRK
RMRK Syncing doc advises to start kusama node with
chmod +x polkadot && mv polkadot kusama
./kusama --pruning archive --db rocksdb
When i run this in Linux, it says "State Database error: Expected pruning mode: constrained". The same occurs when i…

Brandon Macer
- 473
- 5
- 8
2
votes
0 answers
Modifications required to transform a standalone substrate node using aura + staking into a polkadot parachain
I have a few questions about Cumulus:
For a standalone substrate chain to work with a relay chain, there must be three modifications made (besides collator selection mechanism): a) The parachain info pallet along with the register_validate_block!…

Shoeb Siddiqui
- 121
- 1
2
votes
1 answer
Local [Polkadot + Statemine] testnet with polkadot-launch
I want to deploy a local Polkadot Testnet via polkadot-launch.
I built the executables from:
polkadot: v0.9.9-1
cumulus: statemine_v3
This is the config.json:
{
"relaychain": {
"bin": "./bin/polkadot",
"chain": "rococo-local",
…

Bernardo Rodrigues
- 378
- 1
- 4
- 17
2
votes
0 answers
Moonbeam (polkadot parachain) transaction error
I have an issue setting up local node.
There is a docker-compose which launches Kusama network with some minor changes (like epoch time and proposal voting/enacting time) with custom chain-spec for 6 validators, and it runs with 2 collator nodes of…

Степан Титаренко
- 23
- 5
2
votes
1 answer
How do i get crowdloan info using PolkaDot JS APIs?
I am able to get account information and chain info through JS API just fine, however the balance does not show KSM locked in crowdloans, they are just not there, so how can i know in which CL the address allocated KSM and how many?
This is what i…

JohnUopini
- 960
- 9
- 24
2
votes
1 answer
how to use --staging flag in substrate framework?
If i try to run the below command:
./target/release/node-template build-spec --chain staging > stagingSpec.json
facing the below error:
Error: Input("Error opening spec file: No such file or directory (os error 2)")
Is there any guide how to use…

Makam Aravind
- 43
- 6
2
votes
1 answer
Purge parachain issue
I want to purge my parachain collator node, but I got this error
Input("Error parsing spec file: missing field `relay_chain` at line 143 column 1")(cannot purge parachain)
This is the command I used to purge my…

luckysky
- 33
- 3