Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

Rate Limiter

Demo of the p/moul/x/daily/ratelimit library — an on-chain token-bucket limiter (port of golang.org/x/time/rate).

Config

Parameter Value
Rate (tokens/block) 0.5
Burst (capacity) 5
Clock height 165611

Callers

No caller has hit the limiter yet.


Call Allow(cur) to consume a token; read Tokens(addr) for a caller's balance.