dat-ecosystem-archive / dat-node

Node module for creating dat compatible tools on file systems [ DEPRECATED - More info on active projects and modules at https://dat-ecosystem.org/ ]
https://dat.foundation
MIT License
503 stars 64 forks source link

Feature Request: DEP-0006 Session Data Support in NodeJS #225

Closed D1plo1d closed 4 years ago

D1plo1d commented 5 years ago

I am reporting:

Beaker supports Dep-0006 as a method for broadcasting data between peers. This is useful for peer discovery if both peers are using Beaker. In trying to control a farm of 3D printers from Beaker I have stumbled upon a use case where one peer is using Beaker (the client) and connected to a dat single page app and the other peers are running dat-node (in my case: each 3D printer is a dat-node peer running on a raspberry pi).

How could I send and receive session data from dat-node to a Beaker peer?

https://www.datprotocol.com/deps/0006-session-data-extension/ https://beakerbrowser.com/docs/apis/experimental-datpeers

RangerMauve commented 5 years ago

I tried adding it to the Beaker browser version of node: https://github.com/beakerbrowser/dat-node/pull/6

But I've been having some trouble getting it to work. It might be worth it to start from where I left off if this is something you want.

D1plo1d commented 5 years ago

@RangerMauve That's awesome, thanks for putting this together. It sounds like the beaker to node-dat peers that you have working already may be enough for what I'm trying to do. And if not I'll make sure to share anything I manage to figure out. Cheers!

okdistribute commented 4 years ago

You can create session data with hypercore-protocol extensions. This is accessible through the dat-sdk or with hypercore-protocol directly. See https://github.com/cabal-club/cabal-core/ for an example of this.