An onboarding mini-app - gets you all set up, and caught up on the gossip before you set out on your adventure
You currently need to be on the same network as another peer (this version has to start with local peer recplication)
// index.js
const ahoy = require('ssb-ahoy')
const Config = require('ssb-config/inject')
const plugins = [
'ssb-legacy-conn',
'ssb-replicate',
'ssb-friends',
'ssb-invite',
'ssb-private',
'ssb-backlinks',
'ssb-about',
'ssb-query',
'ssb-suggest'
]
ahoy(
{
title: 'Patchbay',
config: Config('ssb-test-account'),
plugins,
uiPath: './app.js' // entry point to your main app
},
(state) => {
console.log('welcome aboard')
console.log(state)
}
)
// package.json
{
"scripts": {
"start": "electron index.js"
}
}
NOTE: if you set AHOY=true
then ssb-ahoy
will open up regardless of whether you're "set up"
opts
Object
title
- String (optional) the title to be attached to the visible windowconfig
- Object valid config for starting and connecting to anssb-server
, see ssb-config. Must include keysplugins
- Array (optional) a list of the names of plugins you'd like to get ahoy to run indexes of for youuiPath
- String string which points to the ui entry point of your app. This is expected to be a function and will be passed a copy of theconfig
(so it can connect to the server that's been started!)appDir
- String (optional) the relative path to your app root from the ssb-ahoy module. Generally just don't touch this, you don't want to know
onReady
- a callback which is run after ahoy hands over to your main app. Is passed some state data, e.g. windows
(ui, server)
Note at the moment moment ssb-ahoy
is running the main electron instance.
We can't seem to easily quit out of it and launch pour own e.g. patchbay, using that electron... which would seem more ideal.
Currently just hacking it so that app.quit()
is not called, and patchbay uses ahoy's electron ...
-
start with alternative configs
- find or create new identities
- see and edit
config
for an identity - block users from changing
caps.sign
if it's already set
-
option to skip skip ssb-ahoy
- based on some setting/ config somewhere
- based on account state (name, image, follows, seq)
-
set your name / image (if applicable)
-
first time replication + indexing (currently disabled)
- lets you follow peers on a local network
- shows you progress of replication and indexing
- let's your quit out and try jumping to the next app!
- get it working on Unix / Windows
- starts
- builds working installers
- ANY UI design + css !
- bonuses:
- names next to the local peers keys
- note that
lib/get-name
only looks for more recent self-set name. any more requires indexes
- note that
- only provide (next) button if know (based on
ssb-ebt
data) have all the data for all the feeds - split the replication into multiple stages
- names next to the local peers keys
Bonus:
executeJavascript
which only takes strings.
In terms of requiring plugins, this has meant some kinda nasty hacks so that ssb-ahoy doesn't have to maintain plugins.
You are likely to have problems if you try to symlink this module into place.
The solution is to set the opts.appDir
. e.g. if I have ~/projects/patchbay
and ~/projects/ssb-ahoy
, then after linking ssb-ahoy into patchbay, I would set appDir: '../patchbay'