Skip to content

lukeburns/hypercore-stream

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hypercore-stream

Create a hypercore stream from a public or private key.

npm install hypercore-stream

Usage

Create stream from a secret key

var createStream = require('hypercore-stream')
var signatures = require('sodium-signatures')

var keys = signatures.keyPair()
var stream = createStream(keys.secretKey)
stream.write('hello')
stream.once('data', function (block) {
  console.log(block.toString()) // hello
})

API

var stream = createStream([key], [options])

key is either a public or private key. If it is a public key, then the stream will be readable only. If it is a private key, then the stream will be both readable and writable. If it is undefined, then a new feed is made and its public and private keys are given by stream.key and stream.secretKey.

All options are optional.

{
  db: leveldb instance,
  static: boolean,
  storage: object,
  tail: boolean,
  start: integer,
  end: integer
}

About

create a hypercore stream from a public or private key

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published