@identity-box/idservice
IdBox identity service to handle identity requests via Telepath
Last updated 2 months ago by everydayproductive .
ISC · Original npm · Tarball · package.json
$ cnpm install @identity-box/idservice 
SYNC missed versions from official npm registry.

Identity Service

A service to handle identity requests on IdBox.

Installation

On your identity-box, first create a folder where you want your service to be installed (we recommend that you use the name of the service as the name of the folder). Then install the service as follows:

$ mkdir idservice
$ cd idservice
$ yarn add @identity-box/idservice
$ yarn setup

IPFS

Make sure the IPFS daemon is running:

$ ipfs daemon --enable-namesys-pubsub --enable-pubsub-experiment --enable-gc --migrate

telepath.config

This is the file where your telepath configuration is kept. The included telepath.config can be used for development (either locally or on your idbox), but should be removed before launching the actual service so that a fresh telepath configuration is created.

Environment variables

IdService assume some environment variables to be set.

IPFS environment variables

IPFS_PATH needs to point to the IPFS data directory. On the local machine this is usually $HOME/.ipfs.

IPFS_ADDR contains the address of the IPFS host. This needs to conform to the multiaddr format. When this environment variable is not set, the address will default to /ip4/127.0.0.1/tcp/5001.

IDBOX_NAMESERVICE_URL

IDBOX_NAMESERVICE_URL contains the URL where the name service is listening. When this environment variable is not set, the URL will default to http://localhost:3100.

Automatic backup

For the automatic backups functionality, IdService requires two environment variables to be set: IDBOX_BACKUP holding the absolute path to the backup directory, and IDBOX_BACKUP_PASSWORD to hold the password to encrypt the idbox IPNS keys. Every key from $IPFS_PATH/keystore will have its corresponding pem file in $IDBOX_BACKUP directory. $IDBOX_BACKUP will also contain a backup file with all user's identities from the IdApp (encrypted).

serviceUrl

By default, IdService will use https://idbox-queue.now.sh as the queuing service. If you want to run it with a local server, you can set the serviceUrl environment variable and point it to the service you want to use, e.g:

$ serviceUrl=http://localhost:3000 ./index.js

The command above applies when you run IdService out of the monorepo itself. If you follow the standard installation, please follow the instructions below.

Please, make sure you use your own unique telepath channel when your queuing service is set to https://idbox-queue.now.sh (the default). Otherwise, you may have troubles to understand what's actually going on. In particular, the provided telepath.config should only be use with you own local queuing service.

Usage

To directly run the service, use:

./node_modules/.bin/idservice

With PM2

You can take of advantage of pm2 to start an identity-box service. Make sure you have pm2 installed globally:

$ yarn global add pm2

and ensure it is in $PATH:

export PATH=$PATH:/home/pi/.yarn/bin

Start service

$ pm2 start ecosystem.config.js

List all services

$ pm2 list

Settings on a service

$ pm2 show idservice

Logs

To show both stdout and stderr logs run:

$ pm2 logs idservice

This shows all the logs of idservice and outputs the last 15 lines (the default).

To see only standard output logs, and print more lines from the output use:

$ pm2 logs idservice --out --lines 150

Restart process after editing ecosystem

$ pm2 delete ecosystem.config.js
$ pm2 start ecosystem.config.js

Current Tags

  • 0.1.29-alpha.2                                ...           latest (2 months ago)

28 Versions

  • 0.1.29-alpha.2                                ...           2 months ago
  • 0.1.29-alpha.1                                ...           2 months ago
  • 0.1.29-alpha.0                                ...           2 months ago
  • 0.1.28                                ...           2 months ago
  • 0.1.27                                ...           3 months ago
  • 0.1.26                                ...           4 months ago
  • 0.1.25                                ...           4 months ago
  • 0.1.24                                ...           4 months ago
  • 0.1.23                                ...           4 months ago
  • 0.1.22                                ...           5 months ago
  • 0.1.21                                ...           6 months ago
  • 0.1.20                                ...           7 months ago
  • 0.1.19                                ...           8 months ago
  • 0.1.18                                ...           8 months ago
  • 0.1.17                                ...           9 months ago
  • 0.1.16                                ...           10 months ago
  • 0.1.15                                ...           10 months ago
  • 0.1.14                                ...           10 months ago
  • 0.1.13                                ...           10 months ago
  • 0.1.12                                ...           a year ago
  • 0.1.11                                ...           a year ago
  • 0.1.10                                ...           a year ago
  • 0.1.9                                ...           a year ago
  • 0.1.8                                ...           a year ago
  • 0.1.7                                ...           a year ago
  • 0.1.6                                ...           a year ago
  • 0.1.5                                ...           a year ago
  • 0.1.4                                ...           a year ago
Maintainers (1)
Downloads
Today 28
This Week 28
This Month 28
Last Day 0
Last Week 0
Last Month 34
Dependencies (12)
Dev Dependencies (1)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |