telehash

A simplified telehash library for node and browserify

npm install telehash
102 downloads in the last week
304 downloads in the last month

Overview

telehash

This module presents a simple high-level API for using telehash for both node and browserify.

The browser crypto that powers this is only possible thanks to the incredible work done by the team behind Forge, Tom Wu, and the Sanford Javascript Crypto Library.

Seeds

Telehash apps always need one or more seeds to bootstrap from, the default development testing ones are in seeds.json. You can run your own seed via npm start or manually via node seed.js. The JSON object from the seed can be passed in to the init function (shown below) as "seeds":{...} in the args or stored in a seeds.json file with that passed in.

Library Interface

Identity / Keypair Generation

To create a new hashname:

var th = require("telehash");
th.init({}, function(err, self){
  if(err) return console.log("hashname generation/startup failed",err);
  // self.id contains a the public/private keys and parts
});

Hashname Initialization / Startup

Needs an id object from a previously created self.id to load the existing hashname from:

var th = require("telehash");
th.init({id:id}, function(err, self){
  if(err) return console.log("hashname failed to come online",err);
  // use self.* now
});

Args

The first object passed in to the load function takes the following arguments:

  • id - An object previously created, or a string pointing to a file to load the object from.
  • seeds - An object in the seeds format, or a string pointing to a file to load from.

API

Once you have a hashname running you can use the common API with it.

npm loves you