Client generates files, calculates merkle root and unloads files to the server (deletes locally and uploads to the server).
Server accepts files to store, calculate merkle tree, when requested file, returns merkle proof.
Client when downloading file, can calculate merkle root hash from proof and be sure the file is not corrupted.
- Run server:
docker-compose up -d
- Run client:
docker pull redcuckoo/merkle-tree-verifier-server:v0.2.0
docker run --network merkle-tree-verifier_default -it redcuckoo/merkle-tree-verifier-client:v0.2.0
Run script:
./run.sh
Available commands:
generate AMOUNT_OF_FILES # generate N amount of files on the client
list --local # list files stored locally on the client
list --remote # list files stored remotely on the server
unload # send files to the server, store merkle root, delete local
download FILE_INDEX # download file from the server
reset # reset client and server
exit
Simple demo:
generate 10
list --local
list --remote
unload
list --local
list --remote
download 1
list --local
list --remote
reset