UNPKG

chainscript

Version:
72 lines (47 loc) 1.12 kB
# csverifyfiles A CLI tool to check hashes of files against hashes generated by [cshashfiles](cshashfiles.md). ## Install ```bash $ npm install -g chainscript ``` ## Usage ```bash $ 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` ```bash $ cshashfiles | csverifyfiles ``` Output: ``` Success ``` ### Using hashes stored in a Chainscript Say you had snapshotted hashes from `cshashfiles` like this: ```bash $ cshashfiles -r content.files -- -s ``` Now you can verify files from that Chainscript. Assuming the Chainscript's uuid is `chainscript:document:123456789`: ```bash $ csverifyfiles -r body.content.files -- chainscript:document:123456789 ``` Output: ```json Success ``` Now, if you modify a file: ```bash $ csverifyfiles -r body.content.files -- chainscript:document:123456789 ``` Output: ```json Mismatch: Chainscript.js ```