Skip to main content
7 votes

When inserting authority keys, should I choose the controller derivation, the stash derivation, or just the vanilla secret?

You should create a new identity/keys each node. The actual "controller" or "Authority" are defined in the chains genesis block. You can see an example of this in the substrate ...
CustomBlink's user avatar
6 votes
Accepted

What is the full list of ChainSpec properties?

The Properties field in the Chain Specification is intentionally arbitrary. As you see in the comment: Arbitrary properties defined in chain spec as a JSON object As a chain spec creator, you can ...
Shawn Tabrizi's user avatar
  • 16.1k
6 votes
Accepted

On-chain storage version on new chain seems to be incorrect

The following patch will make it work: diff --git a/pallets/template/src/tests.rs b/pallets/template/src/tests.rs index 550ffad..6ca03f1 100644 --- a/pallets/template/src/tests.rs +++ b/pallets/...
bkchr's user avatar
  • 11.5k
6 votes

chain state after parachain slot renewal

The tutorial is technically wrong because it is possible to connect a parachain with previous state to a realychain. What is not possible (yet), is convert a solo chain to parachain without hardfork (...
Bryan Chen's user avatar
5 votes

How can I configure genesis state for my pallet's tests without hardcoding it?

You can configure the new_test_ext function however you like. In this case, you can make it take the parameters you'll want to use to modify your genesis state and then just pass values into your ...
Sacha Lansky's user avatar
  • 2,640
5 votes
Accepted

How to do re-genesis in a running Substrate chain?

There are a lot of ways you can dump the existing state of your chain, and use that as the genesis state for a new chain. Note that all state for a Substrate chain is simply a key-value pair, so by ...
Shawn Tabrizi's user avatar
  • 16.1k
4 votes
Accepted

How to overwrite endowed account balances using additional accounts and balances from a JSON file for genesis block inclusion?

So you could create a function in you chain_spec.rs like this: pub fn get_endowed_accounts_with_balance() -> Vec<(AccountId, u128)> { let accounts: Vec<AccountId> = vec![ ...
Bruno's user avatar
  • 8,315
4 votes

Is the genesis built on the MAC different from the genesis built on Linux

If you create a genesis on Mac and on Linux, they may differ, and that is OKAY. There will be no issues running a genesis generated on Mac with a node running on Linux. The genesis of a chain is ...
Shawn Tabrizi's user avatar
  • 16.1k
4 votes
Accepted

How to manage storage when a pallet is instantiated more than once?

I believe you need to adjust the AccountStore type in the second balances pallet instance to store the balances in the Balances pallet storage. See the docs here: https://github.com/paritytech/...
Shawn Tabrizi's user avatar
  • 16.1k
3 votes

How to add initial nominators in the customSpec.json?

This is where you should start reading: https://docs.substrate.io/build/chain-spec/ You have already found chain_spec.rs where there are a few functions staging_testnet_config_genesis and ...
Simson's user avatar
  • 1,201
3 votes
Accepted

Update parathread WASMs during auction

UPDATE: The information in this answer regarding locks being set at crowdloan creation is no longer correct. After the implementation of RFC#14 no manager lock is set for a parachain at the creation ...
Alejandro Martínez's user avatar
3 votes

Can I modify the `BlockHashCount` on my chain safely to change transaction mortality?

How does the Wiki imply that changing it is unsafe? Changing it will just affect the size of the storage trie under FRAME System. Since Substrate uses a base 16 trie, you'd have to go to a really high ...
joepetrowski's user avatar
  • 2,955
3 votes
Accepted

When inserting authority keys, should I choose the controller derivation, the stash derivation, or just the vanilla secret?

The authority key is neither the controller nor the stash key. What you call authority key, is actually called session key. Such a session key can be changed once per session. For the genesis you need ...
bkchr's user avatar
  • 11.5k
3 votes

How to mint assets configured in GenesisConfig

After looking how PolkadotJS app was managing to mint the asset, I figured that I was trying to call the wrong function. I actually do need to call #[pallet::weight(T::WeightInfo::mint())] pub ...
Alessandro B's user avatar
2 votes

chain state after parachain slot renewal

When a parachain lease ends, it becomes a parathread, and its existing state root and Wasm stays on the relay chain. When the parathread protocol is complete, a chain in this state would still be able ...
Shawn Tabrizi's user avatar
  • 16.1k
2 votes

How to overwrite endowed account balances using additional accounts and balances from a JSON file for genesis block inclusion?

I modified my code in this commit here to incorporate the following parts from Bruno's answer here: Initially I adopted Bruno's approach and got it to work in the DataHighway-Parachain codebase using ...
Luke Schoen's user avatar
  • 2,346
2 votes
Accepted

The trait Deserialize is not implemented for a Get<u32> constant

To make your life easier, you can use the expansions that genesis_config already provides. It does solve your problem and makes the code easier. So you could opt for deleting the InitialSync struct, ...
Oliver Tale-Yazdi's user avatar
2 votes

What is the best way to find the genesis hash for a chain?

Using the RPC is the right way. export-genesis-state is used for parathread registration. Which is block.header().encode() actually. Also, you could see the short-version hash from the log when you ...
AurevoirXavier's user avatar
  • 10.6k
2 votes
Accepted

Is there a way to add a pallet with genesis config through a runtime upgrade?

Yes, a migration is the right way to do this.
JoshOrndorff's user avatar
  • 1,201
2 votes

Setting a value to an arbitrary key at genesis?

Just insert the key/value into chain_spec["genesis"]["raw"]["top"]. This is what Subalfred does to fork off the chain https://github.com/hack-ink/subalfred/blob/...
AurevoirXavier's user avatar
  • 10.6k
2 votes
Accepted

Serde::Serialize/Deserialize for BoundedVec

This has been resolved with a PR from @shabanovd https://github.com/paritytech/substrate/pull/11314 Should not be an issue anymore.
Shawn Tabrizi's user avatar
  • 16.1k
2 votes
Accepted

Genesis build order

The order of building genesis is the same as the declaration order in construct_runtime. I don't think you can change that without touching construct_runtime.
Alex Sed's user avatar
  • 590
2 votes
Accepted

Is possible to set the genesis block number to non-zero value?

I'm personally not aware of any way of doing this. I mean yes you could change the code to achieve this. However, there is a lot of code that has the assumption 0 == genesis. So, you would need to ...
bkchr's user avatar
  • 11.5k
2 votes
Accepted

How to configure genesis_config for pre defined functional pallets?

Configs are some parameters which don't touch the storage. You can configure them in the runtime. Configure the pallet-balances. https://github.com/paritytech/substrate/blob/...
AurevoirXavier's user avatar
  • 10.6k
2 votes

Unable to sync after runtime upgrade

Bootnode with peer id 12D.. is on a different chain (our genesis: 0x40b7…db79 theirs: 0xa82a…1bc2) The above error occurs when you are trying to connect to your node with a node that has a different ...
Shubham Gupta's user avatar
2 votes

Extrinsics In Genesis Block

You can just add transaction to the genesis block. You are right that this isn't done by Polkadot or any of the Parachains. However, you can write your own BuildGenesisBlock implementation that can ...
bkchr's user avatar
  • 11.5k
2 votes

Genesis chainspec size limit

There is no real limitation on the amount of data in the chaispec. Nothing prevents you from putting there gigabytes of data. You will only get some sort of "usability" issue by requiring to ...
bkchr's user avatar
  • 11.5k
1 vote
Accepted

How to implement Debug trait for runtime GenesisConfig?

Currently the pallet GenesisConfig nor the aggregated GenesisConfig implement Debug. A change to FRAME would be needed to also expand this derive (#13955). Could definitely be done, but could break ...
Oliver Tale-Yazdi's user avatar
1 vote
Accepted

Modify the Genesis file/WASM after getting the slot but before the parachain creates the block

Yes, that's the calls you need. You can only open a referendum on relaychain to update the genesis. And I think this is reasonable. Because users bid/contribute for your parachain slot, you shouldn't ...
AurevoirXavier's user avatar
  • 10.6k
1 vote

Substrate Deployment for Prod/Staging

We deployed our public nodes on GCP(2C 6G). Three nodes are enough for us. It can afford subquery and subscan indexing. For production, we only deployed two bootnodes. And we left other seats for the ...
AurevoirXavier's user avatar
  • 10.6k

Only top scored, non community-wiki answers of a minimum length are eligible