This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 379
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* set default para id to 1000 * add genesis value generation script * add statemine chain spec and genesis values * add westmint chain spec and genesis values * rename chain specs to _genesis to indicate that they are not usable for syncing the chain * adjust chain names to reduce confusion * add westmint chain spec * set chain id to shell * comment out statemine chain spec * fix build Co-authored-by: joepetrowski <joe@parity.io>
- Loading branch information
1 parent
b1e5e7d
commit 5950432
Showing
11 changed files
with
668 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,5 @@ | |
.vscode | ||
.DS_Store | ||
/.cargo/config | ||
|
||
**/node_modules |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"0xcec5070d609dd3497f72bde07fc96ba0726380404683fc89e8233450c8aa195014113a7040518ced617572618050673d59020488a4ffc9d8c6de3062a65977046e6990915617f85fef6d349730":"0x50673d59020488a4ffc9d8c6de3062a65977046e6990915617f85fef6d349730","0xcec5070d609dd3497f72bde07fc96ba0878d434d6125b40443fe11fd292d13a4":"0x03000000","0xcec5070d609dd3497f72bde07fc96ba04c014e6bf8b8c2c011e7290b85696bb3095cb580595ffbb4fe8102dbc244e7ea2babd9f53236d67403b046154370da5c3ea99def0bd0747a":"0xfe8102dbc244e7ea2babd9f53236d67403b046154370da5c3ea99def0bd0747a","0xc2261276cc9d1f8598ea4b6a74b15c2f878d434d6125b40443fe11fd292d13a4":"0x03000000","0xcec5070d609dd3497f72bde07fc96ba04c014e6bf8b8c2c011e7290b85696bb3bcf23f8ad989027738144b5398e5d0da5ec936a3af23f5a96e782f676ab19d45f29075ee92eca76a":"0x38144b5398e5d0da5ec936a3af23f5a96e782f676ab19d45f29075ee92eca76a","0xcec5070d609dd3497f72bde07fc96ba0e0cdd062e6eaf24295ad4ccfc41d4609":"0x1050673d59020488a4ffc9d8c6de3062a65977046e6990915617f85fef6d34973050673d59020488a4ffc9d8c6de3062a65977046e6990915617f85fef6d349730fe8102dbc244e7ea2babd9f53236d67403b046154370da5c3ea99def0bd0747afe8102dbc244e7ea2babd9f53236d67403b046154370da5c3ea99def0bd0747a38144b5398e5d0da5ec936a3af23f5a96e782f676ab19d45f29075ee92eca76a38144b5398e5d0da5ec936a3af23f5a96e782f676ab19d45f29075ee92eca76a3253947640e309120ae70fa458dcacb915e2ddd78f930f52bd3679ec63fc44153253947640e309120ae70fa458dcacb915e2ddd78f930f52bd3679ec63fc4415","0x15464cac3378d46f113cd5b7a4d71c84579f5a43435b04a98d64da0cefe18505":"0x50cd2d03000000000000000000000000","0xd5e1a2fa16732ce6906189438c0a82c6878d434d6125b40443fe11fd292d13a4":"0x03000000","0x1809d78346727a0ef58c0fa03bafa323878d434d6125b40443fe11fd292d13a4":"0x03000000","0x3c311d57d4daf52904616cf69648081e5e0621c4869aa60c02be9adcc98a0d1d":"0x1050673d59020488a4ffc9d8c6de3062a65977046e6990915617f85fef6d349730fe8102dbc244e7ea2babd9f53236d67403b046154370da5c3ea99def0bd0747a38144b5398e5d0da5ec936a3af23f5a96e782f676ab19d45f29075ee92eca76a3253947640e309120ae70fa458dcacb915e2ddd78f930f52bd3679ec63fc4415","0x5e8a19e3cd1b7c148b33880c479c0281878d434d6125b40443fe11fd292d13a4":"0x03000000","0xcec5070d609dd3497f72bde07fc96ba0726380404683fc89e8233450c8aa1950fb63b830f923ed3561757261803253947640e309120ae70fa458dcacb915e2ddd78f930f52bd3679ec63fc4415":"0x3253947640e309120ae70fa458dcacb915e2ddd78f930f52bd3679ec63fc4415","0xc2261276cc9d1f8598ea4b6a74b15c2f308ce9615de0775a82f8a94dc3d285a1":"0x01","0xcec5070d609dd3497f72bde07fc96ba0726380404683fc89e8233450c8aa1950b062f0665fab654f617572618038144b5398e5d0da5ec936a3af23f5a96e782f676ab19d45f29075ee92eca76a":"0x38144b5398e5d0da5ec936a3af23f5a96e782f676ab19d45f29075ee92eca76a","0xcd5c1f6df63bc97f4a8ce37f14a50ca7878d434d6125b40443fe11fd292d13a4":"0x00000100","0xd57bce545fb382c34570e5dfbf338f5e878d434d6125b40443fe11fd292d13a4":"0x03000000","0x15464cac3378d46f113cd5b7a4d71c84878d434d6125b40443fe11fd292d13a4":"0x03000000","0x3c311d57d4daf52904616cf69648081e878d434d6125b40443fe11fd292d13a4":"0x00000100","0x57f8dc2f5ab09467896f47300f042438878d434d6125b40443fe11fd292d13a4":"0x03000000","0x7b3237373ffdfeb1cab4222e3b520d6b878d434d6125b40443fe11fd292d13a4":"0x00000100","0x57f8dc2f5ab09467896f47300f0424385e0621c4869aa60c02be9adcc98a0d1d":"0x1050673d59020488a4ffc9d8c6de3062a65977046e6990915617f85fef6d349730fe8102dbc244e7ea2babd9f53236d67403b046154370da5c3ea99def0bd0747a38144b5398e5d0da5ec936a3af23f5a96e782f676ab19d45f29075ee92eca76a3253947640e309120ae70fa458dcacb915e2ddd78f930f52bd3679ec63fc4415","0xbd2a529379475088d3e29a918cd47872878d434d6125b40443fe11fd292d13a4":"0x03000000","0xcec5070d609dd3497f72bde07fc96ba04c014e6bf8b8c2c011e7290b85696bb3b2f278bf7750703750673d59020488a4ffc9d8c6de3062a65977046e6990915617f85fef6d349730":"0x50673d59020488a4ffc9d8c6de3062a65977046e6990915617f85fef6d349730","0xcec5070d609dd3497f72bde07fc96ba0726380404683fc89e8233450c8aa19506f114d556b001da96175726180fe8102dbc244e7ea2babd9f53236d67403b046154370da5c3ea99def0bd0747a":"0xfe8102dbc244e7ea2babd9f53236d67403b046154370da5c3ea99def0bd0747a","0xcec5070d609dd3497f72bde07fc96ba088dcde934c658227ee1dfafcd6e16903":"0x1050673d59020488a4ffc9d8c6de3062a65977046e6990915617f85fef6d349730fe8102dbc244e7ea2babd9f53236d67403b046154370da5c3ea99def0bd0747a38144b5398e5d0da5ec936a3af23f5a96e782f676ab19d45f29075ee92eca76a3253947640e309120ae70fa458dcacb915e2ddd78f930f52bd3679ec63fc4415","0x682a59d51ab9e48a8c8cc418ff9708d2878d434d6125b40443fe11fd292d13a4":"0x03000000","0xc2261276cc9d1f8598ea4b6a74b15c2f57c875e4cff74148e4628f264b974c80":"0x00000000000000000000000000000000","0x15464cac3378d46f113cd5b7a4d71c84476f594316a7dfe49c1f352d95abdaf1":"0x00000000","0xe38f185207498abb5c213d0fb059b3d8878d434d6125b40443fe11fd292d13a4":"0x00000100","0x15464cac3378d46f113cd5b7a4d71c845579297f4dfb9609e7e4c2ebab9ce40a":"0x1050673d59020488a4ffc9d8c6de3062a65977046e6990915617f85fef6d349730fe8102dbc244e7ea2babd9f53236d67403b046154370da5c3ea99def0bd0747a38144b5398e5d0da5ec936a3af23f5a96e782f676ab19d45f29075ee92eca76a3253947640e309120ae70fa458dcacb915e2ddd78f930f52bd3679ec63fc4415","0xf0c365c3cf59d671eb72da0e7a4113c4878d434d6125b40443fe11fd292d13a4":"0x03000000","0x7474449cca95dc5d0c00e71735a6d17d878d434d6125b40443fe11fd292d13a4":"0x03000000","0xcec5070d609dd3497f72bde07fc96ba04c014e6bf8b8c2c011e7290b85696bb36d5c455f52f81fe03253947640e309120ae70fa458dcacb915e2ddd78f930f52bd3679ec63fc4415":"0x3253947640e309120ae70fa458dcacb915e2ddd78f930f52bd3679ec63fc4415","0x3f1467a096bcd71a5b6a0c8155e20810878d434d6125b40443fe11fd292d13a4":"0x03000000"} |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"0x57f8dc2f5ab09467896f47300f0424385e0621c4869aa60c02be9adcc98a0d1d":"0x109cfd429fa002114f33c1d3e211501d62830c9868228eb3b4b8ae15a83de0432512a03fb4e7bda6c9a07ec0a11d03c24746943e054ff0bb04938970104c7838761256436307dfde969324e95b8c62cb9101f520a39435e6af0f7ac07b34e1931f98102b7bca3f070f9aa19f58feed2c0a4e107d203396028ec17a47e1ed80e322","0x3c311d57d4daf52904616cf69648081e878d434d6125b40443fe11fd292d13a4":"0x00000100","0x5c0d1176a568c1f92944340dbfed9e9c878d434d6125b40443fe11fd292d13a4":"0x03000000","0x15464cac3378d46f113cd5b7a4d71c84579f5a43435b04a98d64da0cefe18505":"0x00a0acb9030000000000000000000000","0x7474449cca95dc5d0c00e71735a6d17d878d434d6125b40443fe11fd292d13a4":"0x03000000","0xbd2a529379475088d3e29a918cd47872878d434d6125b40443fe11fd292d13a4":"0x03000000","0xcec5070d609dd3497f72bde07fc96ba04c014e6bf8b8c2c011e7290b85696bb35ab31e77a3618bcb1256436307dfde969324e95b8c62cb9101f520a39435e6af0f7ac07b34e1931f":"0x1256436307dfde969324e95b8c62cb9101f520a39435e6af0f7ac07b34e1931f","0xd57bce545fb382c34570e5dfbf338f5e878d434d6125b40443fe11fd292d13a4":"0x03000000","0x1809d78346727a0ef58c0fa03bafa323878d434d6125b40443fe11fd292d13a4":"0x03000000","0x57f8dc2f5ab09467896f47300f042438878d434d6125b40443fe11fd292d13a4":"0x03000000","0xcec5070d609dd3497f72bde07fc96ba0726380404683fc89e8233450c8aa1950e54c60173d025c2561757261801256436307dfde969324e95b8c62cb9101f520a39435e6af0f7ac07b34e1931f":"0x1256436307dfde969324e95b8c62cb9101f520a39435e6af0f7ac07b34e1931f","0xe38f185207498abb5c213d0fb059b3d8878d434d6125b40443fe11fd292d13a4":"0x00000100","0x682a59d51ab9e48a8c8cc418ff9708d2878d434d6125b40443fe11fd292d13a4":"0x03000000","0x15464cac3378d46f113cd5b7a4d71c845579297f4dfb9609e7e4c2ebab9ce40a":"0x109cfd429fa002114f33c1d3e211501d62830c9868228eb3b4b8ae15a83de0432512a03fb4e7bda6c9a07ec0a11d03c24746943e054ff0bb04938970104c7838761256436307dfde969324e95b8c62cb9101f520a39435e6af0f7ac07b34e1931f98102b7bca3f070f9aa19f58feed2c0a4e107d203396028ec17a47e1ed80e322","0xc2261276cc9d1f8598ea4b6a74b15c2f308ce9615de0775a82f8a94dc3d285a1":"0x01","0xcec5070d609dd3497f72bde07fc96ba04c014e6bf8b8c2c011e7290b85696bb3a85cd90de8cc27b69cfd429fa002114f33c1d3e211501d62830c9868228eb3b4b8ae15a83de04325":"0x9cfd429fa002114f33c1d3e211501d62830c9868228eb3b4b8ae15a83de04325","0x7b3237373ffdfeb1cab4222e3b520d6b878d434d6125b40443fe11fd292d13a4":"0x00000100","0xc2261276cc9d1f8598ea4b6a74b15c2f57c875e4cff74148e4628f264b974c80":"0x00000000000000000000000000000000","0xcec5070d609dd3497f72bde07fc96ba0726380404683fc89e8233450c8aa1950ea408f1f1c5d332c617572618098102b7bca3f070f9aa19f58feed2c0a4e107d203396028ec17a47e1ed80e322":"0x98102b7bca3f070f9aa19f58feed2c0a4e107d203396028ec17a47e1ed80e322","0xcec5070d609dd3497f72bde07fc96ba088dcde934c658227ee1dfafcd6e16903":"0x109cfd429fa002114f33c1d3e211501d62830c9868228eb3b4b8ae15a83de0432512a03fb4e7bda6c9a07ec0a11d03c24746943e054ff0bb04938970104c7838761256436307dfde969324e95b8c62cb9101f520a39435e6af0f7ac07b34e1931f98102b7bca3f070f9aa19f58feed2c0a4e107d203396028ec17a47e1ed80e322","0xcec5070d609dd3497f72bde07fc96ba0e0cdd062e6eaf24295ad4ccfc41d4609":"0x109cfd429fa002114f33c1d3e211501d62830c9868228eb3b4b8ae15a83de043259cfd429fa002114f33c1d3e211501d62830c9868228eb3b4b8ae15a83de0432512a03fb4e7bda6c9a07ec0a11d03c24746943e054ff0bb04938970104c78387612a03fb4e7bda6c9a07ec0a11d03c24746943e054ff0bb04938970104c7838761256436307dfde969324e95b8c62cb9101f520a39435e6af0f7ac07b34e1931f1256436307dfde969324e95b8c62cb9101f520a39435e6af0f7ac07b34e1931f98102b7bca3f070f9aa19f58feed2c0a4e107d203396028ec17a47e1ed80e32298102b7bca3f070f9aa19f58feed2c0a4e107d203396028ec17a47e1ed80e322","0x15464cac3378d46f113cd5b7a4d71c84476f594316a7dfe49c1f352d95abdaf1":"0x00000000","0xf0c365c3cf59d671eb72da0e7a4113c4878d434d6125b40443fe11fd292d13a4":"0x03000000","0xcec5070d609dd3497f72bde07fc96ba04c014e6bf8b8c2c011e7290b85696bb3ae4f31799916e8f998102b7bca3f070f9aa19f58feed2c0a4e107d203396028ec17a47e1ed80e322":"0x98102b7bca3f070f9aa19f58feed2c0a4e107d203396028ec17a47e1ed80e322","0x5c0d1176a568c1f92944340dbfed9e9c530ebca703c85910e7164cb7d1c9e47b":"0x6648d7f3382690650c681aba1b993cd11e54deb4df21a3a18c3e2177de9f7342","0x3f1467a096bcd71a5b6a0c8155e20810878d434d6125b40443fe11fd292d13a4":"0x03000000","0xcd5c1f6df63bc97f4a8ce37f14a50ca7878d434d6125b40443fe11fd292d13a4":"0x00000100","0xcec5070d609dd3497f72bde07fc96ba04c014e6bf8b8c2c011e7290b85696bb38e68ce95d2dcc62d12a03fb4e7bda6c9a07ec0a11d03c24746943e054ff0bb04938970104c783876":"0x12a03fb4e7bda6c9a07ec0a11d03c24746943e054ff0bb04938970104c783876","0xcec5070d609dd3497f72bde07fc96ba0726380404683fc89e8233450c8aa1950c1006f4963f2df10617572618012a03fb4e7bda6c9a07ec0a11d03c24746943e054ff0bb04938970104c783876":"0x12a03fb4e7bda6c9a07ec0a11d03c24746943e054ff0bb04938970104c783876","0xd5e1a2fa16732ce6906189438c0a82c6878d434d6125b40443fe11fd292d13a4":"0x03000000","0xcec5070d609dd3497f72bde07fc96ba0726380404683fc89e8233450c8aa1950acc29cb77138d7ef61757261809cfd429fa002114f33c1d3e211501d62830c9868228eb3b4b8ae15a83de04325":"0x9cfd429fa002114f33c1d3e211501d62830c9868228eb3b4b8ae15a83de04325","0xcec5070d609dd3497f72bde07fc96ba0878d434d6125b40443fe11fd292d13a4":"0x03000000","0x3c311d57d4daf52904616cf69648081e5e0621c4869aa60c02be9adcc98a0d1d":"0x109cfd429fa002114f33c1d3e211501d62830c9868228eb3b4b8ae15a83de0432512a03fb4e7bda6c9a07ec0a11d03c24746943e054ff0bb04938970104c7838761256436307dfde969324e95b8c62cb9101f520a39435e6af0f7ac07b34e1931f98102b7bca3f070f9aa19f58feed2c0a4e107d203396028ec17a47e1ed80e322","0xc2261276cc9d1f8598ea4b6a74b15c2f878d434d6125b40443fe11fd292d13a4":"0x03000000","0x15464cac3378d46f113cd5b7a4d71c84878d434d6125b40443fe11fd292d13a4":"0x03000000"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env bash | ||
|
||
usage() { | ||
echo Usage: | ||
echo "$0 <chain-id>" | ||
exit 1 | ||
} | ||
|
||
chain_id=$1 | ||
|
||
[ -z "$chain_id" ] && usage | ||
|
||
pushd generate_genesis_values | ||
yarn | ||
popd | ||
|
||
node generate_genesis_values ../polkadot-parachains/res/$chain_id.json ../polkadot-parachains/res/${chain_id}_genesis_values.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
const fs = require("fs"); | ||
const { exit } = require("process"); | ||
const { xxhashAsHex } = require("@polkadot/util-crypto"); | ||
|
||
if (!process.argv[2] || !process.argv[3]) { | ||
console.log("usage: node generate_keys <input chainspec> <output json>"); | ||
exit(); | ||
} | ||
|
||
const input = process.argv[2]; | ||
const output = process.argv[3]; | ||
fs.readFile(input, "utf8", (err, data) => { | ||
if (err) { | ||
console.log(`Error reading file from disk: ${err}`); | ||
exit(1); | ||
} | ||
|
||
const toHex = (str) => "0x" + Buffer.from(str, "ascii").toString("hex"); | ||
const startsWith = (str, arr) => arr.some((test) => str.startsWith(test)); | ||
|
||
const filter_prefixes = [ | ||
// substrate well known keys | ||
":code", | ||
":heappages", | ||
":extrinsic_index", | ||
":changes_trie", | ||
":child_storage", | ||
] | ||
.map(toHex) | ||
.concat( | ||
// shell pallets | ||
["System", "ParachainSystem", "ParachainInfo", "CumulusXcm"].map((str) => | ||
xxhashAsHex(str) | ||
) | ||
) | ||
.concat([ | ||
// polkadot well known keys; don't seem necessary, but just to make sure | ||
"0x06de3d8a54d27e44a9d5ce189618f22db4b49d95320d9021994c850f25b8e385", | ||
"0xf5207f03cfdce586301014700e2c2593fad157e461d71fd4c1f936839a5f1f3e", | ||
"0x6a0da05ca59913bc38a8630590f2627cb6604cff828a6e3f579ca6c59ace013d", | ||
"0x6a0da05ca59913bc38a8630590f2627c1d3719f5b0b12c7105c073c507445948", | ||
"0x6a0da05ca59913bc38a8630590f2627cf12b746dcf32e843354583c9702cc020", | ||
"0x63f78c98723ddc9073523ef3beefda0c4d7fefc408aac59dbfe80a72ac8e3ce5", | ||
]); | ||
|
||
const spec = JSON.parse(data); | ||
|
||
const genesis = Object.fromEntries( | ||
Object.entries(spec.genesis.raw.top).filter( | ||
([key, value]) => !startsWith(key, filter_prefixes) | ||
) | ||
); | ||
fs.writeFileSync(output, JSON.stringify(genesis)); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"name": "generate_genesis_values", | ||
"version": "1.0.0", | ||
"description": "filter genesis key-value pairs from a chain spec and store them", | ||
"main": "index.js", | ||
"scripts": { | ||
"generate": "node index.js" | ||
}, | ||
"author": "Parity Technologies <admin@parity.io>", | ||
"license": "ISC", | ||
"dependencies": { | ||
"@polkadot/util-crypto": "^6.5.1" | ||
} | ||
} |
Oops, something went wrong.