node-red-contrib-iota-chrysalis
Version:
Node Red integration whith IOTA for Chrysalis. A new Dawn.
113 lines (102 loc) • 4.48 kB
HTML
<script type="text/javascript">
RED.nodes.registerType('iotamessages',{
category: 'IOTA 1.5',
color: '#3FADB5',
defaults: {
iotaNode: {value: "", type:"iotaserver"},
iotaValue: {value: "8f5132a0390fffbe88819f557b668c2772a65e5a60b19a80d1a3fea726079653"},
iotaSelect: {value: "messageID"},
name: {value:""}
},
inputs:1,
outputs:1,
icon: "iota15.png",
label: function() {
return this.name||"iotamessages";
}
});
</script>
<script type="text/x-red" data-template-name="iotamessages">
<div class="form-row">
<label for="node-function-iotaNode"><i class="fa fa-server"></i> IOTA node</label>
<input type="text" id="node-input-iotaNode" placeholder="node">
</div>
<div class="form-row">
<label for="node-function-iotaSelect"><i class="icon-tag"></i> Select Function</label>
<select id="node-input-iotaSelect">
<option value="messageChildren">messageChildren</option>
<option value="messageFind">messageFind</option>
<option value="messageID">messageID</option>
<option value="messageSubmit">messageSubmit</option>
</select>
</div>
<div class="form-row">
<label for="node-function-iotaValue"><i class="icon-tasks"></i> Args Function</label>
<input type="text" id="node-input-iotaValue" placeholder="messageID, or String or Json for messageSubmit">
</div>
<div class="form-row">
<label for="node-function-name"><i class="icon-tag"></i> Name</label>
<input type="text" id="node-input-name" class="paletteLabel" placeholder="Name">
</div>
</script>
<script type="text/x-red" data-help-name="iotamessages">
<p>Connects to IOTA Tangle Chrysalis.</p>
<b>IOTAnode: </b> Setup IOTA Chrysalis node provider settings like host, port (14265 or 443 - are usual).<br><br>
<b>Select Function:</b> Enter yout type of function to run.<br><br>
<h3>Inputs</h3>
<dl class="message-properties">
<dt>payload
<span class="property-type">string | json</span>
</dt>
<dd> the payload injected for address or output field:
</dd>
<dt class="optional">topic <span class="property-type">string</span></dt>
<dd> topic value not used.</dd>
</dl>
<h3>Outputs</h3>
<ol class="node-ports">
<li>Standard output
<dl class="message-properties">
<dt>payload <span class="property-type">string | object</span></dt>
<dd>the standard output of the command.</dd>
</dl>
</li>
<li>Standard error
<dl class="message-properties">
<dt>payload <span class="property-type">string</span></dt>
<dd>the standard error of the command.</dd>
</dl>
</li>
</ol>
<h3>Details</h3>
<p><code>msg.payload</code> is used as the payload injected of the node.
If payload is string will be used as address field.
If it contains an JSON object are used as value fields.
<h3>messageChildren</h3>
<p>Assume injected msg.payload as String is a <code>message</code> or you can inject Json format like this:</p>
<p><code>payload = {
<p> messageId : String or Hex}
</code></p>
<h3>messageFind</h3>
<p>Assume injected msg.payload as String is a <code>messageToFind</code> or you can inject Json format like this:</p>
<p><code>payload = {
<p> messageToFind : String or Hex}
</code></p>
<h3>messageID</h3>
<p>Assume injected msg.payload as String is a <code>message</code> or you can inject Json format like this:</p>
<p><code>payload = {
<p> messageId : String or Hex}
</code></p>
<h3>messageSubmit</h3>
<p>Assume injected msg.payload as String is a <code>messageToSubmit</code> or you can inject Json format like this:</p>
<p><code>payload = {
<p> messageToSubmit : String,
<p> messageIndex: String <code>default value is node-red-contrib-iota-Chrysalis</code>
<p>}
</code></p>
<h3>References</h3>
<ul>
<li><a href = "https://github.com/iotaledger/iota.js/tree/main/docs"> GitHub</a>
<p>Read more about iota.js API.</p></li>
</ul>
</script>