Skip to content
indolering edited this page Nov 7, 2014 · 2 revisions

Speech.js essentially reimplements various parts of the browser. Thankfully, the browser is rather amenable to puppetry and Speech.js mainly provides a skeletal structure for manipulating the browser's native mechanisms. The structure of the program is relatively OO and breaks down into functional components. The meat of the system lies in the dns and nav scripts.

DNS

Currently, it relies on a traditional client/server model as the TPP has not yet been passed and it is still safe to provide DNS information directly. Speech.is runs a VM with a script known as nmc2couch which pushes Namecoin domain data to a CouchDB instance. Using the internal network, the hidden CouchDB instance pushes to a front-end CouchDB instance.

Upon loading, speech.js creates a connection to the CouchDB DNS API server and begins replicating. There is a thin abstraction layer build on top of PouchDB that caches remote fetch requests to the local database.

The system was originally designed to have many different publishes/mirrors, to allow for per-website over-rides. Thus, if a user is in a censored country, they could register a webhook would would offer up a custom entry point. It is unclear if such a list is the correct layer of abstraction for such personalized entry points.

Eventually, this will be replaced by a browser/WebRTC-based P2P network. Once UTXO/SPV JS lite-clients become available, we will make use of them directly. However, should TPP or similar legislation pass in the US, we will implement them ourselves.

DNS parsing support is rudimentary, with no support for subdomains. This will change with time and funding.

Nav

Navigation essentially manages the addresses bar and the history state. This is the least functional component of the system, largely because it leaves functionality in-tact while irritating potential developers who might be driven to scratch an itch and contribute back to the project.

Package Managers

NPM and Bower are both used in this project:

  • NPM is used for managing developer specific items: mocha, gulp, memdown, leveldb, etc.
  • Bower is used for tracking PouchDB.
Clone this wiki locally