new-computers / cabal

p2p forum software
24 stars 1 forks source link

basics #1

Open cblgh opened 6 years ago

cblgh commented 6 years ago

see cabal-club for the most recent developments of this project


recently we've seen a deluge of interesting ideas, topics and conversations around the p2p domain. i've been feeling the need for an accessible irc alternative, one that isn't hosted by a for-profit company.

i think making the software to organize ourselves will create the opportunity for a lot of interesting collaborations and birthing of projects

here's what i've been thinking with regard to basic features

using hyperdb we can make use of multi-writing to easily connect many peers together into a cohesive whole.

this has the interesting property that any authorized peer can in turn authorize and add other peers i.e. a kind of viral propagation, anyone in the cabal can add others to the cabal

let's collab on this, and see where we can take it together 👋

prior art

automerge/hypermerge substack/chatmesh jimpick/dat-multiwriter-web

cblgh commented 6 years ago

i had some ideas on the starting and joining of a cabal from an event-oriented perspective. i'll sketch them down below for future reference.

the invite-only flow is easier to implement as a first stop, and the introducer flow might look different depending on how glitch works

basic flows

invite-only (no introducer)

conspirator flow

uninitiated flow

uninitiated flow

callil commented 6 years ago

This is all really great @cblgh - I'm going to work on visualizing this flow through some wireframes. Will also take a stab at some of the high level organization.

I think we should dogfood as fast as possible! I'm REALLY interested in how we can make the chat as ready to use as possible.

neauoire commented 6 years ago

I've been looking at HyperDB and I don't really understand how I could go about and make a chat system with it. Is there a sort of proof-of-concept code somewhere around?

cblgh commented 6 years ago

@neauoire you can look at chatmesh, which i mentioned under prior art above. otherwise i'm going to write small examples in the same fashion as with cblgh/hypercore-examples but for hyperdb

@callil i completely agree about dogfooding! i was talking with @louiscenter and he brought up the counterpoint that we could also just setup a nice bouncer for irc and have people join that

regardless i think it would be nice to have infrastructure for people to easily setup a distributed slack alternative. it could optionally intertwine with the raspberry pi effort to ensure chat history availability / introducer peers

louiscenter commented 6 years ago

some more prior art: https://github.com/mafintosh/hyperirc

if cabal aims to be a chat client/slack alternative, maybe there's a way of finding a nice way to marry pre-existing protocols that do chat really well (irc, matrix, ssb), and the dat protocol, which is why I found the hyperirc repo above interesting.

I wonder if there are already bouncer like apps floating around on glitch that could be forked in taken in the direction that you're after?

saranrapjs commented 6 years ago

this is a really cool idea. something that chatmesh requires (which, as I understand it, is required by multi-writer hyperdb) is explicit authorization by whoever originates the hyperdb. this means that unless the an already-authorized writer to the hyperdb is available to authorize, peers can't authorize themselves to write to the hyperdb. this might not be a problem for some of the conspirator/uninitiated flows described here, but i'd be curious if there are ways to make hyperdb work more like IRC for certain use cases — e.g. allow any participant in a swarm for a specific public key or cabal (discovery key?) auto-authorize themselves for writing without needing to communicate with an already-authorized writer?

kodedninja commented 6 years ago

Maybe a workaround for that would be a centralized server running somewhere that has write access to hyperdb and you would get access through that.

cblgh commented 6 years ago

@saranrapjs i dug into chatmesh today and i think as long as we have one (or many) bot/service peers running then we can get something more like IRC! (i.e. no explicit authorization needed) a cabal <->irc bridge, built on hyperirc from above, would also be cool!

(i have a hard time seeing self auto-authorization working without some kind of peer being online, though)

joehand commented 6 years ago

Extremely excited for this!!! 😍

Definitely check out @jimpick's demo on hyperdb! It's not a chat application but should show a good implementation of hyperdb: https://dat-multiwriter-web.glitch.me/.

He should be writing up a blog post on it soon! Related, Jim has thought a lot about auto-authorization as well.

Other random prior art (related to hyperirc):

kodedninja commented 6 years ago

How would this be structured, by the way?

