Edit This Page

csverifyfiles

A CLI tool to check hashes of files against hashes generated by cshashfiles.

Install

$ npm install -g chainscript

Usage

$ csverifyfiles --help

  Usage: csverifyfiles [options] [hashes] [-- chainscript args]

  Options:

    -h, --help         output usage information
    -V, --version      output the version number
    -r, --root <path>  JSON root path

Examples

Verify files directly against the output of cshashfiles

$ cshashfiles | csverifyfiles

Output:

Success

Using hashes stored in a Chainscript

Say you had snapshotted hashes from cshashfiles like this:

$ cshashfiles -r content.files -- -s

Now you can verify files from that Chainscript. Assuming the Chainscript's uuid is chainscript:document:123456789:

$ csverifyfiles -r body.content.files -- chainscript:document:123456789

Output:

Success

Now, if you modify a file:

$ csverifyfiles -r body.content.files -- chainscript:document:123456789

Output:

Mismatch: Chainscript.js