Git Product home page Git Product logo

scuttlebot-ws's Introduction

scuttlebot-ws

A socket.io WebSocket wrapper for scuttlebot

Install

npm install

Plans

I created this app in order to allow for an sbot instance on a raspberry-pi to be usable by a webapp on my phone. This is an express server with three websocket channels (so far):

  • user-stream
  • feed-stream
  • log-stream

Remaining tasks

Retrieve history

The websocket channels allow any incoming messages to be available to a listening app in real-time. The next step is to ensure some number of previous messages to be made available. This can also be done using streams via a websocket channel, but this needs to be implemented.

Authentication

Webapp clients will be run from anywhere given the increasing use of p2p technologies such as ssb, IPFS, and Dat. Communication between these client instances and this server need to be secured via authentication.

Storage considerations

The plan is to run this server (and sbot) on a Raspberri Pi. But sbot by default writes the entire feed of a user to ~/.ssb (on Linux and OSX). This directory can easily and quickly reach multiple gigabytes, which is a problem on single board computers (SBCs). There are some possible solutions for this:

  • emit older messages to clients without saving to disk
    • periodically prune saved messages
  • mount ~/.ssb to an external mount point
  • limit the amount of historic messages retrieved by default

scuttlebot-ws's People

Contributors

vuldin avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

scuttlebot-ws's Issues

Off-Internet nodes with laptop clients

I am hoping to use this for a workshop, using this as the base OS on Raspberry Pi 3. The network is created ad-hoc and completely isolated from the Internet, with nodes communicating over cjdns tun interfaces. I have a couple questions:

  1. I cannot npm install since the nodes are not on the Internet, so I am thinking to pre-build a docker image of this based on https://github.com/nodejs/docker-node/blob/master/9/alpine/Dockerfile and place it into every node's home dir (docker-ce is already on each node). Do you think this will work?

  2. Clients are connected to the Raspberry Pi access point, how can we expect them to interact with the sbot websocket? I would like two interactions:

    • From a laptop client, command line interface to send and receive messages to the Raspberry Pi mDNS address (e.g. bloor.local) with similar syntax as what you would do from the Raspberry Pi SSH session: sbot publish --type post --text "Hello, world!"

    • From a laptop client, browse to their mDNS address (e.g. http://bloor.local) and have a UI similar to Patchwork / Patchbay / Patchfoo

Storage is not really a concern since these nodes are only active for the duration of the workshop, the ramdisk filesystem is backed by 6 GB of SD card space, and will be reset upon power cycle.

Please close if Issues is not the right place for questions.

cc. @ansuz @jkms

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.