Understanding the Retrieve Message Container Node


Related Videos

Length: 6:27
Understanding The Log Message Node

Length: 2:46
Working With Log Message Node

Length: 3:01
Working With The Retrieve Message Container Node

Length: 3:17
Understanding The Read Message Node

Length: 2:23
Working With The Read Message Node

Retrieve Message Container Node

The “Retrieve Message Container” node retrieves information about where a message’s content is recorded. It takes as input the ID of the message you wish to retrieve container information for (in String format) and returns a JSON object containing the transaction ID, the confirmation status of the Bitcoin transaction, and the IPFS hash pointer location (if the message was stored externally).

Image of the Retrieve Message Container 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 Message Container Node

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.

Additional properties can be set by passing a JSON object when handling large content. Please refer to handling large content that can be found here

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). 
  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 Message Container” node, then double click the inject node to open its properties slide-out panel. 
  7. Alter the information in the inject node by selecting the drop-down payload field and choosing the “String” type.
  8. Enter a Catenis message ID in the String type field.
  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 of the inject node to send the ID 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.

Example String that can be passed to this node:


Warning: using this exact message ID in the string field will produce an error stating “No permission to retrieve message container”, as this example message ID refers to a message that was placed on the blockchain by a device you do not own or have permission to access. Please use your own message ID generated when you submitted a message to the blockchain either using the Catenis Flow “Log Message” node or the Catenis Flow “Send Message” node.

Example Flow - Import Into Node-Red to Get Started

[{"id":"6f9c8b3c.643aa4","type":"retrieve message container","z":"b69396b8.fdba28","name":"","device":"","x":420,"y":100,"wires":[["aa450af7.61c288"]]},{"id":"be5feace.e2d7b8","type":"inject","z":"b69396b8.fdba28","name":"","topic":"","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":150,"y":160,"wires":[["6f9c8b3c.643aa4"]]},{"id":"aa450af7.61c288","type":"debug","z":"b69396b8.fdba28","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":670,"y":100,"wires":[]},{"id":"739b54cf.8fe24c","type":"comment","z":"b69396b8.fdba28","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":424,"y":60,"wires":[]},{"id":"9cdf5c0a.d1bf9","type":"comment","z":"b69396b8.fdba28","name":"Double click for instructions","info":"Warning: You must enter your own message ID. Not the example provided.\n\nPlease use your own  message ID generated when you submitted a message to the blockchain either using the Catenis Flow “Log Message” node or the Catenis Flow “Send Message” node.\n\nSTEPS:\n1) Double click the \"inject\" node to alter the information in the inject node. Select the drop-down payload field and choose the “String” Type.\n\n2) Enter a Catenis message ID in the String type field.\n\n\n","x":150,"y":220,"wires":[]}]

Note: After importing the sample flow you will need to set the “retrieve message container” node to your own previously configured virtual device (a device you have used to log a message). You will also need to set the message ID (the payload in the inject node) to the id of a message you have previously logged.

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.