- Start the server:
go run $(pwd)/cmd/server
Alternatively, in docker:
docker build . -t zma
docker run -p 8080:8080 zma
- Upload image files to an arbitrary collection (cats):
for f in $(ls image/*)
do
curl -X POST --data-binary @$f localhost:8080/cats
echo
done
- Store the last printed checksum in your env (it always prints the bmt root sum):
YOUR_ROOT_HASH=14e08396215c156ff4998eca119fc15173d544bc74fad48332b2012bcb226774
At this point it is safe to remove your local images.
You can download again the server stored file using:
wget localhost:8080/cats/2 -O my.cat
Now you can proceed to verify file contents integrity:
- Request proofs for a given image (2):
curl -XGET -s localhost:8080/proof/cats/2 > proof.json
- Validate file integrity aginst your root checksum, downloaded contents and file index:
go run $(pwd)/cmd/checker -root $YOUR_ROOT_HASH -proofs $(<proof.json) -index 2 my.cat
Checksums should match for this file but should not match for any other.