git.delta.rocks / unique-network / refs/commits / 9773e5ade556

difftreelog

add script for manual migration

Max Andreev2023-06-12parent: #f747618.patch.diff
in: master
use westend
fix README

5 files changed

modified.envdiffbeforeafterboth
1RUST_TOOLCHAIN=nightly-2022-11-151RUST_TOOLCHAIN=nightly-2022-11-15
2POLKADOT_LAUNCH_BRANCH=unique-network2POLKADOT_LAUNCH_BRANCH=unique-network
3RELAY_CHAIN_TYPE=rococo3RELAY_CHAIN_TYPE=westend
4CHAINQL=v0.4.14CHAINQL=v0.4.1
5DESTINATION_SPEC_VERSION=v9420575DESTINATION_SPEC_VERSION=v942057
66
modifiedtests/src/migrations/942057-appPromotion/README.mddiffbeforeafterboth
3131
32## Execute offchain migration32## Execute offchain migration
3333
34To run, you need to add an environment variable (`SUPERUSER_SEED`) with the sudo key seed.34To run, you need to set an environment variables:
35- `SUPERUSER_SEED` – the sudo key seed.
36- `WS_RPC` – the network address
3537
36Run the script by executing the following command:38Run the migration by executing the following command:
3739
38```sh40```sh
39npx ts-node --esm lockedToFreeze.ts41npx ts-node --esm executeMigration.ts
40```42```
43
modifiedtests/src/migrations/942057-appPromotion/collectData.tsdiffbeforeafterboth
1import {exec, execSync} from 'child_process';1import {exec} from 'child_process';
2import path from 'path';2import path from 'path';
3import {dirname} from 'path';3import {dirname} from 'path';
4import {fileURLToPath} from 'url';4import {fileURLToPath} from 'url';
88
9 const pathToScript = path.resolve(dirName, './stakersParser.jsonnet');9 const pathToScript = path.resolve(dirName, './stakersParser.jsonnet');
10 const outputPath = path.resolve(dirName, './output.json');10 const outputPath = path.resolve(dirName, './output.json');
11 // execSync(`chainql --tla-str=chainUrl=wss://ws-quartz.unique.network:443 ${pathToScript} > ${outputPath}`);
12 // execSync(`chainql --tla-str=chainUrl=ws://127.0.0.1:9944 ${pathToScript} > ${outputPath}`);
13 exec(`chainql --tla-str=chainUrl=ws://127.0.0.1:9944 ${pathToScript} > ${outputPath}`);11 exec(`chainql --tla-str=chainUrl=ws://127.0.0.1:9944 ${pathToScript} > ${outputPath}`);
14};12};
1513
addedtests/src/migrations/942057-appPromotion/executeMigration.tsdiffbeforeafterboth

no changes

modifiedtests/src/util/frankenstein.tsdiffbeforeafterboth
263 // Enable maintenance mode if present263 // Enable maintenance mode if present
264 await toggleMaintenanceMode(true, para.nodes[0].wsUri);264 await toggleMaintenanceMode(true, para.nodes[0].wsUri);
265 if(migration) {265 if(migration) {
266 console.log('⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️');
267 console.log('⭐️⭐️⭐️ Running pre-upgrade scripts... ⭐️⭐️⭐️');266 console.log('⭐️⭐️⭐️ Running pre-upgrade scripts... ⭐️⭐️⭐️');
268 console.log('⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️');
269 await migration.before();267 await migration.before();
270 }268 }
271269