git-ssb - decentralized hosting of git repositories

SSB ( Secure Scuttlebutt ) is a decentralized social network and the protocol it operates on. git-ssb wraps regular git repositories with this protocol. SSB wants to replace Facebook, and git-ssb wants to replace GitHub. Under the cut - a quick guide to git-ssb. Relevant for those who are uncomfortable with the very idea of ​​using centralized services as an intermediary. A kind of red pill with unexpected consequences in this case.





Secure scuttlebutt

The SSB protocol describes the rules for synchronizing your data between the nodes of the network interested in it. Your data is a history of your actions on the network, a linked list of json objects. The connection is set by the hash-sum of the previous object (as in the blockchain). Thus, once published, objects are immutable and non-removable. You can only add to the end of the list. A typical use case assumes that each item in the list is a blog post or comment. Pictures and other heavy objects are stored out of the list in the form of blobs and replicated separately. Objects in the list can refer to them.





Most of the netizens blog on the Patchwork and Manyverse apps . There are about a dozen blogging applications, they are mostly compatible with each other and differ in interface. In addition, there is chess, chat, package manager (ssb-npm) and git (git-ssb) . Some SSB developers use git-ssb as their main source control service. We will try too.





Install ssb-server and git-ssb

ssb-server is needed to synchronize with other nodes in the p2p network. It should be run when you push, pull, fetch, create a pull request, or fork a repository.





The git-ssb package includes:





  • program for managing repositories (git-ssb)





  • git-remote-helper , which understands addresses starting with ssb: //





  • web-, GitHub





ssb-server.





$ sudo apt install git nodejs npm
$ npm install ssb-server git-ssb
      
      



ssb-server git-ssb $HOME/node_modules



. , ~/.profile



:





if [ -d "$HOME/node_modules/.bin/" ] ; then
    PATH="$HOME/node_modules/.bin/:$PATH"
fi
      
      



$PATH



,





$ source ~/.profile
      
      



~/.profile



. (, Xfce) . $PATH



, .xsessionrc



~/.profile



:





. ~/.profile
      
      



ssb-server .





$ ssb-server start
      
      



identity ~/.ssb



.





, . , , . . , .





. , . . , .





$ ssb-server invite.accept <-->
      
      



: , - .





@cel

@cel - git-ssb.





$ ssb-server publish --type contact --contact "@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519" --following
      
      



~/.ssb



1Gb - ( git-) , . , .





. :





web-

$ git-ssb-web
      
      



, issue . , , , , . activity log, - , GitHub.





Git-ssb repository in git-ssb
git-ssb git-ssb

web- (, , issue ) . , : , issue ... ssb-server ( ) .





$ mkdir my-new-repo
$ cd my-new-repo
$ git init
Initialized empty Git repository in /tmp/my-new-repo/.git/

$ git-ssb create ssb my-new-repo
Created repo: ssb://<hash-code>.sha256 (my-new-repo)
Added remote: ssb

$ git remote -v
ssb    ssb://<hash-code>.sha256 (fetch)
ssb    ssb://<hash-code>.sha256 (push)
      
      



git init



git-ssb create ssb my-new-repo



, my-new-repo



URL remote ssb



. remote .





ssb remote . .





: - SSB. .





$ git push ssb master
      
      



, . git-ssb pack- blob, 5Mb. . , , :





$ git push ssb master -o allow-big
      
      



(blob ), pack- , blob.





pack- - , git- pack- 5Mb.





git-ssb git-ssb. SSB DNS . ssb://%n92DiQh7ietE+R+X/I403LQoyf2DtR3WQfCkDKlheQU=.sha256



web-.





$ git clone ssb://%n92DiQh7ietE+R+X/I403LQoyf2DtR3WQfCkDKlheQU=.sha256 git-ssb
$ cd git-ssb
$ git remote -v
origin    ssb://%n92DiQh7ietE+R+X/I403LQoyf2DtR3WQfCkDKlheQU=.sha256 (fetch)
origin    ssb://%n92DiQh7ietE+R+X/I403LQoyf2DtR3WQfCkDKlheQU=.sha256 (push)
      
      



remote, SSB.





$ git-ssb fork my-fork
Created repo: ssb://<new-hash-code>.sha256 (git-ssb)
Added remote: my-fork
$ git remote -v
my-fork    ssb://<new-hash-code>.sha256 (fetch)
my-fork    ssb://<new-hash-code>.sha256 (push)
origin    ssb://%n92DiQh7ietE+R+X/I403LQoyf2DtR3WQfCkDKlheQU=.sha256 (fetch)
origin    ssb://%n92DiQh7ietE+R+X/I403LQoyf2DtR3WQfCkDKlheQU=.sha256 (push)
      
      



, remote.





-

.





$ git-ssb pull-request
      
      



, . , .





, . (git-ssb-intro), . @-/master



(git checkout -b @-/master



), (git push ssb



), - (git ssb pull-request



). master -.





, identity ( identity - . ) . git-ssb , . . identity, , . , , . , - , .





Identity ~/.$ssb_appname/secret



. ssb_appname



, identity (~/.ssb



). secret



, ssb-server .





permissionless , , identity.





, : - , , sudo make install



. , - . , , git pull



. , .





SSB.





?

git-ssb-intro: a guide to hacking together on the distributed web





git:





  • GitTorrent ( BitTorrent)





  • HyperGit ( Dat)





  • igis-remote ( IPFS)





  • ipld-remote ( IPFS)





  • GitCenter ( ZeroNet)





  • Mango (Ethereum + IPFS)





  • Radicle





  • Gitopia





The first four are analyzed in detail in Daniel Aleksandersen's article " Four P2P distribution tools for Git repositories compared ". There are comments from the SSB developers to it.





Thanks for attention. Hope it wasn't too boring. Good decentralization to those who care.





The picture in the header was generated using the myoctocat.com service .








All Articles