Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 55 additions & 11 deletions README.md

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions src/commands/balances.ts
Original file line number Diff line number Diff line change
Expand Up @@ -622,13 +622,19 @@ export function registerBalancesCommand(program: Command): void {
verbose: !!opts.verbose,
withoutTor: opts.withoutTor,
stealthStartBlock,
stealthStartBlockBackdate: stealthStartBlockFlag !== undefined,
skipStealthScan: !!opts.skipStealthScan,
onTorStatus: (message) => {
loading.start(message);
},
onSyncProgress: (message) => {
loading.start(message);
},
onStealthScanStart: quiet
? undefined
: (message) => {
log.info(message);
},
onWarning: (msg) => {
if (!quiet) {
log.warn(chalk.yellow(msg));
Expand Down
31 changes: 26 additions & 5 deletions src/commands/clear-tor-cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@ import type { Command } from "commander";

import { cliOptions } from "../utils/cli-command-options.js";
import { logCliJson } from "../utils/cli-quiet.js";
import { DEFAULT_DATA_DIR } from "../utils/rpc.js";
import { clearPublicSyncCache } from "../utils/public-sync-cache.js";
import { clearTorJsCache } from "../utils/tor.js";

type Opts = {
nonInteractive?: boolean;
publicSync?: boolean;
dataDir?: string;
};

export function registerClearTorCacheCommand(program: Command): void {
Expand All @@ -16,16 +20,33 @@ export function registerClearTorCacheCommand(program: Command): void {
"Delete the on-disk tor-js cache (~/.local/share/tor-js); use after Tor bootstrap corruption errors"
)
.option("--non-interactive", cliOptions.nonInteractiveListWallets)
.option(
"--public-sync",
"Also delete <dataDir>/public-sync-cache (Railgun Subsquid / Tornado saga HTTP cache)"
)
.option("--dataDir <path>", cliOptions.dataDir)
.action((opts: Opts) => {
const result = clearTorJsCache();
const tor = clearTorJsCache();
const publicSync = opts.publicSync
? clearPublicSyncCache(opts.dataDir ?? DEFAULT_DATA_DIR)
: undefined;
if (opts.nonInteractive) {
logCliJson(result);
logCliJson({ ...tor, publicSync });
return;
}
console.log(
result.cleared
? chalk.green(`Cleared Tor cache: ${result.path}`)
: chalk.dim(`No Tor cache to clear (${result.path})`)
tor.cleared
? chalk.green(`Cleared Tor cache: ${tor.path}`)
: chalk.dim(`No Tor cache to clear (${tor.path})`)
);
if (publicSync) {
console.log(
publicSync.cleared
? chalk.green(
`Cleared public sync cache: ${publicSync.path} (${publicSync.filesRemoved} file(s))`
)
: chalk.dim(`No public sync cache to clear (${publicSync.path})`)
);
}
});
}
2 changes: 1 addition & 1 deletion src/commands/createWallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export function registerCreateWalletCommand(program: Command): void {
.option("--testnet", "Use testnet chain ID (11155111) instead of mainnet (1)")
.option(
"--stealth-start-block <block>",
"With --import: write `.stealth-start-block` for later balances stealth scans. New wallets record the current tip automatically."
"With --import: write `.stealth-start-block` for later balances stealth scans (default: mainnet 25700000, Sepolia 11455454). New wallets record the current tip automatically."
)
.option(
"--long-seed",
Expand Down
4 changes: 3 additions & 1 deletion src/commands/export-tornado-note.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import {
import { resolveTokenMeta } from "../utils/tokens-util";
import { withTor } from "../utils/tor.js";
import { runWithSyncProgress } from "../utils/sync-progress.js";
import { isFirstProtocolSync } from "../utils/first-sync.js";
import { assertTornadoExactPoolDenomination } from "../utils/tornado-pools.js";
import {
resolveWalletDir,
Expand Down Expand Up @@ -290,7 +291,8 @@ export function registerExportTornadoNoteCommand(program: Command): void {
() =>
runWithSyncProgress(
{
protocol: "tornado",
source: "tornado",
firstRun: isFirstProtocolSync(walletDir, "tornado"),
onUpdate: quiet ? undefined : (message) => spin.start(message),
},
() =>
Expand Down
Loading