bee-js icon indicating copy to clipboard operation
bee-js copied to clipboard

fix `createPostageBatch` function arguments in the README & testcases

Open rampall opened this issue 9 months ago • 5 comments

createPostageBatch function arguments in the README & testcases need to be fixed / updated with realistic values that can be used as reference

image

image

rampall avatar May 07 '24 15:05 rampall

What is realistic value as reference? I am thinking about a week for expiry, with depth=24 (44GB) could work.

agazso avatar May 07 '24 16:05 agazso

According to this page: https://www.ethswarm.org/get-bzz

The current price 0.3331 BZZ for 1GB per month. So with the proposed values it would cost (44 * 0.3331 / 4) = 3.6641 BZZ, that is at today's price is about 1.47 USD, which I think is reasonable for testing.

agazso avatar May 08 '24 10:05 agazso

What is realistic value as reference? I am thinking about a week for expiry, with depth=24 (44GB) could work.

Depth 20 would be sufficient. But the amounts in the examples ('2000' and '100') are too low for the stamp purchase to succeed irl. The amount has to have a TTL of more than a day for a successful purchase. So approximately any amount > 500000000 By "realisitic" - I mean a realistic minimum value that works :)

rampall avatar May 08 '24 11:05 rampall

The actual minimum amount is affected by the storage price when the stamp batch is purchased. So if the price continues to go up, the amount will need to track. Therefore, it is tricky to document a "minimum" that "works" when the future is unknown. image image

Maybe we need a new /stamps API that provides the actual current minimums given the current swarm conditions?

ldeffenb avatar May 08 '24 12:05 ldeffenb

True. Valid point!

The calculator widget in the bee docs calculates the minimum amount by taking the price from swarmscan api and multiplies it by 17280 (24 x 60 x 60 / 5) assuming a gnosis blocktime of 5 seconds.

  • https://github.com/ethersphere/bee-docs/blob/0672e1d097198899d093f4eb6aefd62a3aa4cde5/src/components/VolumeAndDurationCalc.js#L93

rampall avatar May 09 '24 21:05 rampall