Add a new endpoint to work as a more user-friendly /rchash
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
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
Also see #4849 .
would like to work on this! Could you please assign it to me?
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
There is a command in
swarm-clito address this:swarm-cli utility rchashWhile waiting, it displays a spinner with the current seconds, such as:
⬡ ⬢ ⬡ Running rchash 19sAnd 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.