• Stars
    star
    880
  • Rank 51,640 (Top 2 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 8 years ago
  • Updated over 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Decentralized feeds using BitTorrent's DHT. Idea from Arvid and The_8472 "DHT RSS feeds" http://libtorrent.org/dht_rss.html

PeerTweet

Decentralized feeds using BitTorrent's DHT. Idea from Arvid and The_8472 "DHT RSS feeds" http://libtorrent.org/dht_rss.html

Screenshot

PeerTweet

Quick links

  • Download the latest binaries from the releases page.
  • Find and share PeerTweet addresses from the addresses issues page.

What is PeerTweet?

BitTorrent's DHT is probably one of the most resilient and censorship-resistant networks on the internet. PeerTweet uses this network to allow users to broadcast tweets to anyone who is listening. When you start PeerTweet, it generates a hash @33cwte8iwWn7uhtj9MKCs4q5Ax7B which is similar to your Twitter username (ex. @lmatteis). The difference is that you have entire control over what can be posted because only you own the private key associated with such address. Furthermore, thanks to the DHT, what you post cannot be stopped by any government or institution.

Once you find other PeerTweet addresses you trust (and are not spam), you can follow them. This configures your client to store this user's tweets and broadcasts them to the DHT every once in a while to keep their feed alive. This cooperation of following accounts, allows for feeds to stay alive in the DHT network. The PeerTweet protocol also publishes your actions such as I just followed @919c.. or I just liked @9139.. and I just retweeted @5789... This allows the possibility for new users to find other addresses they can trust; if I trust the user @6749.. and they're following @9801.., then perhaps I can mark @9801.. as not spam. This idea of publicly tweeting about your actions also allows for powerful future crawling analysis of this social graph.

How does it work?

PeerTweet follows most of the implementation guidelines provided by the DHT RSS feed proposal http://libtorrent.org/dht_rss.html. We implemented it on top of the current BEP44 proposal which provides get() and put() functionality over the DHT network. This means that, rather than only using the DHT to announce which torrents one is currently downloading, we can use it to also put and get small amounts of data (roughly 1000 bytes).

PeerTweet differentiates between two types of items:

  1. Your feed head. Which is the only mutable item of your feed, and is what your followers use to download your items and find updates. Your head's hash is what your followers use to know about updates - it's your identity and can be used to let others know about your feed (similar to your @lmattes handle). The feed head is roughly structured as follows:
{
  "d": <unsigned int of minutes passed from epoch until head was modified>,
  "next": <up to 80 bytes of the next 4 items in the feed, directly 1,2,3 and 4 hops away. 20 bytes each.>,
  "n": <utf8 name of the feed>,
  "a": <utf8 http url of an image to render as your avatar>,
  "i": <utf8 description of your feed>
}
  1. Your feed items. These are immutable items which contain your actual tweets and are structured:
{
  "d": <unsigned int of minutes passed from epoch until when item was created>,
  "next": <up to 80 bytes of the next 4 items in the feed, 1, 2, 4 and 8 hops away. 20 bytes each.>,
  "t": <utf8 contents of your tweet. up to 140 chars>
}

Skip lists

The reason items have multiple pointers to other items in the list is to allow for parallel lookups. Our skip list implementation differs from regular implementations and is targeted for network lookups, where each item contains 4 pointers so that when we receive an item, we can issue 4 get() requests in parallel to other items in the list. This is crucial for accessing user's feeds in a timely manner because DHT lookups have unpredictable response times.

Following

When you follow someone, you're essentially informing your client to download their feed and republish it every so often. The DHT network is not a persistent one, and items quickly drop out of the network after roughly 30 minutes. In order to keep things alive, having many followers is crucial for the uptime of your feed. Otherwise you can still have a server somewhere running 24/7 which keeps your feed alive by republishing items every 30 minutes.

Install

Install dependencies.

$ npm install

Installing native modules

The app comes with some native bindings. I used this code to make it run on my computer:

Source: https://github.com/atom/electron/blob/master/docs/tutorial/using-native-node-modules.md

npm install --save-dev electron-rebuild

# Every time you run "npm install", run this
./node_modules/.bin/electron-rebuild

# On Windows if you have trouble, try:
.\node_modules\.bin\electron-rebuild.cmd

To get ed25519-supercop to work on Windows I also had to install node-gyp and all the Python2.7 and Visual Studio stuff which node-gyp requires: https://github.com/nodejs/node-gyp

Then run these commands to build it on Windows:

npm install -g node-gyp
cd ./node_modules/ed25519-supercop/
HOME=~/.electron-gyp node-gyp rebuild --target=0.36.9 --arch=x64 --dist-url=https://atom.io/download/atom-shell

Run

Run this two commands simultaneously in different console tabs.

$ npm run hot-server
$ npm run start-hot

Note: requires a node version >= 4 and an npm version >= 2.

Toggle Chrome DevTools

  • OS X: Cmd Alt I or F12
  • Linux: Ctrl Shift I or F12
  • Windows: Ctrl Shift I or F12

See electron-debug for more information.

Toggle Redux DevTools

  • All platforms: Ctrl+H

See redux-devtools-dock-monitor for more information.

Externals

If you use any 3rd party libraries which can't be built with webpack, you must list them in your webpack.config.base.js:

externals: [
  // put your node 3rd party libraries which can't be built with webpack here (mysql, mongodb, and so on..)
]

You can find those lines in the file.

CSS Modules support

Import css file as css-modules using .module.css.

Package

$ npm run package

To package apps for all platforms:

$ npm run package-all

Options

  • --name, -n: Application name (default: ElectronReact)
  • --version, -v: Electron version (default: latest version)
  • --asar, -a: asar support (default: false)
  • --icon, -i: Application icon
  • --all: pack for all platforms

Use electron-packager to pack your app with --all options for darwin (osx), linux and win32 (windows) platform. After build, you will find them in release folder. Otherwise, you will only find one for your os.

test, tools, release folder and devDependencies in package.json will be ignored by default.

Default Ignore modules

We add some module's peerDependencies to ignore option as default for application size reduction.

  • babel-core is required by babel-loader and its size is ~19 MB
  • node-libs-browser is required by webpack and its size is ~3MB.

Note: If you want to use any above modules in runtime, for example: require('babel/register'), you should move them form devDependencies to dependencies.

Building windows apps from non-windows platforms

Please checkout Building windows apps from non-windows platforms.

Native-like UI

If you want to have native-like User Interface (OS X El Capitan and Windows 10), react-desktop may perfect suit for you.

Maintainers

This is a fork of the https://github.com/chentsulin/electron-react-boilerplate project.

License

MIT

More Repositories

1

torrent-net

Distributed search engines using BitTorrent and SQLite
C
1,013
star
2

next-13-layout-transitions

TypeScript
161
star
3

apejs

A tiny JavaScript web framework targeted for Google App Engine
JavaScript
152
star
4

redux-statecharts

Redux statecharts
JavaScript
123
star
5

hckr.it

Hacker News clone for CouchDB
JavaScript
99
star
6

node-trello

Node wrapper for Trello's HTTP API.
JavaScript
98
star
7

redux-tdd

Redux TDD: Dot-chaining syntax for doing TDD with redux by composing unit tests as if they were integration tests
JavaScript
94
star
8

dmt

Decentralized Mutable Torrents reference implementation
JavaScript
75
star
9

behavioral

Behavioral Programming for JavaScript
JavaScript
73
star
10

react-behavioral

#BehavioralProgramming for React
JavaScript
55
star
11

ldstatic

Host your Linked Data for free, as static pages, using a variety of providers (GitHub Pages, Google Code, Google Drive, etc.), and run SPARQL queries using a basic Linked Data Fragment client.
JavaScript
18
star
12

void-graph

VoID Linked Data graph diagram displayed using JavaScript and SVG
JavaScript
17
star
13

access2couch

A command-line utility for Windows, that pushes a MS Access database to a CouchDB instance. Written in Node.js
JavaScript
10
star
14

waku-page-transitions

Framer motion page transitions with Waku React Server Components
TypeScript
7
star
15

restpark

Minimal RESTful API for querying RDF triples
CSS
7
star
16

redux-behavioral

Behavioral Programming for Redux
JavaScript
6
star
17

behavioral-programming-talk

Behavioral Programming talk at ReactJS day #BehavioralProgramming
5
star
18

jquery-report

Allows you to visualize an HTML Table out of JSON
JavaScript
5
star
19

bitcoin-notify

Notify when new places accepting Bitcoin have been added to OpenStreetMap
JavaScript
4
star
20

blogger-skeleton

Having troubles with creating Blogger themes? I created this skeleton to get you started.
4
star
21

genebanks

Genebanks Linked Data!
JavaScript
3
star
22

seed-couchapp

Couchapp for http://seeds.iriscouch.com/
JavaScript
2
star
23

grinfo-tumblr

A tumblr theme based on Twitter Bootstrap
2
star
24

middleend

some middleend!
PHP
2
star
25

smark

Create beautiful presentation slides with Markdown
JavaScript
2
star
26

seed-scraper

scrape genebanks websites for accession data
JavaScript
2
star
27

linked-data-node

A Linked Data frontend for SPARQL endpoints written in Node.js
JavaScript
2
star
28

romajs

JavaScript User Group & Meetup Roma -> https://plus.google.com/communities/114324393897443067092
JavaScript
2
star
29

json-compressor

Removes whitespace and JavaScript-style comments from a JSON string.
JavaScript
1
star
30

mealo

this is personal stuff! leave now!
JavaScript
1
star
31

kudos

something interesting p2p
JavaScript
1
star
32

ascetica-ines

PHP
1
star
33

resume

my resume :)
CSS
1
star
34

bttrkr

JavaScript
1
star
35

slides

My slides
TeX
1
star
36

human

A little irc bot that loads some data
JavaScript
1
star
37

seedhub

a seedhub is a seedhub no?
JavaScript
1
star
38

grinfo.net

Site for bio-informatics
JavaScript
1
star
39

mustache-rdf

Mustache RDF. Templating for RDF
1
star
40

romapingpong

Rome ping pong
JavaScript
1
star
41

finland-talk

https://lmatteis.github.io/finland-talk
1
star
42

selectjs-api

Documentation for the selectjs.com api
1
star
43

human-chiglug

Couchapp for http://chiglug.tk that shows data generated by the *human* bot
JavaScript
1
star
44

milu

An italian cooking site
JavaScript
1
star
45

waku-infinite-scroll

TypeScript
1
star