Add a script to get subscribed and onboarded laconicd accounts #22
@ -14,7 +14,6 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@cerc-io/registry-sdk": "^0.2.6",
|
"@cerc-io/registry-sdk": "^0.2.6",
|
||||||
"@cosmjs/stargate": "^0.32.4",
|
"@cosmjs/stargate": "^0.32.4",
|
||||||
"cli-progress": "^3.12.0",
|
|
||||||
"csv-parse": "^5.5.6",
|
"csv-parse": "^5.5.6",
|
||||||
"csv-parser": "^3.0.0",
|
"csv-parser": "^3.0.0",
|
||||||
"csv-writer": "^1.6.0",
|
"csv-writer": "^1.6.0",
|
||||||
|
@ -6,7 +6,6 @@ import { hideBin } from 'yargs/helpers';
|
|||||||
import { parse as csvParse } from 'csv-parse';
|
import { parse as csvParse } from 'csv-parse';
|
||||||
import * as csvWriter from 'csv-writer';
|
import * as csvWriter from 'csv-writer';
|
||||||
import dotenv from 'dotenv';
|
import dotenv from 'dotenv';
|
||||||
import * as cliProgress from 'cli-progress';
|
|
||||||
|
|
||||||
import { StargateClient } from '@cosmjs/stargate';
|
import { StargateClient } from '@cosmjs/stargate';
|
||||||
import { Registry } from '@cerc-io/registry-sdk';
|
import { Registry } from '@cerc-io/registry-sdk';
|
||||||
@ -92,11 +91,6 @@ async function processSubscribers(client: StargateClient, participants: any[], s
|
|||||||
});
|
});
|
||||||
console.timeEnd('time_taken_decodingTxs');
|
console.timeEnd('time_taken_decodingTxs');
|
||||||
|
|
||||||
|
|
||||||
// Create a new progress bar instance
|
|
||||||
const progressBar = new cliProgress.SingleBar({}, cliProgress.Presets.shades_classic);
|
|
||||||
progressBar.start(subscribers.length, 0);
|
|
||||||
|
|
||||||
const onboardedSubscribers: any[] = [];
|
const onboardedSubscribers: any[] = [];
|
||||||
for (let i = 0; i < subscribers.length; i++) {
|
for (let i = 0; i < subscribers.length; i++) {
|
||||||
const subscriber = subscribers[i];
|
const subscriber = subscribers[i];
|
||||||
@ -129,14 +123,8 @@ async function processSubscribers(client: StargateClient, participants: any[], s
|
|||||||
};
|
};
|
||||||
|
|
||||||
onboardedSubscribers.push(onboardedSubscriber);
|
onboardedSubscribers.push(onboardedSubscriber);
|
||||||
|
|
||||||
// Update the progress bar
|
|
||||||
progressBar.update(i + 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Stop the progress bar
|
|
||||||
progressBar.stop();
|
|
||||||
|
|
||||||
const writer = csvWriter.createObjectCsvWriter({
|
const writer = csvWriter.createObjectCsvWriter({
|
||||||
path: path.resolve(outputPath),
|
path: path.resolve(outputPath),
|
||||||
header: [
|
header: [
|
||||||
|
@ -1031,13 +1031,6 @@ cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3:
|
|||||||
inherits "^2.0.1"
|
inherits "^2.0.1"
|
||||||
safe-buffer "^5.0.1"
|
safe-buffer "^5.0.1"
|
||||||
|
|
||||||
cli-progress@^3.12.0:
|
|
||||||
version "3.12.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/cli-progress/-/cli-progress-3.12.0.tgz#807ee14b66bcc086258e444ad0f19e7d42577942"
|
|
||||||
integrity sha512-tRkV3HJ1ASwm19THiiLIXLO7Im7wlTuKnvkYaTkyoAPefqjNg7W7DHKUlGRxy9vxDvbyCYQkQozvptuMkGCg8A==
|
|
||||||
dependencies:
|
|
||||||
string-width "^4.2.3"
|
|
||||||
|
|
||||||
cliui@^8.0.1:
|
cliui@^8.0.1:
|
||||||
version "8.0.1"
|
version "8.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/cliui/-/cliui-8.0.1.tgz#0c04b075db02cbfe60dc8e6cf2f5486b1a3608aa"
|
resolved "https://registry.yarnpkg.com/cliui/-/cliui-8.0.1.tgz#0c04b075db02cbfe60dc8e6cf2f5486b1a3608aa"
|
||||||
|
Loading…
Reference in New Issue
Block a user