node-red-contrib-near-protocol
v1.0.5
Published
Allows to run Near Protocol blockchain smart-contract methods on Node RED
Downloads
9
Maintainers
Readme
node-red-contrib-near-protocol
This module provides nodes to call smart contract methods and observe it from your automation Node-RED Project.
Install
To install the stable version use the Menu
- Manage palette
option and search for node-red-contrib-near-protocol
, or run the following command in your Node-RED user directory - typically ~/.node-red
:
cd ~/.node-red
npm i node-red-contrib-near-protocol
Create your first flow
Add
Near Contract
node to workspaceDouble click it and configure contract.
Set values to fields, fill in contract methods and press
Done
Press
Deploy
button. After succesful flow deploy you have to see similar contract node or error message.Add
Contract Method
node to workspaseDouble click it and configure method. Choose created before contract and method and press
Done
Method node has to change label
To call contract we have to emit some event and pass some arguments. To do it let't add standard
inject
node to a workspace.Set arguments to
payload
field and pressDone
Add standart
debug
node to show result in debug console, connect nodes inputs and outputs and pressDeploy
. After that you can run contract by pressing to button oninject
node.Execution error will be displayed in debug console and as a contract node status
Execution succes result will be transmitted to next node. If contract call does not return any result next node will get
{ payload: {} }