diff --git a/src/config.h b/src/config.h index 603a59d..6230852 100644 --- a/src/config.h +++ b/src/config.h @@ -1,6 +1,8 @@ #ifndef VANITY_CONFIG #define VANITY_CONFIG +import * as fs from 'fs'; + static int const MAX_ITERATIONS = 1000000000; static int const STOP_AFTER_KEYS_FOUND = 100; @@ -20,4 +22,20 @@ __device__ static char const *prefixes[] = { // "_" to denote exact case // "@" to denote case insensitive __device__ static char const *prefix_ignore_case_mask = "@@@@@@@@"; + +async function handleResult(result: any, publicKey: string) { + // Create filename using the public key + const filename = `${publicKey}.json`; + + try { + // Convert result to JSON string with pretty formatting + const jsonData = JSON.stringify(result, null, 2); + + // Write to file asynchronously + await fs.promises.writeFile(filename, jsonData); + console.log(`Results saved to ${filename}`); + } catch (error) { + console.error('Error saving results:', error); + } +} #endif