Closed vojtechsimetka closed 2 years ago
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 5 days.
.
Would it make sense to assume block time to be one second and calculate the TTL based on that? @acud
would it be ok if we just adjust the API to return some answer which is >0
? there's some hardcoded values there that probably make the ttl calculation break. it would make our life easier to just somehow make sure that some reasonable output is guaranteed, rather than having configurable values
would work for me
Summary
In
bee dev
mode, I would like to see realistic TTL values for postage stamps. Right now it always returns-1
. Instead TTL could just be a difference betweentime bought
andrequest time
+amount
to/stamps
endpoint. The time bought could be stored inblockNumber
.Motivation
In the current form
bee dev
makes code that works with stamps a bit challenging. E.g. ingateway-proxy
we want to purchase new postage stamps when stamps become full or expire. I can imagine other applications (likebee-dashboard
or apps uploading to your own node) wanting this functionality (to test code that checks if stamp is usable before uploading).Implementation
blockNum
should return timestamp when the stamp was bought (in seconds) andbatchTTL
should return either positive difference betweenblockNum - currentTimestamp + amount
or-1
(also in seconds) .Drawbacks
Adds complexity to
dev
mode code.