I suspect the problem is the lazy-loaded nature of IPFS implementation in Brave.
In sumple terms, DHT expires records after 24h (we are in the process of raising that to 48h).
This means IPNS record needs to be republished at least once a day.
Potential problem: Brave starts IPFS node on-demand, when ipfs:// URI is requested.
If you closed your browser, and opened it again but never interacted with IPFS, you will have no daemon running until you trigger it's launch, eg. by opening ipfs:// or ipns:// again.
This means your IPNS record will expire because your IPNS node is not running to re-announce it.
Steps to Reproduce
Publish something to IPNS
Close Brave
Start Brave
Wait a day without using IPFS
Try to resolve IPNS address
Actual result:
IPNS does not resolve, no valid record is found.
Expected result:
Published IPNS resolves.
Reproduces how often:
Every time.
Desktop Brave version:
v1.46.153 (Jan 6, 2023)
Potential ways to fix
The only proper fix is to run IPFS node.
If Brave wants to keep lazy-loaded default, I propose we detect when IPFS node has published to IPNS, or pinned some data, and in such case ALWAYS run it.
This check could be run asynchronously when Brave starts and user previouslu enabled local node.
How to detect IPNS was used for publishing
You can detect when IPNS was used by enumerating local keys (ipfs key list -l and trying to resolve each locally, without asking other peers (ipfs name resolve k....keyhash --offline).
All should error.
If any of the keys resolves over IPNS to /ipfs/.. then we need to always run the node.
How to detect when user pinned any data
low level pins can be inspected by ipfs pin ls --type=recursive
If list is longer than 2, means user pinned own data, and we need to run the node
MFS ("Files" screen from ipfs-webui) can be enumerated via ipfs files ls
If ls returns any items, means user pinned data, and we need to run the node
Description
I suspect the problem is the lazy-loaded nature of IPFS implementation in Brave.
In sumple terms, DHT expires records after 24h (we are in the process of raising that to 48h). This means IPNS record needs to be republished at least once a day.
Potential problem: Brave starts IPFS node on-demand, when
ipfs://
URI is requested.If you closed your browser, and opened it again but never interacted with IPFS, you will have no daemon running until you trigger it's launch, eg. by opening
ipfs://
oripns://
again.This means your IPNS record will expire because your IPNS node is not running to re-announce it.
Steps to Reproduce
Actual result:
IPNS does not resolve, no valid record is found.
Expected result:
Published IPNS resolves.
Reproduces how often:
Every time.
Desktop Brave version:
v1.46.153 (Jan 6, 2023)
Potential ways to fix
The only proper fix is to run IPFS node.
If Brave wants to keep lazy-loaded default, I propose we detect when IPFS node has published to IPNS, or pinned some data, and in such case ALWAYS run it.
This check could be run asynchronously when Brave starts and user previouslu enabled local node.
How to detect IPNS was used for publishing
You can detect when IPNS was used by enumerating local keys (
ipfs key list -l
and trying to resolve each locally, without asking other peers (ipfs name resolve k....keyhash --offline
). All should error.If any of the keys resolves over IPNS to
/ipfs/..
then we need to always run the node.How to detect when user pinned any data
ipfs pin ls --type=recursive
ipfs files ls
ls
returns any items, means user pinned data, and we need to run the nodecc @cypt4 @unicomp21 @autonome