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_with_fileUpload - Source Path of the file being uploaded : ng-rt-digitalAsset-sdk-samples/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_with_fileUpload - Creating hash of the file...

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_with_fileUpload - File hash is stored in the blockchain with transaction id : 7c6f951c0867865b7dd9acb7955740

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_with_fileUpload - Verifying if fileAsset test_file1.txt is in the system...
[INFO] ng-rt-digitalAsset-sdk.examples.usecases.proof_of_existence_with_fileUpload - test_file1.txt fileAsset exists 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_with_fileUpload - Verifying if fileAsset test_file2.txt is in the system...
[INFO] ng-rt-digitalAsset-sdk.examples.usecases.proof_of_existence_with_fileUpload - test_file2.txt fileAsset exists 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_with_fileUpload - Downloaded file with the transaction id 6c89eb0a99205ed1a1ffd73a460863... to the path files/downloaded/
[INFO] ng-rt-digitalAsset-sdk.examples.usecases.proof_of_existence_with_fileUpload - Verifying if fileAsset downloaded/test_file1.txt is in the system...

We see that the downloaded file exists in the blockchain:

[INFO] ng-rt-digitalAsset-sdk.examples.usecases.proof_of_existence_with_fileUpload - downloaded/test_file1.txt fileAsset exists in the blockchain

Next steps

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