Modify customSpec.json
you have to complete these before modifying the customSpec.json
this is what your created customSpec.json file should look like before you make the changes:
when you open this file, this is what you will see at the top:

we will modify the first portion

replace the first three lines with the configuration below:
replace the 210124 with the date and version of your customSpec.json

replace the aura keys with the 1st two set of keys you generated

replace aura 1 with your 1st set of key

aura TWO appears 45 times.


Replace the grandpa key with grandpa 1 and grandpa 2

replace AURA THREE with the new key number 3 (appear 1 time)
repeat the process for AURA FOUR
remove the rest of the keys

it is not critical but i usually like to replace the number with a whole number. this number is not used in our process but it does show up in polkadotjs so its nice to have a whole number 😄

the revised customSpec.json will have only four keys. see sample here:

the new customSpec.json with the trusted nodes will look like this:
you can now transfer the new customSpec.json file back into your instance using Filezilla

To verify that your customSpec.json has been uploaded properly, go to your console terminal and verify as follows:
you will see that the header portion is showing the updated information on customSpec.json

at this point, you can now convert the customSpec.json file to a raw format.
Convert the chain specification to raw format
After you prepare a chain specification with the validator information, you must convert it into a raw specification format before it can be used. The raw chain specification includes the same information as the unconverted specification. However, the raw chain specification also contains encoded storage keys that the node uses to reference the data in its local storage. Distributing a raw chain specification ensures that each node stores the data using the proper storage keys.
To convert a chain specification to use the raw format:
Open a terminal shell on your computer.
Change to the root directory where you compiled the Substrate node template.
Convert the
customSpec.jsonchain specification to the raw format with the file namecustomSpecRaw.jsonby running the following command:
To modify the customSpec.json,
Create a custom chain specification
After you generate the keys to use with your blockchain, you are ready to create a custom chain specification using those key pairs then share your custom chain specification with trusted network participants called validators.
To enable others to participate in your blockchain network, ensure that they generate their own keys. After you collect the keys for network participants, you can create a custom chain specification to replace the local chain specification.
For simplicity, the custom chain specification you create in this tutorial is a modified version of the local chain specification that illustrates how to create a two-node network. You can follow the same steps to add more nodes to the network if you have the required keys.
Modify the local chain specification
Instead of writing a completely new chain specification, you can modify the predefined local chain specification.
To create a new chain specification based on the local specification:
Open a terminal shell on your computer.
Change to the root directory where you compiled the Substrate node template.
Export the
localchain specification to a file namedcustomSpec.jsonby running the following command:If you open the
customSpec.jsonfile in a text editor, you would see that it contains several fields. One of those fields is the WebAssembly (Wasm) binary for the runtime you built using thecargo build --releasecommand. Because the WebAssembly (Wasm) binary is a large blob, you can preview the first and last few lines to see the fields you need to change.Preview the first few fields in the
customSpec.jsonfile by running the following command:The command displays the first fields from the file. For example:
Preview the last fields in the
customSpec.jsonfile by running the following command:This command displays the last sections following the Wasm binary field, including the details for several of the pallets—such as the
sudoandbalancespallets—that are used in the runtime.Open the
customSpec.jsonfile in a text editor.Modify the
namefield to identify this chain specification as a custom chain specification.For example:
Modify
aurafield to specify the nodes with the authority to create blocks by adding the Sr25519 SS58 address keys for each network participant.Modify the
grandpafield to specify the nodes with the authority to finalize blocks by adding the Ed25519 SS58 address keys for each network participant.Note that there are two data values for the
authoritiesfield in thegrandpasection. The first value is the address key. The second value is used to support weighted votes. In this example, each validator has a weight of 1 vote.Save your changes and close the file.
Last updated
