# @identity-box/idservice

> IdBox identity service to handle identity requests via Telepath

Latest version **0.1.29-alpha.2** (published 2020-04-02) · ISC license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @identity-box/idservice
pnpm add @identity-box/idservice
yarn add @identity-box/idservice
bun add @identity-box/idservice
```

Provides the commands `setup`, `idservice`, `idservice-cjs`.

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.1.29-alpha.2 |
| Published | 2020-04-02 |
| First published | 2019-07-09 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=12.0.0 |
| Dependencies | 12 |
| Unpacked size | 33 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Marcin Czenko |
| Maintainers | everydayproductive |
| Keywords | ipfs, ipns, ipid, DID, Cogito, Telepath |

## Links

- npm: https://www.npmjs.com/package/@identity-box/idservice
- npm.io page: https://npm.io/package/@identity-box/idservice

## Dependencies (12)

- [esm](https://npm.io/package/esm.md) ^3.2.25
- [got](https://npm.io/package/got.md) ^10.6.0
- [glob](https://npm.io/package/glob.md) ^7.1.6
- [base64url](https://npm.io/package/base64url.md) ^3.0.1
- [tweetnacl](https://npm.io/package/tweetnacl.md) ^1.0.3
- [libp2p-crypto](https://npm.io/package/libp2p-crypto.md) ^0.17.3
- [firebase-admin](https://npm.io/package/firebase-admin.md) ^8.10.0
- [qrcode-terminal](https://npm.io/package/qrcode-terminal.md) ^0.12.0
- [ipfs-http-client](https://npm.io/package/ipfs-http-client.md) ^42.0.0
- [@identity-box/utils](https://npm.io/package/@identity-box/utils.md) ^0.1.29-alpha.2
- [@identity-box/telepath](https://npm.io/package/@identity-box/telepath.md) ^0.1.29-alpha.2
- [@react-frontend-developer/buffers](https://npm.io/package/@react-frontend-developer/buffers.md) ^1.0.21

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 0.1.29-alpha.2 (latest) — 2020-04-02
- 0.1.29-alpha.1 — 2020-04-02
- 0.1.29-alpha.0 — 2020-03-31
- 0.1.28 — 2020-03-11
- 0.1.27 — 2020-03-09
- 0.1.26 — 2020-01-31
- 0.1.25 — 2020-01-29
- 0.1.24 — 2020-01-28
- 0.1.23 — 2020-01-19
- 0.1.22 — 2019-12-17
- 0.1.21 — 2019-12-06
- 0.1.20 — 2019-10-21
- 0.1.19 — 2019-09-30
- 0.1.18 — 2019-09-26
- 0.1.17 — 2019-08-29
- … 13 more at https://npm.io/package/@identity-box/idservice/versions

## README

# 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:

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

## IPFS

Make sure the IPFS daemon is running:

```bash
$ 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](https://multiformats.io/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:

```bash
$ 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:

```bash
./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:

```bash
$ yarn global add pm2
```

and ensure it is in `$PATH`:

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

### Start service

```bash
$ pm2 start ecosystem.config.js
```

### List all services

```bash
$ pm2 list
```

### Settings on a service

```bash
$ pm2 show idservice
```

### Logs

To show both stdout and stderr logs run:

```bash
$ 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:

```bash
$ pm2 logs idservice --out --lines 150
```

### Restart process after editing ecosystem

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

---
_Source: https://npm.io/package/@identity-box/idservice · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
