Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

basics #1

Open
1 of 4 tasks
cblgh opened this issue Apr 25, 2018 · 30 comments
Open
1 of 4 tasks

basics #1

cblgh opened this issue Apr 25, 2018 · 30 comments

Comments

@cblgh
Copy link
Collaborator

@cblgh cblgh commented Apr 25, 2018

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

  • channels
  • theming (c.f. @neauoire's cohesive themes for inspiration)
  • choo frontend
  • introducer peers (tiny http api endpoints, to allow for automatic introductions. self-hosted or on glitch)

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
Copy link
Collaborator Author

@cblgh cblgh commented Apr 25, 2018

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

  • create cabal
  • get cabal key
  • send cabal key to potential, uninitiated conspirators

uninitiated flow

  • uninitiated enters cabal key
  • uninitiated gets invite key, sends to a conspirator
  • conspirator adds invite key
  • uninitiated is now authorized, and elevated to conspirator

introducer

conspirator flow

  • create cabal
    • introducer service is started
    • introducer's invite key is added to cabal
    • introducer is now allowed to elevate uninitiated peers to conspirators
  • get cabal key

uninitiated flow

  • uninitiated enters cabal key
    • invite key is generated and sent to introducer via api
    • introducer adds invite key, uninitiated is elevated to conspirator

@callil
Copy link

@callil callil commented Apr 25, 2018

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
Copy link

@neauoire neauoire commented Apr 25, 2018

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
Copy link
Collaborator Author

@cblgh cblgh commented Apr 25, 2018

@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
Copy link

@louiscenter louiscenter commented Apr 25, 2018

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
Copy link

@saranrapjs saranrapjs commented Apr 26, 2018

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
Copy link
Contributor

@kodedninja kodedninja commented Apr 26, 2018

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
Copy link
Collaborator Author

@cblgh cblgh commented Apr 26, 2018

@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
Copy link

@joehand joehand commented Apr 27, 2018

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
Copy link
Contributor

@kodedninja kodedninja commented Apr 27, 2018

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
Copy link
Collaborator Author

@cblgh cblgh commented May 1, 2018

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
Copy link
Contributor

@kodedninja kodedninja commented May 2, 2018

Great!

@cblgh
Copy link
Collaborator Author

@cblgh cblgh commented May 12, 2018

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
Copy link

@okdistribute okdistribute commented May 12, 2018

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
Copy link
Collaborator Author

@cblgh cblgh commented May 12, 2018

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

@neauoire
Copy link

@neauoire neauoire commented May 12, 2018

Having a look

@neauoire
Copy link

@neauoire neauoire commented May 12, 2018

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

@neauoire
Copy link

@neauoire neauoire commented May 12, 2018

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
Copy link
Collaborator Author

@cblgh cblgh commented May 12, 2018

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
Copy link

@neauoire neauoire commented May 12, 2018

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

@kodedninja
Copy link
Contributor

@kodedninja kodedninja commented May 13, 2018

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

@cblgh
Copy link
Collaborator Author

@cblgh cblgh commented May 13, 2018

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
Copy link
Collaborator Author

@cblgh cblgh commented May 13, 2018

@kodedninja and i were just chatting over cabal! 😀

@callil
Copy link

@callil callil commented May 13, 2018

@cblgh
Copy link
Collaborator Author

@cblgh cblgh commented May 13, 2018

@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
Copy link

@urcades urcades commented May 13, 2018

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
Copy link
Collaborator Author

@cblgh cblgh commented May 13, 2018

@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
Copy link

@neauoire neauoire commented May 14, 2018

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

@cblgh
Copy link
Collaborator Author

@cblgh cblgh commented May 14, 2018

@neauoire ahh! that's great!

@cblgh
Copy link
Collaborator Author

@cblgh cblgh commented May 19, 2018

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

🖤

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants