Retrieve Asset Info Node

The “Retrieve Asset Info” node can be used to retrieve detailed information about an issued asset. It will take the asset ID as an input. It will return 6 pieces of information about the asset including: the name, the description, whether it can be reissued, the maximum number of decimal places it can be divided into, the device Id of the issuer, and the total balance.

Image of the Retrieve Asset Info Node

Node Properties Panel Field Description

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

Image of The Retrieve Asset Info Properties Panel

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 ID of an asset you have previously created.

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 Asset Info” 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 values set in the properties panel (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 values set on the property panel 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"

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.

Example Flow - Import Into Node-Red to Get Started

[{"id":"f4acd5f.cb5a028","type":"retrieve asset info","z":"ae3660d6.488fd","name":"","device":"65b491ab.666c5","assetId":"abjd8ZWx7CSTm7LSgoBz","x":450,"y":120,"wires":[["83d5b413.f37268"]]},{"id":"85249849.2ba658","type":"inject","z":"ae3660d6.488fd","name":"","topic":"","payload":"{\"assetId\":\"enter your assetId here\"}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":230,"y":120,"wires":[["f4acd5f.cb5a028"]]},{"id":"83d5b413.f37268","type":"debug","z":"ae3660d6.488fd","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":690,"y":120,"wires":[]},{"id":"40f5806.f8dea8","type":"comment","z":"ae3660d6.488fd","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\" \n\nIt is required that you enter your asset Id in the Asset Id field.","x":450,"y":80,"wires":[]},{"id":"f2779bb4.a07568","type":"comment","z":"ae3660d6.488fd","name":"Double click for instructions","info":"Warning: You must enter your own asset ID in the JSON field.\n\n\n\n\n","x":210,"y":160,"wires":[]},{"id":"65b491ab.666c5","type":"catenis device","z":"","name":"Catenis Test Device 1","deviceId":"dL8zaQDcyNvxRW3FqsJd","apiAccessSecret":"2e080fe06bd9d6403639d8e7c8d4b518949fdbf1e76a651e29706135a98c73dc815ee7647f7cb9b5ae19b04010b32718f1b85aacdd281677aca7499eeb3275f7","host":"","environment":"sandbox","secure":true,"version":"","useCompression":true,"compressThreshold":""}]

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:

Related Articles

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.