Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 28

Questions about the Polkadot Relay Chain

4 votes

How to get pallet index (u8) of a pallet in runtime?

You can try this out by adding a simple test into your runtime: #[test] fn get_pallet_by_index() { use frame_support::traits::PalletInfoAccess; let balance_index = Balances::index(); print …
Shawn Tabrizi's user avatar
  • 16.3k
1 vote

Do I need to write migration script if upstream pallet's storage has been changed?

You can find examples of that here: https://github.com/paritytech/polkadot/pulls?q=is%3Apr+label%3AE1-runtimemigration+is%3Aclosed …
Shawn Tabrizi's user avatar
  • 16.3k
1 vote
Accepted

How to encode pallet id & call id and then re-encode to a real Call

Should be something like: let bytes: Vec<u8> = (pallet_idx, call_idx).encode(); let call: Call = Decode::decode::<Call>(&mut &bytes); For these kinds of questions, reviewing how SCALE codec works is …
Shawn Tabrizi's user avatar
  • 16.3k
23 votes
Accepted

What's the difference between Substrate and Polkadot?

Polkadot is just one of the blockchains built using Substrate. … Polkadot uses the Polkadot Protocol to connect multiple independent blockchains, providing for them scalability, shared security, and interoperability. …
Shawn Tabrizi's user avatar
  • 16.3k
10 votes
Accepted

Is there any way to mint new native tokens after deploying the substrate chain?

Bruno mentions how to do this with the fungibles::* traits, but the more common API that people use is simply the Currency trait. With Currency, trait you have access to a few different functions whic …
Shawn Tabrizi's user avatar
  • 16.3k
3 votes
Accepted

Is it possible to add some text in genesis block?

The chain-specification is just a list of storage key / value pairs. So you can select a random key, and set some text as the value of that storage, and then insert that in your genesis block. From th …
Shawn Tabrizi's user avatar
  • 16.3k
3 votes
Accepted

T::Balance ... associated type `Balance` not found for `T`

Substrate chains are designed to be completely modular and without any assumptions about the underlying blockchain. This means that Balances are not necessarily a first class citizen within your runti …
Shawn Tabrizi's user avatar
  • 16.3k
2 votes
Accepted

Do we need to resubmit a crowdloan, if we don't win the slot?

Yes, if you fail to win a slot with your crowdloan after it expires, you will need to start a new campaign. Each crowdloan has a expiration date, so that is when your crowdloan will end. As long as …
Shawn Tabrizi's user avatar
  • 16.3k
1 vote

Is there a way to integrate polkadot wallet with unity?

Polkadot JS is written with JavaScript, so your ability to integrate it into a C# application is the same as being able to integrate any JavaScript library into a C# project. …
Shawn Tabrizi's user avatar
  • 16.3k
17 votes
Accepted

What is Cumulus?

Probably an oversimplification, but you can think of Cumulus as a set of tools which allows you to convert a solo-chain Substrate blockchain into a Polkadot compatible Parachain. … More specifically, it provides libraries for all of the necessary parts of the Polkadot protocol necessary for Parachains to work, for example: Creating new parachain blocks via Collators Listening to …
Shawn Tabrizi's user avatar
  • 16.3k
10 votes

How can we get a snapshot of all balances at a certain block?

First, set up a Polkadot JS API connection for the block you want: const provider = new WsProvider(endpoint); const api = await ApiPromise.create({ provider }); const blockHash = await api.rpc.chain.getBlockHash …
Shawn Tabrizi's user avatar
  • 16.3k
4 votes

What extrinsics filters balances to block transfers?

configure your System pallet to use this filter: impl frame_system::Config for Runtime { type BaseCallFilter = DontAllowBalances; // -- snip -- } This works for any pallet or call, and is how Polkadot … See this PR which is the one which enabled balance transfers on Polkadot and uses this same feature: https://github.com/paritytech/polkadot/pull/1443 …
Shawn Tabrizi's user avatar
  • 16.3k
2 votes
Accepted

Read current Crowdloan Contributions

The best thing for this would be to track events in previous blocks on your chain. From the Crowdloan Pallet: /// Contributed to a crowd sale. `[who, fund_index, amount]` Contributed(T::AccountId, Par …
Shawn Tabrizi's user avatar
  • 16.3k
2 votes

How to verify `runtime-upgrade` using `try-runtime

Try Runtime uses a set of functions in the OnRuntimeUpgrade trait you need to implement and plug into your runtime. /// The runtime upgrade trait. /// /// Implementing this lets you express what shoul …
Shawn Tabrizi's user avatar
  • 16.3k
5 votes

Is it possible to add 2nd order Relay-chain to Relay-chain

The most notable drawback to continually nesting relay chains is the increased delay of things like finalization, cross-chain messages, and other things from the outer chains to the main Polkadot relay … If you have 3 nested relay chains, you would expect that any cross-chain message from a parachain on the 3rd layer to the main Polkadot relay chain would take 18 seconds or more, since each layer would …
Shawn Tabrizi's user avatar
  • 16.3k

15 30 50 per page