Git-ssb experiences (Git on Secure Scuttlebutt)

Here is my setup from scratch in case you want to follow it:

1. Install scuttlebot

npm install -g scuttlebot

Start the server with param to handle large blobs

sbot server --blobs.max 10000000

Alternatively, create default config (or add to existin) so can handle large blobs by adding {“blobs”:{“max”:10000000}}

sbot server

View my id

sbot whoami

Add a pub server from the list

Visit the list: Pub Servers · ssbc/ssb-server Wiki · GitHub
Click on the web link and accept the invite using sbot invite.accept

sbot invite.accept <invite-code>

3. Install ssb-npm-registry plugin

Might need to wait for the sbot server to run for a bit before trying this. Eventually it worked, but by then I did the following in stages, inserting the $id value into the second line:

id="$(sbot links2.read --query '[{"$filter":{"rel":["mentions",{"$prefix":"npm:ssb-npm-registry:"}]}}, {"$map":"dest"} ]'|grep -o '&.*sha256'|tail -n 1)"
sbot plugins.install ssb-npm-registry --from "http://localhost:8989/blobs/get/$id"
sbot plugins.enable ssb-npm-registry

Then restart sbot

After some fails I re-did the the first two lines in stages, assigning id, then echo $id and adding it to the command to do:

sbot plugins.install ssb-npm-registry --from "http://localhost:8989/blobs/get/&XNVccB01y7Ts9/j/+kbbFbfqfKJuyTWBkZSnhccugf4=.sha256"

Installing “ssb-npm-registry”…
+ ssb-npm-registry@1.0.0
added 1 package in 184.441s
“ssb-npm-registry” has been installed. Restart Scuttlebot server to enable the plugin

:slight_smile:

sbot plugins.enable ssb-npm-registry # restart sbot

4. Install ssb-private plugin

sbot plugins.install ssb-private

Installing “ssb-private”…

> sodium-native@2.1.6 install /tmp/ssb-private/node_modules/ssb-private/node_modules/sodium-native
> node-gyp-build “node preinstall.js” “node postinstall.js”

> leveldown@3.0.2 install /tmp/ssb-private/node_modules/ssb-private/node_modules/leveldown
> prebuild-install || node-gyp rebuild

> level@3.0.2 postinstall /tmp/ssb-private/node_modules/ssb-private/node_modules/level
> opencollective-postinstall || exit 0

Thank you for using level!
If you rely on this package, please consider supporting our open collective:
> https:opencollective.com/level/donate//

+ ssb-private@0.2.1
added 123 packages in 22.903s
“ssb-private” has been installed. Restart Scuttlebot server to enable the plugin.

5. Install git-ssb

npm install -g git-ssb --registry=http://localhost:8043/

Tests

Publish an existing local git repo

cd ~/src/safe/safe-cli-boilerplate
git ssb create ssb safe-cli-boilerplate

Created repo: ssb://%oaVPNcXmxQ0jb0+5jLDMW7q9U+/q5G8YmYqc49I4Z0g=.sha256 (safe-cli-boilerplate)
Added remote: ssb

git push --tags ssb master

Counting objects: 49, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (49/49), done.
Writing objects: 100% (49/49), 45.85 KiB | 0 bytes/s, done.
Total 49 (delta 24), reused 0 (delta 0)
Decoding objects: 100% (49/49)
Published %vo9NgflX47GzUQFbmBna0FA/G6qGmGw3s5LaJX0IWLw=.sha256
Pushing blobs…
To ssb:%oaVPNcXmxQ0jb0+5jLDMW7q9U+/q5G8YmYqc49I4Z0g=.sha256//
* [new branch] master → master
* [new tag] v0.0.1 → v0.0.1

Clone it

cd ~/safe
git clone ssb://%oaVPNcXmxQ0jb0+5jLDMW7q9U+/q5G8YmYqc49I4Z0g=.sha256  ssb-test-repo-clone

Cloning into ‘ssb-test-repo-clone’…
Receiving objects: 100% (49/49), 45.85 KiB | 0 bytes/s, done.
Resolving deltas: 100% (24/24), done.
Checking connectivity… done.

Fork a git-ssb repo you have already cloned:

NOT TRIED YET:

cd ~/safe/ssb-test-repo-clone
git ssb fork mine
# edit and commit, then push changes:
git push mine

Run the web server for browsing repos:

git ssb web

By the way, patchwork seems to be working, just taking forever (hours) to sync, but it has set my nick as happybeing here.

4 Likes