decentraland / bronzeage-node

DEPRECATED: This codebase will not be mantained anymore, and formats are going to change when we move to the Decentraland Iron Age
https://decentraland.org
Other
104 stars 22 forks source link

Pinning IPFS files will reduce latency #79

Open ghost opened 7 years ago

ghost commented 7 years ago

The node will soon switch to using IPFS for content distribution #78. The default IPFS behavior caches files for a short time, but eventually deletes them. This means they will need to be redownloaded the next time they're used. There is a pinning feature that keeps files local permanently.

Pinning IPFS files will reduce latency.

Suggested by @HPrivakos.

ghost commented 7 years ago

Some discussion of pinning here. https://ipfs.io/ipfs/QmNZiPk974vDsPmQii3YbrMKfi12KTSNM7XMiYyiea4VYZ/example#/ipfs/QmP8WUPq2braGQ8iZjJ6w9di6mzgoTWyRLayrMRjjDoyGr/pinning/readme.md

ghost commented 7 years ago

Unfortunately the IPFS nodejs module doesn't seem to support pinning.

https://github.com/ipfs/js-ipfs#pin-not-implemented-yet

pin (not implemented, yet!)

There is an open issue here with some work on it. Possibly we should get into that and finish it to make this possible. https://github.com/ipfs/js-ipfs/pull/107

ghost commented 7 years ago

Wonder if it's pinned automatically when we do the add. The command line tool seems to work that way.

https://www.reddit.com/r/ipfs/comments/69l1y8/does_ipfs_add_automatically_pin/

Notice the Default: true. at the end of the line. That means that by default, you do pin when you add.