Large amount of changes. Successfully broadcasts txs

This commit is contained in:
2026-03-08 15:53:50 +00:00
parent 66e9918e04
commit 9ef1720e1f
19 changed files with 1374 additions and 352 deletions

35
scripts/rm-dbs.ts Normal file
View File

@@ -0,0 +1,35 @@
import fs from 'fs/promises';
/**
* Remove all the databases without the use of external tools
* TODO: Fix the ts linking issue here. Should just be adding this as a dir in tsconfig.json
*/
const rmDbs = async (dry = false) => {
// First, we need to find all the database base files
// These end in either .db.sqlite, .sqlite, .db
// Get all the files in the current directory
const files = await fs.readdir('./');
// Filter out the files that end in .db.sqlite, .sqlite, .db
const dbFiles = files.filter(file => file.endsWith('.db.sqlite') || file.endsWith('.sqlite') || file.endsWith('.db'));
// We need to remove all the files
await deleteFiles(dbFiles, dry);
}
const deleteFiles = async (files: string[], dry = false) => {
if (dry) {
console.log('Dry run, would delete:', files);
return
}
await Promise.all(files.map(file => fs.rm(file)));
console.log('All databases removed');
}
// Read args
const args = process.argv.slice(2);
const dry = args.includes('--dry');
// Delete the files
await rmDbs(dry);