Proof of Existence

This sample application uses the TBSP on the Google Cloud Platform instance to create a hash for a local file, upload the hash to the blockchain, and validate the hash (to check if the file has been altered).

Run the sample

In a terminal session or in your Docker SDK container, execute the sample proof_of_existence.js:

node ng-rt-digitalAsset-sdk-samples/examples/usecases/proof_of_existence.js

(alias: proof)

You should see output similar to this:

[INFO] ng-rt-digitalAsset-sdk.examples.store_and_verify_filehash.js - Source Path of the file :  /home/docker/ng-rt-digitalasset-sdk-sample/examples/usecases/files/test_file1.txt
[INFO] ng-rt-digitalAsset-sdk.examples.store_and_verify_filehash.js -
[INFO] ng-rt-digitalAsset-sdk.examples.store_and_verify_filehash.js - Creating hash of the file...
[INFO] ng-rt-digitalAsset-sdk.examples.store_and_verify_filehash.js - File hash is : 79xaL9QyNpg8Tdn2f2ToRm3BJJkPtu4MdXJVhS3UWccfBaCY8hjBmukXjL7TTriz2E7sCZbXGZz8gJ6DL87XWs59kyR2R8ZsF11z73nAc4J4iBdoLjbpFW69wcERoCeTPg8vdYPJMswVnjbJKzGcVEHqndYxSXd1JdU8gCVr2zioaw
[INFO] ng-rt-digitalAsset-sdk.examples.store_and_verify_filehash.js -
[INFO] ng-rt-digitalAsset-sdk.examples.store_and_verify_filehash.js - Posting a transasction to the blockchain with the File hash...
[INFO] ng-rt-digitalAsset-sdk.examples.store_and_verify_filehash.js - File hash is stored in the blockchain with the transaction id : d26232536384ebc18d6751db0c6bf42e457762d6c01b9309109cf3f0ce0e5a78
[INFO] ng-rt-digitalAsset-sdk.examples.store_and_verify_filehash.js -
[INFO] ng-rt-digitalAsset-sdk.examples.store_and_verify_filehash.js - Verifying File hash...
[INFO] ng-rt-digitalAsset-sdk.examples.store_and_verify_filehash.js - File exists in the path : /home/docker/ng-rt-digitalasset-sdk-sample/examples/usecases/files/test_file1.txt

Click here to understand the output of Proof of Existence

Return to Sample Applications