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
before · .env
1RUST_TOOLCHAIN=nightly-2022-11-152POLKADOT_LAUNCH_BRANCH=unique-network3RELAY_CHAIN_TYPE=rococo4CHAINQL=v0.4.15DESTINATION_SPEC_VERSION=v94205767POLKADOT_MAINNET_BRANCH=release-v0.9.378STATEMINT_BUILD_BRANCH=release-parachains-v93709ACALA_BUILD_BRANCH=2.17.010MOONBEAM_BUILD_BRANCH=runtime-230211ASTAR_BUILD_BRANCH=v5.4.012UNIQUE_MAINNET_BRANCH=release-v94105513UNIQUE_REPLICA_FROM=wss://ws.unique.network:4431415KUSAMA_MAINNET_BRANCH=release-v0.9.3816STATEMINE_BUILD_BRANCH=release-parachains-v938217KARURA_BUILD_BRANCH=release-karura-2.17.018MOONRIVER_BUILD_BRANCH=runtime-230219SHIDEN_BUILD_BRANCH=v5.4.020QUARTZ_MAINNET_BRANCH=release-v94105521QUARTZ_REPLICA_FROM=wss://ws-quartz.unique.network:4432223UNIQUEWEST_MAINNET_BRANCH=release-v0.9.4224WESTMINT_BUILD_BRANCH=parachains-v942025OPAL_MAINNET_BRANCH=release-v94105526OPAL_REPLICA_FROM=wss://ws-opal.unique.network:4432728UNIQUEEAST_MAINNET_BRANCH=release-v0.9.4229SAPPHIRE_MAINNET_BRANCH=release-v94105530SAPPHIRE_REPLICA_FROM=wss://ws-sapphire.unique.network:443
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
--- a/tests/src/migrations/942057-appPromotion/collectData.ts
+++ b/tests/src/migrations/942057-appPromotion/collectData.ts
@@ -1,4 +1,4 @@
-import {exec, execSync} from 'child_process';
+import {exec} from 'child_process';
 import path from 'path';
 import {dirname} from 'path';
 import {fileURLToPath} from 'url';
@@ -8,7 +8,5 @@
 
   const pathToScript = path.resolve(dirName, './stakersParser.jsonnet');
   const outputPath = path.resolve(dirName, './output.json');
-  // execSync(`chainql --tla-str=chainUrl=wss://ws-quartz.unique.network:443 ${pathToScript} > ${outputPath}`);
-  // execSync(`chainql --tla-str=chainUrl=ws://127.0.0.1:9944 ${pathToScript} > ${outputPath}`);
   exec(`chainql --tla-str=chainUrl=ws://127.0.0.1:9944 ${pathToScript} > ${outputPath}`);
 };
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();
       }