aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CONTRIBUTING.md2
-rw-r--r--README.md36
-rwxr-xr-xgit-remote-gittorrent (renamed from git-remote-gitswarm)14
-rwxr-xr-xgittorrentd (renamed from gitswarmd)8
-rw-r--r--package.json16
5 files changed, 38 insertions, 38 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index d03620f..3c57709 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,4 +1,4 @@
-# GitSwarm is an OPEN Open Source Project
+# GitTorrent is an OPEN Open Source Project
Individuals making significant and valuable contributions are given commit-access to the project to contribute as they see fit. This project is more like an open wiki than a standard guarded open source project.
diff --git a/README.md b/README.md
index dee8beb..ec19272 100644
--- a/README.md
+++ b/README.md
@@ -1,26 +1,26 @@
-# ![GitSwarm](http://gitswarm.org)
+# ![GitTorrent](http://gittorrent.org)
### The Decentralization of GitHub
-**GitSwarm** is a peer-to-peer network of Git repositories being shared over BitTorrent.
+**GitTorrent** is a peer-to-peer network of Git repositories being shared over BitTorrent.
To get started:
```
-npm install gitswarm
+npm install gittorrent
```
After that, you can clone a repo with:
```
-git clone gitswarm://github.com/someuser/somerepo
+git clone gittorrent://github.com/someuser/somerepo
```
Or serve your own repos with:
```
touch somerepo/.git/git-daemon-export-ok
-gitswarmd
+gittorrentd
```
# Design
-The design of GitSwarm has five components:
+The design of GitTorrent has five components:
1. A "git transport helper" that knows how to download and unpack git objects, and can be used by Git itself to perform a fetch/clone/push.
1. A distributed hash table that advertises which git commits a node is willing to serve.
1. A BitTorrent protocol extension that negotiates sending a packfile with needed objects to a peer
@@ -31,28 +31,28 @@ The design of GitSwarm has five components:
When Git is asked to perform a network operation with a URL that starts with e.g. `someprotocol://`, it calls `git-remote-someprotocol` and passes the URL as an argument. The remote helper binary is responsible for telling Git what capabilities it has, receiving commands from Git, and downloading objects into the `.git/` directory.
-In GitSwarm's case, we could be asked for three styles of URL:
+In GitTorrent's case, we could be asked for three styles of URL:
* `gittorrent://some.git.hosting.site/somerepo` -- we connect over `git://` to find out what the latest commit is, then perform the download using that commit's sha1. This is kind of like a [CDN](CDN) for a git server; the actual download of objects happens via peers, but the lookup of which objects to downloads happens in the normal Git way.
-* `gitswarm://<hex sha1>/reponame` -- the sha1 corresponds to a gitswarm user's "mutable key" (hash of their public key) on our DHT -- we look up the key, receive JSON describing the user's repositories, and then perform the download using that commit's sha1. This doesn't use any resources outside of GitSwarm's network.
-* `gitswarm://<username>` -- the username is converted into a mutable key sha1 as above. The mapping from usernames to happens on Bitcoin's blockchain in OP_RETURN transaction.
+* `gittorrent://<hex sha1>/reponame` -- the sha1 corresponds to a gittorrent user's "mutable key" (hash of their public key) on our DHT -- we look up the key, receive JSON describing the user's repositories, and then perform the download using that commit's sha1. This doesn't use any resources outside of GitTorrent's network.
+* `gittorrent://<username>` -- the username is converted into a mutable key sha1 as above. The mapping from usernames to happens on Bitcoin's blockchain in OP_RETURN transaction.
## 2. Distributed hash table
-The bootstrap server for this DHT runs at `core.gitswarm.org:6881`. It is a bittorrent mainline DHT. Git SHA1s are announced by nodes who can create packfiles for them. The clients on this DHT support dht-store (BEP 44) and use it to store mutable keys.
+The bootstrap server for this DHT runs at `core.gittorrent.org:6881`. It is a bittorrent mainline DHT. Git SHA1s are announced by nodes who can create packfiles for them. The clients on this DHT support dht-store (BEP 44) and use it to store mutable keys.
## 3. Protocol extension
Once a client has connected to another node, it sends a request for the SHA1 it's looking for as bencoded JSON:
```
-{gitswarm: ask: "sha1"}
+{gittorrent: ask: "sha1"}
```
The node providing the packfile returns:
```
-{gitswarm: sendTorrent: "infoHash"}
+{gittorrent: sendTorrent: "infoHash"}
```
## 4. Key/value store
-BEP 44 adds support for *mutable* and *immutable* keys. Immutable keys are addressed by the hash of their content, but mutable keys are addressed by the hash of a crypto keypair's public key. The owner of that keypair publishes signed updates to their public key's hash, with a sequence number to ensure the latest value is always propagated by peers. The hash of the public key here is a GitSwarm user ID, and the value associated with that key is a JSON object describing the user's repositories in a User Profile.
+BEP 44 adds support for *mutable* and *immutable* keys. Immutable keys are addressed by the hash of their content, but mutable keys are addressed by the hash of a crypto keypair's public key. The owner of that keypair publishes signed updates to their public key's hash, with a sequence number to ensure the latest value is always propagated by peers. The hash of the public key here is a GitTorrent user ID, and the value associated with that key is a JSON object describing the user's repositories in a User Profile.
### User Profile JSON format
* name (string)
@@ -79,22 +79,22 @@ The idea of using OP_RETURN comes from telehash's blockname project, but while b
```
e.g.
```
-@gitswarm!cjb!81e24205d4bac8496d3e13282c90ead5045f09ea
+@gittorrent!cjb!81e24205d4bac8496d3e13282c90ead5045f09ea
```
-Note that OP_RETURN transactions are limited to 80 bytes, which limits usernames in this scheme to 29 bytes.
+Note that OP_RETURN transactions are limited to 80 bytes, which limits usernames in this scheme to 27 bytes.
-As a convenience, this repository will include a database of registered usernames that is updated regularly. This doesn't make GitSwarm any more centralized -- you can run the same scripts yourself on a downloaded blockchain to make sure that this repository does not lie. This is just to save everyone from downloading tens of gigabytes of blockchain to process.
+As a convenience, this repository will include a database of registered usernames that is updated regularly. This doesn't make GitTorrent any more centralized -- you can run the same scripts yourself on a downloaded blockchain to make sure that this repository does not lie. This is just to save everyone from downloading tens of gigabytes of blockchain to process.
By the way, storing full Bitcoin history is not necessary. We just need to scan every transaction once, and can discard each transaction after we've scanned it once and determined whether it contained a valid username registration that we record. We just need to scan through all unprocessed blockchain transactions once, and record where we got up to so that we don't have to look at them again after that.
## Contributing
-Please send pull requests! Even changes to the design of GitSwarm are welcome and encouraged; nothing is set in stone.
+Please send pull requests! Even changes to the design of GitTorrent are welcome and encouraged; nothing is set in stone.
#### JavaScript Standard Style
-GitSwarm uses [JavaScript Standard Style](https://github.com/feross/standard).
+GitTorrent uses [JavaScript Standard Style](https://github.com/feross/standard).
[![js-standard-style](https://raw.githubusercontent.com/feross/standard/master/badge.png)](https://github.com/feross/standard)
diff --git a/git-remote-gitswarm b/git-remote-gittorrent
index d39c567..a8bcb9d 100755
--- a/git-remote-gitswarm
+++ b/git-remote-gittorrent
@@ -7,7 +7,7 @@ var fs = require('fs')
var magnet = require('magnet-uri')
var spawn = require('child_process').spawn
var Swarm = require('bittorrent-swarm')
-var ut_gitswarm = require('ut_gitswarm')
+var ut_gittorrent = require('ut_gittorrent')
var WebTorrent = require('webtorrent')
function die (error) {
@@ -23,7 +23,7 @@ var dht = new DHT({
})
var url = process.argv[3]
-var matches = url.match(/gitswarm:\/\/([a-f0-9]{40})\/(.*)/)
+var matches = url.match(/gittorrent:\/\/([a-f0-9]{40})\/(.*)/)
if (matches) {
var key = matches[1]
var reponame = matches[2]
@@ -40,7 +40,7 @@ if (matches) {
})
})
} else {
- url = url.replace(/^gitswarm:/i, 'git:')
+ url = url.replace(/^gittorrent:/i, 'git:')
exec('git ls-remote ' + url + ' HEAD', function (err, stdout, stderr) {
if (err !== null) {
die(err)
@@ -93,11 +93,11 @@ function get_infohash (ref) {
var swarm = new Swarm(parsed.infoHash, 'cafebabecafebabecafecafebabecafebabecafe')
swarm.on('wire', function (wire, addr) {
console.warn('Adding swarm peer: ' + chalk.green(addr) + '\n')
- wire.use(ut_gitswarm())
- wire.ut_gitswarm.on('handshake', function () {
- wire.ut_gitswarm.ask(parsed.infoHash)
+ wire.use(ut_gittorrent())
+ wire.ut_gittorrent.on('handshake', function () {
+ wire.ut_gittorrent.ask(parsed.infoHash)
})
- wire.ut_gitswarm.on('receivedTorrent', function (infoHash) {
+ wire.ut_gittorrent.on('receivedTorrent', function (infoHash) {
var client = new WebTorrent({
dht: {
bootstrap: ['three.printf.net:6882']
diff --git a/gitswarmd b/gittorrentd
index e7a6046..1e2352a 100755
--- a/gitswarmd
+++ b/gittorrentd
@@ -9,7 +9,7 @@ var fs = require('fs')
var net = require('net')
var Protocol = require('bittorrent-protocol')
var spawn = require('child_process').spawn
-var ut_gitswarm = require('ut_gitswarm')
+var ut_gittorrent = require('ut_gittorrent')
var ut_metadata = require('ut_metadata')
var WebTorrent = require('webtorrent')
@@ -153,14 +153,14 @@ dht.on('ready', function () {
net.createServer(function (socket) {
var wire = new Protocol()
- wire.use(ut_gitswarm())
+ wire.use(ut_gittorrent())
wire.use(ut_metadata())
socket.pipe(wire).pipe(socket)
wire.on('handshake', function (infoHash, peerId) {
console.log('Received handshake for ' + infoHash)
wire.handshake(new Buffer(infoHash), new Buffer(peerId))
})
- wire.ut_gitswarm.on('generatePack', function (sha) {
+ wire.ut_gittorrent.on('generatePack', function (sha) {
console.error('calling git pack-objects')
var filename = sha + '.pack'
var stream = fs.createWriteStream(filename)
@@ -180,7 +180,7 @@ dht.on('ready', function () {
})
webtorrent.seed(filename, function onTorrent (torrent) {
console.error(torrent.infoHash)
- wire.ut_gitswarm.sendTorrent(torrent.infoHash)
+ wire.ut_gittorrent.sendTorrent(torrent.infoHash)
})
}
})
diff --git a/package.json b/package.json
index 0fb06e9..1e6b484 100644
--- a/package.json
+++ b/package.json
@@ -1,5 +1,5 @@
{
- "name": "gitswarm",
+ "name": "gittorrent",
"description": "Using BitTorrent to share git repositories",
"version": "0.1.0",
"author": {
@@ -8,11 +8,11 @@
"url": "http://printf.net/"
},
"bin": {
- "git-remote-gitswarm": "./git-remote-gitswarm",
- "gitswarmd": "./gitswarmd"
+ "git-remote-gittorrent": "./git-remote-gittorrent",
+ "gittorrentd": "./gittorrentd"
},
"bugs": {
- "url": "https://github.com/cjb/gitswarm/issues"
+ "url": "https://github.com/cjb/gittorrent/issues"
},
"dependencies": {
"bencode": "^0.7.0",
@@ -24,7 +24,7 @@
"glob": "^5.0.6",
"inherits": "^2.0.1",
"magnet-uri": "^4.0.0",
- "ut_gitswarm": "^0.1.0",
+ "ut_gittorrent": "^0.1.0",
"ut_metadata": "^2.7.3",
"webtorrent": "^0.32.0"
},
@@ -38,13 +38,13 @@
"bittorrent",
"bittorrent client",
"git",
- "gitswarm",
+ "gittorrent",
"mad science"
],
"license": "MIT",
- "main": "git-remote-gitswarm",
+ "main": "git-remote-gittorrent",
"repository": {
"type": "git",
- "url": "git://github.com/cjb/gitswarm.git"
+ "url": "git://github.com/cjb/gittorrent.git"
}
}