Questions tagged [polkadot]

Use this tag for questions about the Polkadot blockchain network platform. General questions about Polkadot should be asked at https://substrate.stackexchange.com

203 questions
1
vote
1 answer

How to get polkadot's transaction and transfer at json rpc

I testing at westend(polkadot testnet) use json-rpc How can I extract transaction and etc from extrinsis and check it? https://polkadot.js.org/docs/substrate/rpc/#getblockhash-blockhash-signedblock curl -H "Content-Type: application/json" --data '{…
PaperFrog
  • 155
  • 5
1
vote
0 answers

How to not expose a function in rpc and access the function through tight coupling?

I have a function in say schelling_game pallet: pub fn create_tree(key: SumTreeName, k: u64) -> DispatchResult {} Now I am accessing the function in template pallet using tight coupling: schelling_game::Pallet::::create_tree(key, 2); But the…
Amiya Behera
  • 2,210
  • 19
  • 32
1
vote
1 answer

substrate-developer-hub/substrate-front-end-template run yarn error

run yarn build yarn run v1.22.17 $ react-scripts build Creating an optimized production build... Failed to compile. ./node_modules/@polkadot/api/node_modules/@polkadot/keyring/packageInfo.js 6:27 Module parse failed: Unexpected token (6:27) File…
Salt
  • 13
  • 5
1
vote
0 answers

How to calculate Protocol revenue and Supply Side revenue for Polkadot?

I want to calculate the protocol revenue and supply-side revenue without using the TheGraph subgraph. The problem with TheGraph is that it requires a smart contract address and all I have is an Ethereum wallet with zero balance. I also tried to…
Aviral Srivastava
  • 4,058
  • 8
  • 29
  • 81
1
vote
1 answer

Should I use the pallet_membership to handle dapp user membership? (Differences between smart contracts and blockchain runtime)

I'm building a dapp based on substrate blockchain runtime and smart contracts. The pallet_membership rust module handles adding, removing and tracking accounts membership in a blockchain. Would I use the pallet_membership to handle this or should I…
user17194172
1
vote
1 answer

Blockchain substrate pallet_membership use cases?

Let me know if I am on the right train of thought. I'm currently building a dapp that will be based on my own parachain, and I was wondering if by adding this pallet, it would be a way to allow users in my dapp to pay for membership. Obviously I…
1
vote
0 answers

How to use following data structure of solidity in substrate?

How to use following data structure of solidity in substrate? struct SortitionSumTree { uint K; uint[] stack; uint[] nodes; mapping(bytes32 => uint) IDsToTreeIndexes; mapping(uint => bytes32)…
Amiya Behera
  • 2,210
  • 19
  • 32
1
vote
1 answer

chainlink external-initiator unsupported metadata version 13

i'm trying to connect the external-initiator with my chainlink node, but here is the error I get when I try to add a new job in the Chainlink node. This is the logs of my external-initiator: 2021-11-09T15:09:14Z [ERROR] Failed testing subscriber:…
luckysky
  • 33
  • 3
1
vote
1 answer

Data structure for nested storage map

How to declare the type for following data structure? A product can have many candidates and each candidate has a stake. But same candidate can remain in more than one product with different stakes. I also need to query stake from a candidate id,…
Amiya Behera
  • 2,210
  • 19
  • 32
1
vote
1 answer

Can we get the pallet and function data from call (type) passed as a parameter to a function in substrate?

fn pre_dispatch( self, who: &Self::AccountId, call: &Self::Call, info: &DispatchInfoOf, len: usize ) -> Result { let (_fee, imbalance) =…
1
vote
0 answers

How do I get a list of all accounts in a Substrate based Parachain?

I want to get a list of all accounts in a parachain. I am running a full node on the Kusama network. How do I get a list of all accounts in a parachain? I tried reading a few documentation pages but all are focused on making transfers but none…
Aviral Srivastava
  • 4,058
  • 8
  • 29
  • 81
1
vote
0 answers

Making ink! Smart Contracts Revert

I'm tweaking with ink! Smart contracts and deployed some test contracts through https://polkadot.js.org/. However, despite setting conditional statements within smart contracts, calls to them still pass without reverting. Am I doing something wrong…
1
vote
0 answers

Error while adding Nick Pallet to substrate

I have just started exploring substrate and I am following this tutorial, (https://docs.substrate.io/tutorials/v3/add-a-pallet/). Under step Implement the Nicks pallet Config trait -> Add Nicks to the construct_runtime! macro., I added Nicks pallet…
Asad Hayat
  • 368
  • 2
  • 20
1
vote
2 answers

How to convert u128 to Balance?

How to convert u128 to Balance? use frame_support::{ traits::{Currency, ExistenceRequirement, Get, ReservableCurrency, WithdrawReasons}, }; type BalanceOf = <::Currency as…
Amiya Behera
  • 2,210
  • 19
  • 32
1
vote
1 answer

How to set the default value for StorageValue?

I am trying set default value for StorageValue, but its giving error: #[pallet::type_value] pub fn DefaultRegistrationFees() -> u128 { 100u128 } #[pallet::storage] #[pallet::getter(fn profile_registration_fees)] pub type…
Amiya Behera
  • 2,210
  • 19
  • 32