Track and Trace output

Understanding the output of the Track and Trace sample

Let's break down the output.

First, the digital asset definition of sample_vehicle is displayed:

[INFO] examples.basic.createAssetDefinition - { digitalAsset: 'sample_vehicle',
digitalAssetDescription: 'Sample vehicle asset description',
createTransactionAllowedBySystem: true,
transferOwnershipAllowedBySystem: true,
createTransactionAllowedByUser: true,
transferOwnershipAllowedByUser: true,
divisibleAsset: false,
fungibleAsset: false,
blockchainProvider: 'T',
blockchainProviderVersion: '0.32.8',
blockchainDriver: 'bdbDriver',
  blockchainDriverVersion: '3.2.0' }

The public keys of the car manufacturer, Alice and Bob then follow,

These public keys serve as their identifiers in the sample below.

[INFO] examples.usecases.track_and_trace - Public Key of Car Manufacturer :  Fhgq2Hp8K24XQZD7ymeMEWn5kYzjs4YCjLn1JRChSFcv
[INFO] examples.usecases.track_and_trace -
[INFO] examples.usecases.track_and_trace - Public Key of Alice :  FdNS5zgFhe8Bo4hc5RXvrPXcKmiHjRof83HFvjUqubNo
[INFO] examples.usecases.track_and_trace -
[INFO] examples.usecases.track_and_trace - Public Key of Bob :  BWMjw8YQ4qNqEBJDNJ8VhjzdWm661uuW1aDvfNjQTXkL

In the first transaction, the car manufacturer creates an asset, a car. This transaction is assigned the following ID:

[INFO] examples.usecases.track_and_trace - CREATE transaction id :  5504afe08a739f294a3d36fd30bb527088adf8c017bf328176eac440f477b772
[INFO] examples.usecases.track_and_trace - 5504afe08a739f294a3d36fd30bb527088adf8c017bf328176eac440f477b772

Alice then buys the car, generating the following ID:

[INFO] examples.usecases.track_and_trace - TRANSFER 1 transaction id: df4d1e5b3e04c043e6eb1bed39b6bca7fe62960799e306c0cf5ea7d8efb10fdd
[INFO] examples.usecases.track_and_trace - df4d1e5b3e04c043e6eb1bed39b6bca7fe62960799e306c0cf5ea7d8efb10fdd

At a later point in time, Alice sells the car to Bob, which also generates another transaction ID:

TRANSFER 2 transaction id: a0399f440ddda1aa7b24b7c2e56daed8d38883b2718dd0ca4259782557071a6e
[INFO] examples.usecases.track_and_trace - a0399f440ddda1aa7b24b7c2e56daed8d38883b2718dd0ca4259782557071a6e

This transaction is validated, and the new owner of the asset, Bob, is seen in the output (indicated by his public key).

[INFO] examples.usecases.track_and_trace - Current owner of asset is :BWMjw8YQ4qNqEBJDNJ8VhjzdWm661uuW1aDvfNjQTXkL

Below is the entire asset history (i.e., the car). Specifically, the manufacturer of the car and the different owners of the car are shown:

[INFO] examples.usecases.track_and_trace - Asset history of car asset:
[INFO] examples.usecases.track_and_trace - 3 entries
[INFO] examples.usecases.track_and_trace - [ { txId:
    '5504afe08a739f294a3d36fd30bb527088adf8c017bf328176eac440f477b772',
  from: [ 'Fhgq2Hp8K24XQZD7ymeMEWn5kYzjs4YCjLn1JRChSFcv' ],
  to: [ 'Fhgq2Hp8K24XQZD7ymeMEWn5kYzjs4YCjLn1JRChSFcv' ],
  amount: 1,
  timestamp: 1602590863955 },
{ txId:
    'df4d1e5b3e04c043e6eb1bed39b6bca7fe62960799e306c0cf5ea7d8efb10fdd',
  from: [ 'Fhgq2Hp8K24XQZD7ymeMEWn5kYzjs4YCjLn1JRChSFcv' ],
  to: [ 'FdNS5zgFhe8Bo4hc5RXvrPXcKmiHjRof83HFvjUqubNo' ],
  amount: 1,
  timestamp: 1602590865337 },
{ txId:
    'a0399f440ddda1aa7b24b7c2e56daed8d38883b2718dd0ca4259782557071a6e',
  from: [ 'FdNS5zgFhe8Bo4hc5RXvrPXcKmiHjRof83HFvjUqubNo' ],
  to: [ 'BWMjw8YQ4qNqEBJDNJ8VhjzdWm661uuW1aDvfNjQTXkL' ],
  amount: 1,
  timestamp: 1602590866263 } ]

