Catenis Flow Guide

Migrate Asset Node

The Migrate Asset node enables quantities of the Catenis Smart Asset you have exported to be moved to the foreign blockchain of your choice – Ethereum Binance Smart ChainPolygon PoS Chain. To transfer units of your Catenis Smart Assets, you must migrate (transfer) the asset after exporting. The same Catenis Smart Asset can be exported to multiple blockchains. Nevertheless, you will need to have enough units of your Smart Assets to migrate to more than one blockchain (Example: You have five XYZ Smart Assets, you can migrate one of these assets to Polygon, and the other four assets to Binance Smart Chain).

Image of the Migrate Asset Node

Note: Assets can be migrated out to a foreign blockchain and brought back into the Catenis platform. This is only possible if the Catenis Smart Asset was exported and units of that asset were previously migrated out.

Node Properties Panel Field Description

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

2021-10-21_16-37-52
Properties Configuration Panel of the Migrate Asset Node

Node-RED Specific Fields

  1. Name Field:  Add a descriptive name 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 directions on setting up a new virtual device that you can find here.

Catenis Flow Setting Fields

  1. Asset ID: Enter the ID of an asset you have previously created
  2. Foreign Blockchain – In this drop-down, choose the blockchain you have previously exported your Catenis Smart Asset to so you can transfer units of those assets. The blockchains currently available to export to – Ethereum Binance Smart ChainPolygon PoS Chain.
  3. Migration Direction: Units of Catenis Smart Assets can be migrated to a foreign blockchain (outward), and at some point, in the future, they can be converted back into Catenis Smart Assets (inward) from the foreign blockchain that were previously exported to. In this drop-down field, select the direction to migrate units. Outward • Inward
  4. Destination Address: This is the wallet address (public address) of the foreign blockchains that will receive the tokens after migrating units of your Catenis Smart Asset.

Note: Most wallets require importing your tokens by supplying the token contract address. See our documentation on the Asset Export Outcome Node.

  1. Consumption Profile: When executing the Migrate Asset functionality, a transaction is issued on the foreign blockchain, you have the ability to choose how fast or slow the transaction will be confirmed. This transaction migrates the tokens to the foreign blockchain and costs foreign blockchain native cryptocurrency. Faster is more expensive, and slower is least expensive. Fastest Fast · Average · Slow. Setting the consumption profile at this level overrides the consumption profile set at the administrative dashboard on your account.

Note: Blockchain of Thing, Inc. does not charge a fee for this Functionality. The fees deposited into the account are based on the fee market of the foreign blockchain and fluctuation per blockchain ecosystem and must be decided by the user. All native tokens deposited into this account for tokens exporting are non-refundable.

  1. Estimate Only- Selecting this option allows the ability to simulate the process and returns an estimate of the fee amount in the foreign blockchain’s cryptocurrency. The result indicates the amount of cryptocurrency needed in your administrative dashboard’s “Asset Export Admin Account.” Select the profile setting to either faster (more expensive) or slower (less expensive) to receive a different estimate.

How to use

  1. Drag-and-drop the Migrate Asset Node from the Catenis Flow pallet on the left-hand side of the interface to the Node-RED workspace. Double-click on the node to display the 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 (The device ID and API Secret key). If you do not have a virtual device already configured, please refer to our documentation titled: “Configure your First Virtual Device on Node-RED” here
  3. Add the node’s configuration information to each field of the properties slide-out panel based on your needs.  Please refer to the description of each field under the section named “Node Properties Panel Field Description” for proper usage.
  4. Then, 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 “Migrate Asset” Node, and 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 choosing 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 an input to the Catenis Node (an example JSON input is below). After entering your JSON text entry, click the red “Done” button. 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.
  12. To ensure that the export has been performed correctly, use the “Asset Migration Outcome” Node. Alternatively, you can get the TX ID from the returned JSON object and check the transaction using a block explorer.
  13. To add the tokens to a wallet, the wallet needs to be aware of the token contract address. Get this by executing the “Asset Export Outcome” node or the “List Exported Assets” Node in the token.id object.

Note: Some wallets require tokens to be added to the wallet by supplying the token contract address to the wallet (i.e., MetaMask). After exporting the token, a smart contract will be created, and its address will be available to be provided to a wallet. You can get the contract’s address by executing the "Asset Export Outcome" node or the "List Exported Assets" node. The result of each node will have a "token.id" object in the JSON result. The contract address will be in this token.id resulting property. Alternatively, you can automatically receive the contract address via the Asset Export Outcome (Asset-Export-Outcome) notification or simply examine the transaction ID on a block explorer.

Example JSON Object that can be passed to this node


{
    "assetId": "Insert_Your Asset_ID",
    "foreignBlockchain": "ethereum",
    "migration": {
        "direction": "outward",
        "amount": 5,
        "destAddress": "0x54A68^%27E410A87F042F6149e00YLK0EC72C9F"
    },
    "options": {
        "consumptionProfile": "slow",
        "estimateOnly": true
    }
}

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":"1ea68f60.b8fd71","type":"migrate asset","z":"3dbf2c28.70dd6c","name":"","connection":"","assetId":"","foreignBlockchain":"","direction":"","destAddress":"","consumptionProfile":"","estimateOnly":false,"x":420,"y":280,"wires":[["52c0334f.e14f44"]]},{"id":"dbbc316b.f2b848","type":"inject","z":"3dbf2c28.70dd6c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"assetId\":\"Insert_Your Asset_ID\",\"foreignBlockchain\":\"ethereum\",\"migration\":{\"direction\":\"outward\",\"amount\":5,\"destAddress\":\"0x54A68^%27E410A87F042F6149e00YLK0EC72C9F\"},\"options\":{\"consumptionProfile\":\"slow\",\"estimateOnly\":true}}","payloadType":"json","x":150,"y":280,"wires":[["1ea68f60.b8fd71"]]},{"id":"52c0334f.e14f44","type":"debug","z":"3dbf2c28.70dd6c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":670,"y":280,"wires":[]},{"id":"32daad09.df69e2","type":"comment","z":"3dbf2c28.70dd6c","name":"Set virtual device for this Catenis node - Click for instructions","info":"All Catenis nodes require that you set the proper virtual device on its slideout property panel on the device field. A Catenis Virtual Device is the equivalent of an API Account credential. If you are not familiar with a Catneis Virtual device, please read \"The Catenis Virtual Device\" in the Users guide.\n\n\nNot setting the virtual device properly will result in a \"TypeError: Cannot read property 'ctnApiClient' of null.\" ","x":440,"y":240,"wires":[]},{"id":"7107157c.8df254","type":"comment","z":"3dbf2c28.70dd6c","name":"Click for instructions","info":"Please use your an asset ID generated when you previously issued an asset with Catenis. If you are not familiar with issuing assets on Catenis, please see the documentation titled issuing assets with Catenis flow.\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 \"JSON\" Type.\n\n2)Click the ellipses \"...\" to the right of the JSON field. This will open up a slide-out box where you can edit the JSON File.\n\n3)Modify the Asset ID information by using an asset ID you have previously issued. \n\n4) Make any adjustments as necessary to the JSON inputs. ","x":150,"y":320,"wires":[]}]

Related Articles