UNPKG

@hashgraph/solo

Version:

An opinionated CLI tool to deploy and manage private Hedera Networks.

55 lines (54 loc) 2.34 kB
import { type SoloLogger } from './logging.js'; export declare class PackageDownloader { readonly logger?: SoloLogger; constructor(logger?: SoloLogger); isValidURL(url: string): boolean; urlExists(url: string): Promise<boolean>; /** * Fetch data from a URL and save the output to a file * * @param url - source file URL * @param destPath - destination path for the downloaded file */ fetchFile(url: string, destPath: string): Promise<string>; /** * Compute hash of the file contents * @param filePath - path of the file * @param [algo] - hash algorithm * @returns hex digest of the computed hash * @throws {Error} - if the file cannot be read */ computeFileHash(this: any, filePath: string, algo?: string): Promise<string>; /** * Verifies that the checksum of the sourceFile matches with the contents of the checksumFile * * It throws error if the checksum doesn't match. * * @param sourceFile - path to the file for which checksum to be computed * @param checksum - expected checksum * @param [algo] - hash algorithm to be used to compute checksum * @returns * @throws {DataValidationError} - if the checksum doesn't match */ verifyChecksum(sourceFile: string, checksum: string, algo?: string): Promise<void>; /** * Fetch a remote package * @param packageURL * @param checksumURL - package checksum URL * @param destDir - a directory where the files should be downloaded to * @param [algo] - checksum algo * @param [force] - force download even if the file exists in the destDir */ fetchPackage(packageURL: string, checksumURL: string, destDir: string, algo?: string, force?: boolean): Promise<string>; /** * Fetch Hedera platform release artifact * * It fetches the build.zip file containing the release from a URL like: https://builds.hedera.com/node/software/v0.40/build-v0.40.4.zip * * @param tag - full semantic version e.g. v0.40.4 * @param destDir - directory where the artifact needs to be saved * @param [force] - whether to download even if the file exists * @returns full path to the downloaded file */ fetchPlatform(tag: string, destDir: string, force?: boolean): Promise<string>; }