@abaxx/id
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

@abaxx/id

Code Coverage Statements Branches Functions Lines

Introduction

This repository contains ID++ v1 backwards compatibilty and a reference implementation of Decentralized Web Node (DWN) as per the specification. This specification is in a draft state and very much so a WIP. For the foreseeable future, a lot of the work on DWN will be split across this repo and the repo that houses the specification.

Proposals and issues for the specification itself should be submitted as pull requests.

Documentation

Installation

npm install @abaxx/id

Tests

To disable all tests

export TESTSOFF=true

Usage

import { 
  Dwn,
  DataStream,
  DidKeyResolver,
  Jws,
  RecordsWrite,
  MessageStoreLevel,
  DataStoreLevel,
  EventLogLevel
} from '@abaxx/id';

const messageStore = new MessageStoreLevel();
const dataStore = new DataStoreLevel();
const eventLog = new EventLogLevel();

// Create instances
const dwn = await Dwn.create({ messageStore, dataStore, eventLog });

// generate a did:key DID
const didKey = await DidKeyResolver.generate();

const signature = Jws.createSigner(didKey);

// Create some data to be stored.
const encoder = new TextEncoder();
const data = encoder.encode('Hello, World!');

const recordsWrite = await RecordsWrite.create({
  data,
  dataFormat                  : 'application/json',
  published                   : true,
  protocol                    : 'authentication',
  schema                      : 'authentication/get',
  signer                      : Jws.createSigner(didKey)
});

const dataStream = DataStream.fromBytes(data);
const result = await dwn.processMessage(didKey.did, recordsWrite.message, dataStream);

console.log('result', result.status);

// Close the DWN
await dwn.close()

Note: built for node and browser environments

Architecture

The diagram is a conceptual view, the actual component abstraction and names in the source code file may differ.

Architecture

Project Resources

Resource Description
CODEOWNERS Outlines the project lead(s)
CODE_OF_CONDUCT.md Expected behavior for project contributors, promoting a welcoming environment
CONTRIBUTING.md Developer guide to build, test, run, access CI, chat, discuss, file issues
GOVERNANCE.md Project governance
LICENSE Apache License, Version 2.0

Readme

Keywords

none

Package Sidebar

Install

npm i @abaxx/id

Weekly Downloads

2

Version

0.1.1

License

Apache-2.0

Unpacked Size

7.44 MB

Total Files

833

Last publish

Collaborators

  • jdutchak
  • kenjoegolo