Output of Proof of Existence with File Upload

Let's break down the output.

First, this sample uploads a file from a specified location and creates a file hash:

INFO] ng-rt-digitalAsset-sdk.examples.usecases.proof_of_existence.js - Source Path of the file being uploaded : /home/docker/ng-rt-digitalasset-sdk-sample/examples/usecases/files/test_file1.txt

It then sends a transaction to the Blockchain to store this file hash:

[INFO] ng-rt-digitalAsset-sdk.examples.usecases.proof_of_existence.js - File hash is stored in the blockchain with transaction id : fc541344727f3e9035a695b32541abd209301c18e8edd9d9fabc0c0338855b6e

Similarly to the previous proof of existence transaction, the file hash of test_file1.txt from the above location is compared to that sent to the blockchain. Here, we see that it exists:

[INFO] ng-rt-digitalAsset-sdk.examples.usecases.proof_of_existence.js - File hash exists : esUN7WZgSkKWt7wcoeitoGoMZZfhoPJLQEDUqZ8MkzDU9BP2NcLoM

We see that the file has been uploaded to the database of the TBSP server and that the file asset has been created:

[INFO] ng-rt-digitalAsset-sdk.examples.usecases.proof_of_existence.js - File asset created and file uploaded, file hash is : esUN7WZgSkKWt7wcoeitoGoMZZfhoPJLQEDUqZ8MkzDU9BP2NcLoM

The sample application now compares the file hash from the database and compares its file hash against that of the blockchain:

[INFO] ng-rt-digitalAsset-sdk.examples.usecases.proof_of_existence.js - Check if the downloaded file exists in the blockchain
[INFO] ng-rt-digitalAsset-sdk.examples.usecases.proof_of_existence.js - test_file1.txt hash exist in the blockchain

The sample application now compares the file hash of another file, test_file2.txt, against the file hash of test_file1.txt on the blockchain. It does not exist:

[INFO] ng-rt-digitalAsset-sdk.examples.usecases.proof_of_existence.js - test_file2.txt does not exist in the blockchain

Now, the sample application downloads the file containing the transaction ID to a specific location:

[INFO] ng-rt-digitalAsset-sdk.examples.usecases.proof_of_existence.js - Downloading file with transaction id : fc541344727f3e9035a695b32541abd209301c18e8edd9d9fabc0c0338855b6e
[INFO] ng-rt-digitalAsset-sdk.examples.usecases.proof_of_existence.js - Downloaded file with the transaction id fc541344727f3e9035a695b32541abd209301c18e8edd9d9fabc0c0338855b6e to the path /home/docker/ng-rt-digitalasset-sdk-sample/examples/usecases/files/downloaded

We see that the downloaded file exists in the blockchain:

[INFO] ng-rt-digitalAsset-sdk.examples.usecases.proof_of_existence.js - Downloaded file exists in the blockchain

Next steps

Return to the main sample applications page to run other sample applications.