npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ara-identity-resolver

v0.51.0

Published

An ARA network node that resolves an identifier to its corresponding keystore

Downloads

4

Readme

ara-identity-resolver

Build Status

Ara Universal Resolver is a universal resolver implementation that providers a driver for the did:ara: method.

Installation

$ npm install arablocks/ara-identity-resolver

Usage

Starting with ann

The resolver can be started with the ann command line tool.

$ ann -t ara-identity-resolver \
  --secret 'SHARED_SECRET' \
  --keyring 'path/to/keyring' \
  --network resolver.my.network

Try ann -t ara-identity-resolver --help if you run into any issues. See Runtime Configuration below for more configuration options. See Generating Network Keys to generate keys for this resolver.

Programmtic usage

Ara Identity Resolver implements ARA RFC 0002 enabling programmatic usage of the node.

const {
  getInstance,
  configure,
  start,
  stop
} = require('ara-identity-resolver')

start()
  .then(getInstance)
  .then((node) => node.on('error', console.error))
  .catch(console.error)

HTTP Server Routes

This section describes the public HTTP routes implemented in server. If the route is not defined, the server will return a 404. If the route is known, but lacking implementation, the server will return a 503. Identifiers that can be correctly resolved return a 200. Internal server errors will return a 500 and resolution times will return a 408.

GET /1.0/identifiers/:did

This route matches version 1.0 DID identifiers.

DID Method Actions

This secion describes the DID methods implemented by this node.

did:ara:<identifier>

The ara DID method resolves a DDO document for a DID if resolution is successful. The node will persist a local cache that it will check before asking the network or local file system. Cached documents can expire based on a configured TTL.

Runtime Configuration

Ara Identity Resolver makes use of various runtime configuration to configure how the node runs. They are documented in this section.

network.identity.resolver

Configuration related to the server running in this node.

network.identity.resolver.timeout

The time in milliseconds before a HTTP request times out the response.

Default: 5000

network.identity.resolver.port

The server port to listen to incoming HTTP requests on.

Default: 8000

network.identity.resolver.cache

Configuration related to the document cache database.

network.identity.resolver.cache.nodes[]

An array of existing nodes to share cache lookups with. Each entry should be a valid Ara Identity URI or identifier.

Default: []

network.identity.resolver.cache.ttl

The time in milliseconds a cached entry should be valid for.

Default: 10000

network.identity.resolver.cache.data

Configuration related to the document cache database data store.

network.identity.resolver.cache.data.root

The path to the data root of the document cache database data store.

Default: ~/.ara/identities/cache

Generating Network Keys

The Ara Identity Resolver runs bound to an identity and a set of network keys that live in a network keyring. Before you can start a network node, you'll need an identity and network keys for it.

Creating an identity:

$ aid create # password is 'hello'

The identity created gave us this did did:ara:53f126d0380eddd5c15980c7b4a4ccd6245d4b3ae47c3c3eab375f0eef172754 which is what we'll need to create keys and a keyring next.

Keys and a keyring can be created with ank. The keyring is append only so you can keep writing to it, even if it already exists.

To use the node, a network name and secret must be created. The network name will be used in the node and the secret is token that gives the node access to the keyring.

Creating network keys:

$ ank --network my.resolver.net \
    --identity did:ara:53f126d0380eddd5c15980c7b4a4ccd6245d4b3ae47c3c3eab375f0eef172754 \
    --keyring ./keyring \
    --secret 'SECRET'

This just created network keys for a network named my.resolver.net secured in the ./keyring file. keyring.pub should also exist. The keyring and the keys are bound to the given identity. You should have been prompted for your password. Your password unlocked your secret key which was used to secure your keyring. keyring.pub is actually the shared or public version of the keyring which can be delegated to other interested partities.

Cache

TODO

Swarm

TODO

See Also

License

LGPL-3.0