UNPKG

ssv-keys

Version:

CLI Tool for splitting a validator key into a predefined threshold of shares via Shamir-Secret-Sharing (SSS), and encrypt them with a set of operator keys.

44 lines (38 loc) 2.06 kB
import colors from "colors/safe"; import pkg from "../package.json"; import { SSVKeysCommand } from "./commands/SSVKeysCommand"; const BannerMessage = async () => { const banner = ` ███████╗███████╗██╗ ██╗ ██╗ ██╗███████╗██╗ ██╗███████╗ ██╔════╝██╔════╝██║ ██║ ██║ ██╔╝██╔════╝╚██╗ ██╔╝██╔════╝ ███████╗███████╗██║ ██║ █████╔╝ █████╗ ╚████╔╝ ███████╗ ╚════██║╚════██║╚██╗ ██╔╝ ██╔═██╗ ██╔══╝ ╚██╔╝ ╚════██║ ███████║███████║ ╚████╔╝ ██║ ██╗███████╗ ██║ ███████║ ╚══════╝╚══════╝ ╚═══╝ ╚═╝ ╚═╝╚══════╝ ╚═╝ ╚══════╝ 🗝️ SSV Keys v${pkg.version} `; return banner; }; export default async function main(interactive: boolean): Promise<any> { const message = await BannerMessage(); console.log( " ----------------------------------------------------------------------" ); console.log(message); for (const str of String(pkg.description).match(/.{1,67}/g) || []) { console.log(` ${str}`); } console.log( " ----------------------------------------------------------------------\n" ); const command = new SSVKeysCommand(interactive); try { const outputFile = await command.execute(); console.debug( "\nKey distribution successful! Find your key shares file at:" ); console.debug(`${colors.bgYellow(colors.black(outputFile))}`); } catch (error: any) { console.trace(`${colors.red("Error:")} ${colors.bold(error.message)}`); } }