Files
pezkuwi-subxt/scripts/generate_genesis_values/index.js
T
Alexander Popiak e304662f04 Upstream Statemine Release v5 Changes to Master (#720)
* Update references

* update deps

* set substrate deps for pallet-asset-tx-payment

* add DisabledValidatorsThreshold to parachain template

* add DisabledValidatorsThreshold to statemint runtimes

* adjust imports

* update Cargo-lock

* add DisabledValidatorsThreshold to mock config

* cargo +nightly fmt

* adjust on_disabled type

* remove on_chain_votes function in ParachainHost impl

* remove ScrapedOnChainVotes

* bump polkadot-collator version

Co-authored-by: Chevdor <chevdor@users.noreply.github.com>

* update Cargo.lock

* set spec_versions to 500

* Statemine cannot execute.

* disallow XCM execute on statemint

* cargo fmt

* remove unnecessary dep on node-primitives

* select parachains-common/std feature when building rococo-runtime with std

* adjust Statemint to the three digit spec_version format

* Add script to generate simple changelogs (#668)

* Update weights from v4 for v5 comparison (#673)

* updates weights

* pallet_unique benchmarks added + weights upstream from v4

* Fix benchmarks after Parachain Template (#677)

* updates weights

* pallet_unique benchmarks added + weights upstream from v4

* benchmarks fix for parachain template

* Weights updates for Statemine v5 (#682)

* updates weights

* pallet_unique benchmarks added + weights upstream from v4

* weights updates for statemine v5

* mention Storage in construct_runtime macro for pallet-xcm (#680)

* Use pallet-xcm for version wrapping (#689)

* use PolkadotXcm for XcmRouter WrapVersion

* use PolkadotXcm for version wrapping

Co-authored-by: Bryan Chen <xlchen1291@gmail.com>

* patch weight for batch_all from rerun

* Runtime version bump to v503 (#694)

* adjust genesis value generation scripts to output entries array + add script to derive encoded call

* add script to generate shell spec from runtime wasm

* Ensure a bad datastream cannot cause problems (#701)

* Ensure a bad datastream cannot cause problems

* Formatting

* Formatting

* update Polkadot (to 0.9.11 169bab55d)

* bump spec versions

* Allow Queries and Subscriptions

Fixes

Formatting

* fix build

* make fmt happy

* statemint imports

* slight naming changes in script

* add shell genesis data + wasm + chainspec

* adjust generated shell spec with production config values

* update Substrate and Polkadot to master

* fix deps

* swap out bootnodes for statemint shell

* add a script for verifying the shell chain spec

* add sha checksum for head data

* remove verification script

* remove hex wasm file

* update Substrate and Polkadot again and fix compilation

* update and fix lock file

* formatting

* remove redundant dispatch_as weight

Co-authored-by: Bastian Köcher <info@kchr.de>
Co-authored-by: Chevdor <chevdor@users.noreply.github.com>
Co-authored-by: Gav Wood <gavin@parity.io>
Co-authored-by: Ignacio Palacios <ignacio.palacios.santos@gmail.com>
Co-authored-by: Bryan Chen <xlchen1291@gmail.com>
Co-authored-by: joepetrowski <joe@parity.io>
2021-11-08 15:52:47 +01:00

55 lines
1.7 KiB
JavaScript

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.entries(spec.genesis.raw.top).filter(
([key, value]) => !startsWith(key, filter_prefixes)
);
fs.writeFileSync(output, JSON.stringify(genesis));
});