I built something that lets you import Node modules from BitTorrent. It's weird. https://gitlab.com/EvanHahn/node-torrent-import
#Node #NodeJS #JavaScript #BitTorrent #decentralization #programming
@lutindiscret @mauve @dat_ecosystem @ninabreznik I'd love to try building a similar idea for Dat but don't know much about it. Is there a way to refer to a file by some immutable ID, like BitTorrent does?
@EvanHahn @lutindiscret @mauve @ninabreznik
The main mechanism is to refer to a file based on pubkey + version.
The pubkey refers to the "filesystem" containing the file. The version is a number between 0 and latest which refers to the exact point in time.
If you have the merkle root hash for that specific filesystem version or the specific file hash, you can later verify that the file has not been tampered with.
This is app/usecase specific
@EvanHahn @lutindiscret @mauve @ninabreznik
Dat started out to build "git for any data".
version controlled torrents authors can update over time. This is what dat is good for and was intended to do when it started as a project in 2013.
@dat_ecosystem Is there good example code for this? My dream would be something like:
let publicKey = "abc123"
let version = 456
let data = await dat.download(publicKey, version)
Is there something like that? Or would I need to build that myself (using Hyperdrive)?
@EvanHahn @dat_ecosystem yeah check out hyper-sdk. The p2p stufd can be a pain to set up for browsers tho
@EvanHahn That's awesome! As dat_ecosystem mentioned, we in the community usually use a different URL scheme. Have you seen my web browser that loads p2p URLs (including JS) natively? @agregore
I also have a cli environment which supports p2p web apis that might be relevant: https://github.com/AgregoreWeb/agregore-cli
@mauve I have not...this is neat! agregore-cli seems very similar to my idea, but better.