digitalbazaar/bedrock-ledger-node

Name: bedrock-ledger-node

Owner: Digital Bazaar, Inc.

Description: A Bedrock module that supports the creation and management of decentralized ledgers.

Created: 2016-12-03 18:51:41.0

Updated: 2017-07-26 20:14:15.0

Pushed: 2018-01-14 17:53:29.0

Homepage:

Size: 777

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Build Status

Bedrock Ledger

A bedrock module for the creation and management of decentralized ledgers.

Requirements
Quick Examples
install bedrock-ledger
s
actor = 'admin';
ledgerConfigEvent = {
context': 'https://w3id.org/flex/v1',
: 'did:c02915fc-672d-4568-8e6e-b12a0b35cbb3/events/1',
pe: 'LedgerConfigurationEvent',
dgerConfig: {
id: 'did:c02915fc-672d-4568-8e6e-b12a0b35cbb3',
type: 'LedgerConfiguration',
name: 'test-ledger',
description: 'A test ledger',
storageMechanism: 'SequentialList',
consensusAlgorithm: {
  type: 'ProofOfSignature2016',
  approvedSigner: [ 'https://example.org/keys/authorized-1' ],
  minimumSignaturesRequired: 1
},

eviousEvent: {
hash: 'urn:sha256:0000000000000000000000000000000000000000000000000000000000000000';



er.createLedger(actor, ledgerConfigEvent, {}, function(err, ledgerUrl) {
(err) {
console.log('Ledger creation failed:', err);
else {
console.log('Ledger created:', ledgerUrl);


Configuration

For documentation on configuration, see config.js.

API
createLedger(actor, ledgerConfigEvent, options, callback)

Creates a ledger.

writeLedgerEvent(actor, ledgerName, ledgerEvent, options, callback)

Writes an event to a given ledger.

getLedgerMetadata(actor, ledgerName, options, callback)

Gets metadata about a specific ledger in the system.

getAllLedgerMetadata(actor, options, callback)

Gets metadata about all ledgers in the system.

getLedgerEvent(actor, ledgerName, eventId, options, callback)

Get ledger event metadata.

getStateMachineObject(actor, ledgerName, objectId, options, callback)

Retrieves an object from the current state machine.

calculateLedgerEventHash(ledgerEvent, options, callback)

Calculate a ledger event hash value.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.