yusefnapora / w3name-rust-client

Other
2 stars 1 forks source link

TTL? #33

Open tennox opened 1 week ago

tennox commented 1 week ago

Thanks for this great lib & cli :+1: (using it in e.g. https://gitlab.com/txlab/ci-templates/-/blob/main/web3-docs.md).

One question: What about TTL? The spec says:

4.1.5 TTL (uint64)

A hint for how long (in nanoseconds) the record should be cached before going back to, for instance the DHT, in order to check if it has been updated. The function and trade-offs of this value are analogous to the TTL of DNS record.
Implementations MUST include this value inside the DAG-CBOR document at IpnsEntry.data[TTL].
Suggested default: 1 hour (3 600 000 000 000 nanoseconds).

While w3name's JS lib generates records with ~31 days :eyes:

This lib&cli doesn't seem to set a TTL, as far as I can tell :thinking:

When I try to decode the record (would be great to have a CLI option), there is a TTL of about a year

tennox commented 1 week ago

Started a draft PR adding TTL https://github.com/yusefnapora/w3name-rust-client/pull/34