bee icon indicating copy to clipboard operation
bee copied to clipboard

Add a new endpoint to work as a more user-friendly /rchash

Open NoahMaizels opened this issue 7 months ago • 2 comments

Summary

Currently we ask users to check their machine's performance to make sure it has sufficient specs to generate a hash in time by generating a sample using rchash by filling in these parameters themselves:

/rchash/{depth}/{anchor_01}/{anchor_02}

The specific requirements for the parameters have changed multiple times, leading to a lot of confusion. Even without the confusion, they still need to manually check the depth and overlay and fill those in. It would be trivial to add a new endpoint which performs a test sample with the values automatically calculated for the user, something like:

GET `/sampler`

It would also be ideal that the sampler responds with information besides just the sampler time such as "OK - sample was calculated in sufficient time" / "WARNING - sample calculation went overtime, node will not be able to participate in redistribution properly"

Ideally there would also be some endpoint for running a full diagnostic that also checks other hardware and network performance aspects but that's out of the scope of this issue.

Motivation

Easier UX, allows for simpler user experience and allows for the documentation to be simplified.

Implementation

Drawbacks

NoahMaizels avatar May 05 '25 08:05 NoahMaizels

It might make more sense to just have this in bee-js or swarm-cli and leave it as is in Bee?

See swarm-cli issue https://github.com/ethersphere/swarm-cli/issues/592

NoahMaizels avatar May 12 '25 12:05 NoahMaizels

Also see #4849 .

crtahlin avatar May 13 '25 10:05 crtahlin

would like to work on this! Could you please assign it to me?

rose2221 avatar Jun 23 '25 16:06 rose2221

There is a command in swarm-cli to address this:

swarm-cli utility rchash

While waiting, it displays a spinner with the current seconds, such as:

⬡ ⬢ ⬡ Running rchash 19s

And prints at the end:

Reserve sampling duration: 99.754114666 seconds

Cafe137 avatar Jun 26 '25 00:06 Cafe137

There is a command in swarm-cli to address this:

swarm-cli utility rchash

While waiting, it displays a spinner with the current seconds, such as:

⬡ ⬢ ⬡ Running rchash 19s

And prints at the end:

Reserve sampling duration: 99.754114666 seconds

Oh I wasn't aware of this! That's perfect, I think no other changes needed in that case.

NoahMaizels avatar Sep 03 '25 16:09 NoahMaizels