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
--- a/.env
+++ b/.env
@@ -1,6 +1,6 @@
 RUST_TOOLCHAIN=nightly-2022-11-15
 POLKADOT_LAUNCH_BRANCH=unique-network
-RELAY_CHAIN_TYPE=rococo
+RELAY_CHAIN_TYPE=westend
 CHAINQL=v0.4.1
 DESTINATION_SPEC_VERSION=v942057
 
modifiedtests/src/migrations/942057-appPromotion/README.mddiffbeforeafterboth
--- a/tests/src/migrations/942057-appPromotion/README.md
+++ b/tests/src/migrations/942057-appPromotion/README.md
@@ -31,10 +31,12 @@
 
 ## Execute offchain migration
 
-To run, you need to add an environment variable (`SUPERUSER_SEED`) with the sudo key seed.
+To run, you need to set an environment variables:
+- `SUPERUSER_SEED` – the sudo key seed.
+- `WS_RPC` – the network address
 
-Run the script by executing the following command:
+Run the migration by executing the following command:
 
 ```sh
-npx ts-node --esm lockedToFreeze.ts
-```
\ No newline at end of file
+npx ts-node --esm executeMigration.ts
+```
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
--- /dev/null
+++ b/tests/src/migrations/942057-appPromotion/executeMigration.ts
@@ -0,0 +1,11 @@
+import {migrateLockedToFreeze} from './lockedToFreeze';
+
+
+const WS_RPC = process.env.WS_RPC || 'wss://ws-opal.unique.network:443';
+const SUPERUSER_SEED = process.env.SUPERUSER_SEED || '';
+
+migrateLockedToFreeze({
+  wsEndpoint: WS_RPC,
+  donorSeed: SUPERUSER_SEED,
+})
+  .catch(console.error);
\ No newline at end of file
modifiedtests/src/util/frankenstein.tsdiffbeforeafterboth
--- a/tests/src/util/frankenstein.ts
+++ b/tests/src/util/frankenstein.ts
@@ -263,9 +263,7 @@
       // Enable maintenance mode if present
       await toggleMaintenanceMode(true, para.nodes[0].wsUri);
       if(migration) {
-        console.log('⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️');
         console.log('⭐️⭐️⭐️ Running pre-upgrade scripts... ⭐️⭐️⭐️');
-        console.log('⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️');
         await migration.before();
       }