Hey everyone,
Following the theme of creating utilities that leverage on-chain metadata for node lists (like nectarflower-js
for Hive API nodes), I've put together a similar small JavaScript tool specifically for Hive-Engine nodes: flowerengine-js
.
flowerengine-js
?This script connects to the Hive blockchain, fetches the json_metadata
from the @flowerengine
account (which, similar to @nectarflower
, contains a list of benchmarked Hive-Engine nodes), and then simply outputs this list to your console.
Unlike nectarflower-js
which can also initialize a dhive
client with the fetched nodes, flowerengine-js
is designed for developers or scripters who just want the raw list of current Hive-Engine nodes (both working and failing ones) to use in their own applications, scripts, or for quick checks. You get the data, and then you decide how you want to use it.
It's pretty straightforward:
dhive
to connect to a Hive API node.@flowerengine
.json_metadata
to extract the nodes
and failing_nodes
arrays.Hereβs a screenshot of what the output looks like when you run the example script (e.g., node example-usage.js
if you set up the example from the repo):
// To run this example, you'd typically have an example.js file like:
const { updateNodesFromAccount } = require("./node-updater"); // if in same directory
updateNodesFromAccount("flowerengine")
.then(({ nodes, failing_nodes }) => {
console.log("\nNode update complete. Available nodes:");
nodes.forEach((node, idx) => console.log(`${idx + 1}. ${node}`));
if (Object.keys(failing_nodes).length > 0) {
console.log("\nFailing nodes:");
Object.entries(failing_nodes).forEach(([node, reason]) => {
console.log(`- ${node}: ${reason}`);
});
}
})
.catch((error) => {
console.error("Error in example usage:", error);
});
Here's a neat little tip: since this script is built on the same core logic as the tools that fetch Hive mainnet node lists, you can actually use it to grab those as well!
If you tweak the example code and, instead of flowerengine
, you pass in nectarflower
as the account name to the updateNodesFromAccount function, it will fetch and display the list of Hive mainnet nodes.
// To get Hive mainnet nodes instead:
updateNodesFromAccount("nectarflower") // Just change the account name here!
.then(({ nodes, failing_nodes }) => {
console.log("\nHive mainnet nodes:");
nodes.forEach((node, idx) => console.log(`${idx + 1}. ${node}`));
// ... (rest of the example code for handling failing_nodes)
})
.catch((error) => {
console.error("Error fetching Hive mainnet nodes:", error);
});
So, with a tiny modification, it can pull double duty! Here's how that output might look:
The code is available on GitHub:
https://github.com/TheCrazyGM/flowerengine-js
So, if you need a quick way to grab an updated list of Hive-Engine nodes or even just the Hive nodes in your JavaScript projects or scripts without any extra bells and whistles, this might be handy for you!
As always,
Michael Garcia a.k.a. TheCrazyGM
Tried it it, it works as advertised !LOLZ
git clone https://github.com/TheCrazyGM/flowerengine-js
cd flowerengine-js/
npm i
node example-usage.js
@tipu curate
Upvoted π (Mana: 65/75) Liquid rewards.
lolztoken.com
I just knew she was a keeper.
Credit: reddit
@thecrazygm, I sent you an $LOLZ on behalf of ervin-lemark
(1/4)
Farm LOLZ tokens when you Delegate Hive or Hive Tokens.
Click to delegate: 10 - 20 - 50 - 100 HP
Future Hive devs are going to appreciate these incredible tools and frameworks immensely, of that I'm sure! I know that they appreciate them now, too, but Hive is going to be better because of you, and for that I'm deeply grateful, thank you! π π π β¨ π€
Hey there, nice to see you keep going...
Can you provide a debug flag to show the output received (will be useful for debugging things for others).
For example, I am trying to do it from my internal network, and I am having:
And I am pretty sure I have a JSON output... but would love to understand why it is giving it from my internal network. Especially because sometimes we have other services, "like cloudflare" in the middle that make things different.
I'll see what I can do to be more verbose on the failures, and I didn't even think about things like cloudflare, VERY likely suspect for some of those answers, I'll need to dig deeper, so better debug it is!
Let me know anything you find...
The next days for me are not going to be easy, but I will do what I can.
Amazing work, its all coming together now! I wonder, maybe we should make a "secret" page on the site for all these tools for developers?
!PAKX
!PIMP
!PIZZA
View or trade
PAKX
tokens.Use !PAKX command if you hold enough balance to call for a @pakx vote on worthy posts! More details available on PAKX Blog.
$PIZZA slices delivered:
ecoinstant tipped thecrazygm
@herman-german(3/15) tipped @thecrazygm
Come get MOONed!
Also a great tool.
But seems like you check he nodes with an domain only. We have a lot without as well! Might be good to add them as well?! Not sure so I let the decision up to you.
!BBH
!DIY
!PIZZA
I actually used the nodes listed on the https://beacon.peakd.com/ as a reference. I don't see any reason why it wouldn't work. The trick would just be having a reliable list of nodes somewhere.
Ahh okay good to know how you get the list.