New Tool: flowerengine-js - Get Your Hive-Engine Node List!

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.

What's 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.

How it Works & Example

It's pretty straightforward:

  1. It uses dhive to connect to a Hive API node.
  2. Fetches the account details for @flowerengine.
  3. Parses the json_metadata to extract the nodes and failing_nodes arrays.
  4. Prints this information for you.

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):
image.png

Short Example

// 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);
  });

image.png

A Little Extra: Hive Nodes Too!

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:
image.png

Where to Get It

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

2.16926415 BEE
6 comments

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

0.00924793 BEE
0.00000000 BEE

The first time I saw my future Wife was at the local Zoo.
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

0.00000000 BEE

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! 😁 πŸ™ πŸ’š ✨ πŸ€™

0.00512467 BEE

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:

- https://he.atexoras.com:2083: Not a valid hive-engine node: Client returned invalid format. Expected JSON!

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.

0.00236819 BEE

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!

0.00929532 BEE

Let me know anything you find...

The next days for me are not going to be easy, but I will do what I can.

0.00080710 BEE

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

0.00086127 BEE

View or trade PAKX tokens.

@ecoinstant, PAKX has voted the post by @thecrazygm. (1/1 calls)



Use !PAKX command if you hold enough balance to call for a @pakx vote on worthy posts! More details available on PAKX Blog.

0.00000000 BEE
(edited)

PIZZA!

$PIZZA slices delivered:
ecoinstant tipped thecrazygm
@herman-german(3/15) tipped @thecrazygm

Come get MOONed!

0.00084404 BEE

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

0.00000000 BEE

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.

0.00000000 BEE

Ahh okay good to know how you get the list.

0.00000000 BEE