In addition, the transaction history is also displayed for each of the asset owners.

In addition to the public key, metadata such as the amount, assetType and timestamp are also shown.

[INFO] examples.usecases.track_and_trace - Tx history of manufacturer:
[INFO] examples.usecases.track_and_trace - 2 entries
[INFO] examples.usecases.track_and_trace - [ { txId:
    '5504afe08a739f294a3d36fd30bb527088adf8c017bf328176eac440f477b772',
  direction: 'create',
  from: [ 'Fhgq2Hp8K24XQZD7ymeMEWn5kYzjs4YCjLn1JRChSFcv' ],
  to: [ 'Fhgq2Hp8K24XQZD7ymeMEWn5kYzjs4YCjLn1JRChSFcv' ],
  amount: 1,
  assetType: 'sample_vehicle',
  timestamp: 1602590863955 },
{ txId:
    'df4d1e5b3e04c043e6eb1bed39b6bca7fe62960799e306c0cf5ea7d8efb10fdd',
  direction: 'out',
  from: [ 'Fhgq2Hp8K24XQZD7ymeMEWn5kYzjs4YCjLn1JRChSFcv' ],
  to: [ 'FdNS5zgFhe8Bo4hc5RXvrPXcKmiHjRof83HFvjUqubNo' ],
  amount: 1,
  assetType: 'sample_vehicle',
  timestamp: 1602590865337 } ]
[2020-10-13T12:07:47.566] [INFO] examples.usecases.track_and_trace - Tx history of alice:
[2020-10-13T12:07:47.566] [INFO] examples.usecases.track_and_trace - 2 entries
[2020-10-13T12:07:47.567] [INFO] examples.usecases.track_and_trace - [ { txId:
    'df4d1e5b3e04c043e6eb1bed39b6bca7fe62960799e306c0cf5ea7d8efb10fdd',
  direction: 'in',
  from: [ 'Fhgq2Hp8K24XQZD7ymeMEWn5kYzjs4YCjLn1JRChSFcv' ],
  to: [ 'FdNS5zgFhe8Bo4hc5RXvrPXcKmiHjRof83HFvjUqubNo' ],
  amount: 1,
  assetType: 'sample_vehicle',
  timestamp: 1602590865337 },
{ txId:
    'a0399f440ddda1aa7b24b7c2e56daed8d38883b2718dd0ca4259782557071a6e',
  direction: 'out',
  from: [ 'FdNS5zgFhe8Bo4hc5RXvrPXcKmiHjRof83HFvjUqubNo' ],
  to: [ 'BWMjw8YQ4qNqEBJDNJ8VhjzdWm661uuW1aDvfNjQTXkL' ],
  amount: 1,
  assetType: 'sample_vehicle',
  timestamp: 1602590866263 } ]
[2020-10-13T12:07:47.653] [INFO] examples.usecases.track_and_trace - Tx history of bob:
[2020-10-13T12:07:47.653] [INFO] examples.usecases.track_and_trace - 1 entries
[2020-10-13T12:07:47.653] [INFO] examples.usecases.track_and_trace - [ { txId:
    'a0399f440ddda1aa7b24b7c2e56daed8d38883b2718dd0ca4259782557071a6e',
  direction: 'in',
  from: [ 'FdNS5zgFhe8Bo4hc5RXvrPXcKmiHjRof83HFvjUqubNo' ],
  to: [ 'BWMjw8YQ4qNqEBJDNJ8VhjzdWm661uuW1aDvfNjQTXkL' ],
  amount: 1,
  assetType: 'sample_vehicle',
  timestamp: 1602590866263 } ]

Navigation

Click here to return to the main sample applications page.