https://github.com/elsehow/verificationer
send signed messages over a hyperlog
https://github.com/elsehow/verificationer
Last synced: 11 months ago
JSON representation
send signed messages over a hyperlog
- Host: GitHub
- URL: https://github.com/elsehow/verificationer
- Owner: elsehow
- License: bsd-3-clause
- Created: 2016-04-09T18:47:34.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-04-10T21:57:49.000Z (about 10 years ago)
- Last Synced: 2025-07-06T22:06:42.505Z (12 months ago)
- Language: JavaScript
- Size: 5.86 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# verificationer
## install
npm install verificationer
## use
```javascript
var Verificationer = requrie('.')
var talk = require('real-talk')
var hyperlog = require('hyperlog')
var memdb = require('memdb')
// make a hyperlog
var log = hyperlog(memdb(), {
valueEncoding: 'json'
})
// generate a nacl sign keypair with real-talk
var sign_kp = talk.signKeypair()
// here's an object we'll send
var payload = { move: 'left' }
// calls `cb(node)` when a verified item comes through
var veri = Verificationer(log, node => {
console.log(node.value.body)
})
// add an object payload to the log
veri.add(null, payload, sign_kp, (err, res) => {
if (err) console.log(err)
})
// > { move: 'left' }
```
## developing
npm install
npm run watch
now you can edit `test/index.js` or `src/index.js`
`npm test` will re-run on changes
## license
BSD