Constructors

Properties

logger?: SoloLogger

Methods

  • Compute hash of the file contents

    Parameters

    • this: any
    • filePath: string

      path of the file

    • Optionalalgo: string = 'sha384'

      hash algorithm

    Returns Promise<string>

    hex digest of the computed hash

    • if the file cannot be read
  • Fetch data from a URL and save the output to a file

    Parameters

    • url: string

      source file URL

    • destPath: string

      destination path for the downloaded file

    Returns Promise<string>

  • Fetch a remote package

    Parameters

    • packageURL: string
    • checksumURL: string

      package checksum URL

    • destDir: string

      a directory where the files should be downloaded to

    • Optionalalgo: string = 'sha256'

      checksum algo

    • Optionalforce: boolean = false

      force download even if the file exists in the destDir

    Returns 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

    Parameters

    • tag: string

      full semantic version e.g. v0.40.4

    • destDir: string

      directory where the artifact needs to be saved

    • Optionalforce: boolean = false

      whether to download even if the file exists

    Returns Promise<string>

    full path to the downloaded file

  • Verifies that the checksum of the sourceFile matches with the contents of the checksumFile

    It throws error if the checksum doesn't match.

    Parameters

    • sourceFile: string

      path to the file for which checksum to be computed

    • checksum: string

      expected checksum

    • Optionalalgo: string = 'sha256'

      hash algorithm to be used to compute checksum

    Returns Promise<void>

    • if the checksum doesn't match