Configure Your First Virtual Device on Catenis Flow
Now that you have installed the Catenis pallet on Node-RED let’s configure connectivity to the Catenis Sandbox server. If you have still not installed the Catenis pallet see section titled “Installing the Catenis Flow Pallet on Node-RED” You will also be required to have singed up for an account at https://blockchainofthings.com.
Getting your Virtual Device ID and Access Secret
In order to have Catenis Flow connect to the Catenis APIs on the sandbox environment you first need to add your virtual devices credentials in Node-RED as a “configuration node”. This will require that you obtain both the Device ID and the API Access Secret from your Catenis administrative user interface.
- Login to https://sandbox.catenis.io/
- Click on the “Manage Virtual Devices” button
- Identify the “Device ID” corresponding to the device you wish to use. Copy this ID for later. Click on the hyperlink on the “Device ID”
- Click on the API Access Secret button
- Your Access Secret will be displayed in the pop-up. Copy the Device’s API Access Secret to be used in the next step
Adding Virtual Device to Node-RED
Virtual devices are created by setting up a configuration node. A configuration node is a special type of node that holds reusable configuration information that can be shared by nodes in a flow. Once a virtual device is created via a configuration node, this node will be available for use by all Catenis Flow nodes.
Let’s set up our first configuration node with the virtual device information. Double click on the “log message” node. This will expand the properties dialogue box for the log message node. This slide-out dialogue box contains all of the possible configurations for the specific node.
- To create a new device click the pencil button icon on the right of the Device ID field to add a new configuration node to the flow. A Configuration Node is a special type of node that holds a reusable configuration that can be shared by regular nodes in a flow. This way, a virtual device can be used by multiple nodes after being configured once.
- Enter the Virtual device ID and API access secret you obtained from your customer administration interface(as explained above).
- Enter a name in the “Name Field” (ie Bitcoin Connector)
- Enter your Virtual device ID in the “Device Field”
- Enter the API Access Secret in the “API Access Secret Field”
- Click “Add Button”
- The populated slide-out will show up again
- Uncheck Encrypt checkbox. Make sure the “encrypt” option is unchecked as we need to see the transaction on the Bitcoin blockchain to ensure it is working correctly
- For testing let’s also disable the “off-chain message” by unchecking this option so a bitcoin transaction is immediately created so we can later check for proper connectivity to the blockchain in a more timely fashion. Note: When building an application you should always use off-chain messages. Standard messages incur higher fees, cost more Catenis credits and create unneeded bitcoin transactions.
- Click the “Done” Button
Now you should be ready to test connectivity to the Catenis APIs via Catenis Flow and interact with the bitcoin blockchain.