One archive per channel (dat://channel-1.newcomputers.group) or one archive per channel (dat://cabal.newcomputers.group/channel).

Chatmesh uses the first structure which is a lot more simple to work with, but maybe the second one is better for UX.

cblgh commented 6 years ago

alright, i got the ball rolling! first out is a small introduction to hyperdb that i made to explore what i'll be needing for the backend

check it out at cblgh/hyperdb-examples

@kodedninja many channels per hyperdb! so following your example that would be dat://cabal.newcomputers.group/channel

kodedninja commented 6 years ago

Great!

cblgh commented 6 years ago

oh hey so i've been working on this here and there and have something really basic working

i took a bit of a break to learn streams so that i could work with hyperdb's stream-based methods with minimal headscratching.

right now this a terminal only app, but the structure is such that you can swap out the frontend (currently it's console.log-based with hacky screen-clearing) for a blessed frontend, or a choo app compiled for browsers

okdistribute commented 6 years ago

hey @cblgh , chatmesh doesn't have channels right now but I think it should include them. So you could think of a dat link as an equivalent to a 'server' in IRC or a team in Slack.

cblgh commented 6 years ago

i pushed up the code if anyone wants to have a look

neauoire commented 6 years ago

Having a look

neauoire commented 6 years ago

It's giving me a Error: Cannot find module 'datland-swarm-defaults'.

neauoire commented 6 years ago

Once I add it to the package, it works I think?

auto authorization is: on
db ready!
db key is
     ca0281a65bdc5003463a59771154bc5870b7c835bf541199e75ae3b8db47bde0

Do you have a client? I seem to see some client-lookish files, but node interface.js doesn't do anything.

cblgh commented 6 years ago

yeah sorry, usage is a bit rough still but to start do node index.js --db db1 --nick neauoire

then in another window use the db key that's printed out node index.js --db db2 --key <key> --nick conspirator

chat with .chat <msg> and see input.js for other commands

but ya, it's a rough!

neauoire commented 6 years ago

Ah! Okay :) Thanks, I'll try that.

kodedninja commented 6 years ago

Trying out. Could you add at least some basic description of commands? It's pretty messy right now :smile:

cblgh commented 6 years ago

sure! the useful commands for testing it out are

.chat <msg>
.change <channel name> switch channel
.nick <nick> change nick .list print a channel listing

i have a session running at --key dat://21b2b9ff201b01e6081709d82e6b81a5cf3a68d2cd5f092d0ffec58772642892 it'd be cool to see if anyone can connect to it (:

cblgh commented 6 years ago

@kodedninja and i were just chatting over cabal! 😀

callil commented 6 years ago

Omg so excited to do this! On Sun, May 13, 2018 at 12:44 Alexander Cobleigh notifications@github.com wrote:

@kodedninja https://github.com/kodedninja and i were just chatting over cabal! 😀

hit us up using node index.js --db db1 --key dd7e3803282ee50e70d8c6800c9df5601edeebadedbe1cbfa49ccad2a042ec9f --nick

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub , or mute the thread .
cblgh commented 6 years ago

@neauoire i know you're busy with voyage prep, but, would it be possible for you to create a tiny blessed client that implements the api in simple-screen.js?

with a baseline blessed client i could continue development from there!

urcades commented 6 years ago

hi there!

Had tried joining the chat at the last listed key, and receive this:

Error: Another hypercore is stored here

Is there a way to clear previously-used dbs?

cblgh commented 6 years ago

@edouerd yeah, you just delete the old one! (e.g. rm -r db1 if db1 was the name of your old db) you could also specify a new db using --db db2. looks like you solved it though because i saw your message in cabal! 😀

neauoire commented 6 years ago

on it :) I still have a week to complete projects and stuff. I'll dedicate some time to this today.

cblgh commented 6 years ago

@neauoire ahh! that's great!

cblgh commented 6 years ago

for anyone following along: chatmesh and cabal have merged together to create cabal-club!

come talk to us in dat://21b2b9ff201b01e6081709d82e6b81a5cf3a68d2cd5f092d0ffec58772642892

the ui on cabal-desktop (built with electron) needs design & ui love, and the command line client would love new commands and functionality

🖤