orb

module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 27, 2021 License: Apache-2.0

README

Release License Godocs

Build Status codecov Go Report Card

orb DID Method

Build

The project is built using make.

BDD test suit can be run via make bdd-test

Run

To run Orb nodes you can use docker-compose.

First run the docker compose itself via

  1. cd test/bdd/fixtures/
  2. docker-compose up This will start up the Orb nodes (wait for containers to start for about 15-20 seconds)

In order to start creating DIDs you'll need to set up the Orb services' collection of witnesses and followers.

A service may 'invite' another service to 'witness' a verifiable credential. The originating service creates a verifiable credential and 'offers' it to its witnesses (see https://trustbloc.github.io/did-method-orb/#offer-activity). A witness adds the verifiable credential to its own ledger (VCT) and sends back a proof (see https://trustbloc.github.io/did-method-orb/#like-activity). Once the originating service receives a sufficient number of proofs, it creates an anchor credential from which DID documents are created. The anchor credential is then announced to the service's followers.

A witness is invited using the 'InviteWitness' ActivityPub activity. The following example shows the service at orb.domain1.com inviting the service at orb.domain2.com to be a witness. This is accomplished by posting the following activity to orb.domain1.com's outbox, https://orb.domain1.com/services/orb/outbox (if running outside of Docker then use https://localhost:48326/services/orb/outbox):

{
  "@context": [
    "https://www.w3.org/ns/activitystreams",
    "https://trustbloc.github.io/did-method-orb/contexts/anchor/v1"
  ],
  "actor": "https://orb.domain1.com/services/orb",
  "object": "https://orb.domain2.com/services/orb",
  "to": "https://orb.domain2.com/services/orb",
  "type": "InviteWitness"
}

A service requests to follow another service using the 'Follow' activity. The following example shows the service at orb.domain1.com requesting to follow the service at orb.domain2.com. This is accomplished by posting the following activity to https://orb.domain1.com/services/orb/outbox:

{
  "@context": "https://www.w3.org/ns/activitystreams",
  "actor": "https://orb.domain1.com/services/orb",
  "object": "https://orb.domain2.com/services/orb",
  "to": "https://orb.domain2.com/services/orb",
  "type": "Follow"
}

Once the followers and witnesses are set up, you may start creating/resolving DIDs!

A full set of integration tests are included, which demonstrate all the features of Orb, including adding followers/witnesses and creating/resolving sample DIDs. After Orb is started (using the instructions above) you may run the tests as follows:

  1. cd test/bdd
  2. DISABLE_COMPOSITION=true go test

After the tests have run, you may resolve a DID by hitting the endpoint: https://localhost:48326/sidetree/v1/identifiers/{did}, where {did} can be chosen from the variety of DIDs in the BDD test console output. It will look like this: did:orb:EiBQyuTmdDYoVWD1GgmM1lLG5wY_9zZNzC0DE-VY3Ska2Q.

Domain's public key: https://localhost:48326/.well-known/did.json

Discovery configuration: https://localhost:48326/.well-known/did-orb

To bring everything down run docker-compose down

Contributing

Thank you for your interest in contributing. Please see our community contribution guidelines for more information.

License

Apache License, Version 2.0 (Apache-2.0). See the LICENSE file.

Directories

Path Synopsis
cmd
orb-cli Module
orb-driver Module
orb-server Module
pkg
activitypub/client/mocks
Code generated by counterfeiter.
Code generated by counterfeiter.
activitypub/mocks
Code generated by counterfeiter.
Code generated by counterfeiter.
activitypub/service/mocks
Code generated by counterfeiter.
Code generated by counterfeiter.
activitypub/service/wmlogger/mocks
Code generated by counterfeiter.
Code generated by counterfeiter.
activitypub/store/mocks
Code generated by counterfeiter.
Code generated by counterfeiter.
anchor/handler/mocks
Code generated by counterfeiter.
Code generated by counterfeiter.
internal/aptestutil
Package aptestutil contains ActivityPub test utilities.
Package aptestutil contains ActivityPub test utilities.
protocolversion/factoryregistry/mocks
Code generated by counterfeiter.
Code generated by counterfeiter.
protocolversion/mocks
Code generated by counterfeiter.
Code generated by counterfeiter.
resolver/document/mocks
Code generated by counterfeiter.
Code generated by counterfeiter.
store/mocks
Code generated by counterfeiter.
Code generated by counterfeiter.
test
bdd Module

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL