Stampery
NodeJS client library for Stampery API, the blockchain-powered, industrial-scale certification platform.
Seamlessly integrate industrial-scale data certification into your own NodeJS apps. The Stampery API adds a layer of transparency, attribution, accountability and auditability to your applications by connecting them to Stampery's infinitely scalable Blockchain Timestamping Architecture.
Installation
-
Install stampery
into your project and add it as a dependency in your package.json
:
npm install --save stampery
-
Go to the API dashboard, sign up and create a token for your application. It will resemble this:
2f6215c7-ad87-4d6e-bf9e-e9f07aa35f1a
Usage
Stampery = require('stampery');
stampery = new Stampery('yourSecretToken')
stampery.on('proof', function(hash, proof) {
console.log("Received proof for " + hash, proof);
stampery.prove(hash, proof, function (valid) {
console.log('Proof validity:', valid);
});
});
stampery.on('ready', function() {
stampery.receiveMissedProofs();
stampery.hash('The piano has been drinking', function(hash) {
stampery.stamp(hash);
});
});
Here is the same example, just using our beloved IcedCoffeeScript:
Stampery = require 'stampery'
# Sign up and get your secret token at https://api-dashboard.stampery.com
stampery = new Stampery 'yourSecretToken'
stampery.on 'proof', (hash, proof) ->
console.log "Received proof for #{hash}", proof
await stampery.prove hash, proof, defer valid
console.log 'Proof validity:', valid
stampery.on 'ready', ->
stampery.receiveMissedProofs()
await stampery.hash 'The piano has been drinking', defer hash
stampery.stamp hash
Client libraries for other platforms
Feedback
Ping us at support@stampery.com and we will more than happy to help you! 😃
Official implementations
License
Code released under
the MIT license.
Copyright 2015-2016 Stampery, Inc.