[Steem-red] - Globals Nodes, Error Handling, Input Validation, and Required Fields
Errors fixed
Errors were not handled in a correct way in the library. For instance, when a user leave one of the required fields empty, the library didn't return any results. To fix this issue, I wrote the required fields validations by using a generic function to avoid repetition of code. Basically, I just checked for empty strings and null fields in the required inputs. In addition, I added the required attribute to the properties in Node-RED templates. So, by having the correct validations, Node-RED will tell the user that required fields are missing when they save the node or deploy the flow.
To return any error from the API as a payload to Node-RED, I created a if and else condition to determine whether it returned a response or an error. To be able to do so, I also had to create initial status of the node and final status at the error to handle any stage of the data.
Featured Added
New nodes were added covering the following methods from the SteemJs API:
- getChainProperties
- getConfig
- getCurrentMedianHistoryPrice
- getDynamicGlobalProperties
- getFeedHistory
- getHardforkVersion
- getNextScheduledHardfork
- getRewardFund
- getVestingDelegations
All these nodes belong to the Globals category in the library and they all have a short description of what it does.
Requirements
To run the nodes on your localhost you must have Node-RED installed on your localhost. To install Node-RED, run the following command in your terminal:
$ sudo npm install -g --unsafe-perm node-red
Installation
$ git clone https://github.com/jayserdny/node-red-contrib-steem
$ cd node-red-contrib-steem
$ npm install
To install the node modules on your localhost, install it into your Node-RED runtime.
$ sudo npm link
$ cd ~/.node-red
$ npm link node-red-contrib-steem
Run node-red.
$ node-red
Open a browser and go to the address http://127.0.0.1:1880.
Roadmap
As a roadmap, I will keep adding the missing nodes until have 100% coverage of the SteemJs API.
Contributions
To contribute fork the node-red-contrib-steem repository and submit pull requests.
Changelog
0.0.3 - 2018-01-28
- Added getChainProperties, getConfig, getCurrentMedianHistoryPrice, getDynamicGlobalProperties, getFeedHistory, getHardforkVersion, getNextScheduledHardfork, getRewardFund, getVestingDelegations nodes, generic method to validate fields, and error handling for each node.
0.0.2 - 2018-01-27
- Added getContent, getContentReplies, getDiscussionsByAuthorBeforeDate, getRepliesByLastUpdate, getContent, getContentReplies, getDiscussionsByAuthorBeforeDate, getRepliesByLastUpdate, getActiveWitnesses, getMinerQueue, getWitnessByAccount, getWitnessCount, getWitnesses, getWitnessesByVote nodes
0.0.1 - 2018-01-26
- Added getAccounts, getAccountCount, getConversionRequests, getAccountHistory, getOwnerHistory, getRecoveryRequest nodes
Posted on Utopian.io - Rewarding Open Source Contributors

Hey @jaysermendez I am @utopian-io. I have just upvoted you!
Achievements
Community-Driven Witness!
I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!
Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x
Thank you for the contribution. It has been approved.
You can contact us on Discord.
[utopian-moderator]