Catenis Flow Guide

Retrieve Asset Issuance History Node

The “Retrieve Asset Issuance History” node on Catenis Flow allows you to view the entire history of issuances for a given asse (token) and/or virtual device(s) it was issued to. It also allows you to filter based on a date range, amounts of assets and skip and number of assets.

image of the Retrieve Asset Issuance History Node

Node Properties Panel Field Description

Node property configuration slide-out panel (this panel is accessed by double-clicking on the node).

2020-07-27_21-01-14
Properties Configuration Panle of the Retrieve Asset Issuance History

Node-RED Specific Fields

  1. Name Field:  Add a descriptive name of your choice that will help differentiate this node from others of the same type on the Node-RED workspace (not required).
  2. Connection Field: This drop-down selection is required.  Set a previously configured Catenis connection (virtual device). If you need to configure a new virtual device click the pencil button to the right of the field and follow the direction on setting up a new virtual device that can be found here.

Catenis Flow Setting Fields

  1. Asset ID: Enter the asset ID of the asset you wish to view the history for.Required.
  2. Start Date: To set a lower limit for the time period you wish  to see history for, enter a start date.
  3. End Date: To set an upper limit for the time period you wish to view the history for, enter an end date.
  4. Limit: If desired, enter a limit to the maximum number of issuances you wish to be returned.
  5. Skip: If desired, enter a number here to skip listing a set amount of issuances (starting from the top).

How to use

  1. Drag and drop this node from the Catenis Flow pallet area to the Node-RED workspace. Double-click it to display its properties slide out panel.
  2. On the “Device” drop-down field of the properties slide out panel, choose the Catenis virtual device you previously configured. The virtual device is a configuration node containing the Catenis Virtual device information (device ID and API Secret key). If you do not have a virtual device configured see section titled: “Configure your first virtual device on Node-RED” 
  3. Add the node’s configuration information based on your needs to each field of the properties slide out panel.  Please refer to the description of each field under the section named “Node Properties Panel Field Description” on proper usage.
  4. Wire this node to a debug node. 
  5. Next, drag and drop an “inject” node to the Node-RED workspace.
  6. Wire the “inject” node to the  “Retrieve Assets Issuance History” node, then double click the inject node to open its properties slide out panel. 
  7. Alter the information in the inject node’s properties slide out panel by selecting the drop-down “Payload” field and choose the “JSON” Type. An Ellipse button “…” will appear to the right of the field. Click this ellipse button to display a JSON edit box. 
  8. Enter the JSON information you wish to pass as input to the Catenis Node (an example JSON input is below). After entering your JSON text entry click the red Done button. Then click the Done button again to exit the properties dialogue box.
  9. Click the red Deploy button on the upper right hand side of the Node-RED dashboard to deploy this flow.
  10. Now let’s test the flow: Click the button on the left attached to the inject node to send the input from the inject node to the flow.
  11. The debug sidebar should display the returned JSON object containing the API call results to the right side of the workspace.

How to use interactively

This node can be used in two modes: interactive and run-time. In interactive mode, the end user clicks on the action button attached to the node and the Catenis API method is called using the default settings (as specified in the node’s properties slide out panel configuration).

  1. Follow steps 1 through 4 under “How to use” above
  2. Click the red Deploy button on the upper right hand side of the Node-RED dashboard to deploy this flow.
  3. Now let’s test the flow: Click the button on the left attached to this node to send the default property panel setting to the Catenis APIs and through the flow. 
  4. The debug sidebar should display the returned JSON object containing the results to the right side of the workspace.

Example JSON Object that can be passed to this node


{
    "assetId": "akXJpFoD79GZy7wWc9cd",
    "startDate": "2018-03-17T18:00:00Z",
    "limit": 100,
    "skip": 0
}


Note: Inputs injected into this node via a JSON object containing alternate node properties will override the properties set on this node's slide out properties panel. In addition, you will also need to set the proper asset ID of an asset you have previously issued.

Example Flow - Import Into Node-Red to Get Started


[{"id":"1363a9e.3952756","type":"tab","label":"Flow 12","disabled":false,"info":""},{"id":"3f6a498b.7912f6","type":"retrieve asset issuance history","z":"1363a9e.3952756","name":"","device":"","assetId":"","startDate":"","endDate":"","limit":"","skip":"","x":410,"y":140,"wires":[["75284816.f2ea48"]]},{"id":"ea95262.dbd34d8","type":"inject","z":"1363a9e.3952756","name":"","topic":"","payload":"{\"assetId\":\"akXJpFoD79GZy7wWc9cd\",\"startDate\":\"2018-03-17T18:00:00Z\",\"limit\":100,\"skip\":0}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":150,"y":140,"wires":[["3f6a498b.7912f6"]]},{"id":"75284816.f2ea48","type":"debug","z":"1363a9e.3952756","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":670,"y":140,"wires":[]},{"id":"ee662407.cc6c48","type":"comment","z":"1363a9e.3952756","name":"Set virtual device for this Catenis node","info":"All Catenis nodes require that you set the proper virtual device on its slideout property panel on the device field.\n\nNot setting the device properly will result in a \"TypeError: Cannot read property 'ctnApiClient' of null\" ","x":398,"y":100,"wires":[]}]

Note: After importing this flow you will need to set the Catenis Flow node(s) in this flow to use a previously configured virtual devices. Instructions on how to set up your virtual device on Node-RED can be found here: https://blockchainofthings.com/docs/configure-your-first-virtual-device-on-catenis-flow/

Related Articles

CompanyElement_SM_LightBackgrounds
How can we make things Better for you?
  • Accepted file types: jpg, gif, png, pdf.
  • This field is for validation purposes and should be left unchanged.