Git-ssb experiences (Git on Secure Scuttlebutt)

Continuing the discussion from Can we haz GitSafe plz?:

@nice:
Indeed, this looks like a great model to inspire from, like Solid.

Edit : working :
ssb://%WfsR5FSKSufa3pRHSR6coTFanPLctBwMxjS2M4iDPdE=.sha256

How far did you get? (I can’t check the link for a while).

I got sbot and git-ssb working, but git-ssb-web crashes while displaying the first Web page (I get the blue header but not much else).

BTW I had forgotten about this:

@Jimmy_HUGUET are you there? Your time has come!

1 Like

It behaves the same for me. I found out that if you don’t reload the page, restart git-ssb web , then click on some repos, it will go ahead and from there it won’t crash more.

One should note that the github hosted version is quite outdated ( Nov 30, 2016 )

If you look at : https://git-ssb.celehner.com/ ( which is a http public ssb git service ) , you will see a few things :

The help on : GitHub - clehner/git-ssb: social coding on secure-scuttlebutt [migrated to git-ssb] did work nicely for me.

2 Likes

That’s where I got it all from - but they forgot to mention you also need the ssb-private plugin:

sbot plugins.install ssb-private

Now it works fine. The safe-cli-boilerplate repo is mine :grin:

And I can see your repo too now.

I can’t see how to give myself a nick though.

2 Likes

I created mine using GitHub - ssbc/patchwork: A decentralized messaging and sharing app built on top of Secure Scuttlebutt (SSB). , which seems to install sbot for you. Probably not as fresh as yours in fact.

2 Likes

mmm it seems there are some version discrepancies here and there.
I’m not sure what versions I have for all that stuff. npm can be quite misleading…

I think I broke everything :smiley: time for swiping off everything and start fresh again.

1 Like

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