Skip to content

Commit

Permalink
Merge pull request #662 from energywebfoundation/develop
Browse files Browse the repository at this point in the history
Updating prod with develop
  • Loading branch information
jrhender authored Sep 20, 2023
2 parents 1d7cae0 + dca0e34 commit 894b7eb
Show file tree
Hide file tree
Showing 51 changed files with 1,116 additions and 298 deletions.
16 changes: 9 additions & 7 deletions .env.dev
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,15 @@ ASSETS_SYNC_HISTORY_INTERVAL_IN_HOURS=21
ASSETS_SYNC_ENABLED=true

# IPFS
IPFS_CLUSTER_ROOT=$IPFS_CLUSTER_ROOT
IPFS_CLUSTER_USER=$IPFS_CLUSTER_USER
IPFS_CLUSTER_PASSWORD=$IPFS_CLUSTER_PASSWORD
IPFS_CLIENT_HOST=<PUT_YOUR_VALUE_HERE>
IPFS_CLIENT_PORT=<PUT_YOUR_VALUE_HERE>
IPFS_CLIENT_PROJECT_ID=<PUT_YOUR_VALUE_HERE>
IPFS_CLIENT_PROJECT_SECRET=<PUT_YOUR_VALUE_HERE>
IPFS_CLUSTER_ROOT # Cluster can be deployed locally with e2e/setupIpfsCluster/index.ts
IPFS_CLUSTER_USER # Not needed locally
IPFS_CLUSTER_PASSWORD # Not needed locally
IPFS_CLIENT_URL # Can be public gateway https://ipfs.github.io/public-gateway-checker/, Inura gateway or IPFS cluster. When cluster used as IPFS gateway it supports only GET
IPFS_CLIENT_PROTOCOL # These can be
IPFS_CLIENT_HOST # used instead of
IPFS_CLIENT_PORT # IPFS_CLIENT_URL
IPFS_CLIENT_PROJECT_ID # Id of Infura project or user of cluster
IPFS_CLIENT_PROJECT_SECRET # Secret of Infura project or cluster password

# INTERVALS
DIDDOC_SYNC_INTERVAL_IN_HOURS=1
Expand Down
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
3 changes: 2 additions & 1 deletion .github/renovate.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"extends": ["github>energywebfoundation/shared-configs"],
"assignees": ["Harasz", "JGiter"],
"reviewers": ["Harasz", "jrhender", "JGiter"]
"reviewers": ["Harasz", "jrhender", "JGiter"],
"ignoreDeps": ["didStoreInfura"]
}
2 changes: 1 addition & 1 deletion .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ env:
ASSETS_SYNC_INTERVAL_IN_HOURS: ${{secrets.ASSETS_SYNC_INTERVAL_IN_HOURS}}
ASSETS_SYNC_HISTORY_INTERVAL_IN_HOURS: ${{secrets.ASSETS_SYNC_HISTORY_INTERVAL_IN_HOURS}}
ASSETS_SYNC_ENABLED: ${{secrets.ASSETS_SYNC_ENABLED}}
IPFS_URL: ${{secrets.IPFS_URL}}
IPFS_CLIENT_URL: ${{secrets.IPFS_URL}}
NESTJS_PORT: ${{secrets.NESTJS_PORT}}
STRATEGY_CACHE_SERVER: ${{secrets.STRATEGY_CACHE_SERVER}}
STRATEGY_PRIVATE_KEY: ${{secrets.STRATEGY_PRIVATE_KEY}}
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
/dist
/node_modules
/src/ethers
.env

# Logs
logs
Expand All @@ -20,6 +19,8 @@ ormlogs.log
# Tests
/coverage
/.nyc_output
/e2e/setupIpfsCluster/ipfs0/
!/e2e/setupIpfsCluster/docker-compose.yml

# IDEs and editors
/.idea
Expand Down
10 changes: 1 addition & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,7 @@ $ cp .env.dev .env
$ cp docker-compose.dev.yml docker-compose.yml
```

Set the following values in your `.env`:

```text
ENS_URL=<PUT_YOUR_VALUE_HERE>
IPFS_CLIENT_HOST=<PUT_YOUR_VALUE_HERE>
IPFS_CLIENT_PORT=<PUT_YOUR_VALUE_HERE>
IPFS_CLIENT_PROJECT_ID=<PUT_YOUR_VALUE_HERE>
IPFS_CLIENT_PROJECT_SECRET=<PUT_YOUR_VALUE_HERE>
```
Fill in configuration values in your `.env`. For reference look at `.env.dev`

### Production
```bash
Expand Down
1 change: 1 addition & 0 deletions devops/dev/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ iam-cache-server-helm:
NESTJS_PORT: 3000
DB_MAXIMUM_CONNECTION_POOL: 56 # https://github.com/energywebfoundation/iam-cache-server/blob/develop/README.md#connection-pooling
SENTRY_ENV: dev
IPFS_CLIENT_PROTOCOL: https
IPFS_CLIENT_PORT: 5001
IPFS_CLIENT_PROJECT_ID: 2DFOVbJGkFy289ekGv5BjgZngCt
IPFS_CLIENT_HOST: ipfs.infura.io
Expand Down
3 changes: 2 additions & 1 deletion devops/prod/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ iam-cache-server-helm:
LOGS_DIRECTORY: /app/logs
NESTJS_PORT: 3000
SENTRY_ENV: prod
IPFS_CLIENT_PROTOCOL: https
IPFS_CLIENT_PORT: 5001
IPFS_CLIENT_PROJECT_ID: 2DFVKQS7MfgeN9hdXrPG6HHH02O
IPFS_CLIENT_HOST: ipfs.infura.io
Expand Down Expand Up @@ -186,4 +187,4 @@ iam-cache-server-helm:
ENS_URL: AgBoXgF+veIAYSQRVN5mq5Q189utr0bxHXjOVSzAu/cfEmBJyH/q0DdCMCjkKILypNTAcQaLqbsVixZy4qVl14vs6LPYeKyLsgZ9CXrz0dffeogHX88+PJYgcGnfVhhsjBwGvToBz9adgCPv030dVEwz+HYRFhIayz/Mnubs0CLzkAEDdQiOW6u7JBNNyw0q7CMPW1Z0HDroYVR/zNAZJHAmSpsmKSiiHnJw2LO0JMJ6YLkHRZRuNPR1Yu4D05l3vPk+1YNk7t2Eca05fTfiH6n3KlW69Zl6F48uGumpJM2ME4WI36lFclB+c5T22mOWi+lx3ZW9ypJei/pp/sjnTTAgnboKC5GPI6LAbi1/VaZzDcdbWDJ18dOHXuz0MkgTTcSsRBFM2edxzWwSTWe8JJqOTxZq84ljefv3p/7GAXZ/Z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usNiEORhFru0x1+avH8aHxbNvDfsPGN5NOAsoQ8AD6SAvPDwTacl8YydccAv71To+sNQYP+qgmKk4ir6Nn5sB/tAXDLzvfx9QHU+j6jgY48abU4q2ZKA2GKG6po/lu+jawugA==
1 change: 1 addition & 0 deletions devops/sandbox/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ iam-cache-server-helm:
NATS_CLIENTS_URL: iam-cache-server-nats.ics.svc.cluster.local:4222
LOGS_DIRECTORY: /app/logs
NESTJS_PORT: 3000
IPFS_CLIENT_PROTOCOL: https
IPFS_CLIENT_PORT: 5001
IPFS_CLIENT_PROJECT_SECRET: 9506198a91243f03417aaed60e5eb654
IPFS_CLIENT_PROJECT_ID: 2DBFBP5zsjfImw1wBPn1Vx08Yd5
Expand Down
1 change: 1 addition & 0 deletions devops/staging/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ iam-cache-server-helm:
NESTJS_PORT: 3000
DB_MAXIMUM_CONNECTION_POOL: 150 # 1024^3 * 4 / 9531392 = 450 . 450/3 = 150. https://github.com/energywebfoundation/iam-cache-server/blob/develop/README.md#connection-pooling
SENTRY_ENV: staging
IPFS_CLIENT_PROTOCOL: https
IPFS_CLIENT_PORT: 5001
IPFS_CLIENT_PROJECT_ID: 2DFOoYU78LsICBTNhrwRGctWE7i
IPFS_CLIENT_HOST: ipfs.infura.io
Expand Down
10 changes: 1 addition & 9 deletions docs/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,7 @@ $ cp .env.dev .env
$ cp docker-compose.dev.yml docker-compose.yml
```

Set the following values in your `.env`:

```text
ENS_URL=<PUT_YOUR_VALUE_HERE>
IPFS_CLIENT_HOST=<PUT_YOUR_VALUE_HERE>
IPFS_CLIENT_PORT=<PUT_YOUR_VALUE_HERE>
IPFS_CLIENT_PROJECT_ID=<PUT_YOUR_VALUE_HERE>
IPFS_CLIENT_PROJECT_SECRET=<PUT_YOUR_VALUE_HERE>
```
Fill in configuration values in your `.env`. For reference look at `.env.dev`

### Production
```bash
Expand Down
43 changes: 43 additions & 0 deletions docs/api/classes/common_cid_pipe.CIDPipe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Class: CIDPipe

[common/cid.pipe](../modules/common_cid_pipe.md).CIDPipe

## Implements

- `PipeTransform`

## Table of contents

### Constructors

- [constructor](common_cid_pipe.CIDPipe.md#constructor)

### Methods

- [transform](common_cid_pipe.CIDPipe.md#transform)

## Constructors

### constructor

**new CIDPipe**()

## Methods

### transform

**transform**(`cid`): `CID`

#### Parameters

| Name | Type |
| :------ | :------ |
| `cid` | `string` |

#### Returns

`CID`

#### Implementation of

PipeTransform.transform
17 changes: 17 additions & 0 deletions docs/api/classes/modules_did_did_processor.DIDProcessor.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

### Methods

- [OnQueueWaiting](modules_did_did_processor.DIDProcessor.md#onqueuewaiting)
- [onActive](modules_did_did_processor.DIDProcessor.md#onactive)
- [onError](modules_did_did_processor.DIDProcessor.md#onerror)
- [onFailed](modules_did_did_processor.DIDProcessor.md#onfailed)
Expand All @@ -34,6 +35,22 @@

## Methods

### OnQueueWaiting

**OnQueueWaiting**(`job`): `Promise`<`void`\>

#### Parameters

| Name | Type |
| :------ | :------ |
| `job` | `Job`<`any`\> |

#### Returns

`Promise`<`void`\>

___

### onActive

**onActive**(`job`): `void`
Expand Down
4 changes: 2 additions & 2 deletions docs/api/classes/modules_did_did_service.DIDService.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

### constructor

**new DIDService**(`config`, `schedulerRegistry`, `httpService`, `didQueue`, `logger`, `didRepository`, `provider`, `sentryTracingService`, `registrySettings`, `didStore`)
**new DIDService**(`config`, `schedulerRegistry`, `httpService`, `didQueue`, `logger`, `didRepository`, `provider`, `sentryTracingService`, `registrySettings`, `ipfsService`)

#### Parameters

Expand All @@ -43,7 +43,7 @@
| `provider` | [`Provider`](common_provider.Provider.md) |
| `sentryTracingService` | [`SentryTracingService`](modules_sentry_sentry_tracing_service.SentryTracingService.md) |
| `registrySettings` | `RegistrySettings` |
| `didStore` | `DidStore` |
| `ipfsService` | [`IPFSService`](modules_ipfs_ipfs_service.IPFSService.md) |

## Methods

Expand Down
58 changes: 58 additions & 0 deletions docs/api/classes/modules_ipfs_ipfs_controller.IPFSController.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Class: IPFSController

[modules/ipfs/ipfs.controller](../modules/modules_ipfs_ipfs_controller.md).IPFSController

## Table of contents

### Constructors

- [constructor](modules_ipfs_ipfs_controller.IPFSController.md#constructor)

### Methods

- [get](modules_ipfs_ipfs_controller.IPFSController.md#get)
- [save](modules_ipfs_ipfs_controller.IPFSController.md#save)

## Constructors

### constructor

**new IPFSController**(`ipfsService`)

#### Parameters

| Name | Type |
| :------ | :------ |
| `ipfsService` | [`IPFSService`](modules_ipfs_ipfs_service.IPFSService.md) |

## Methods

### get

**get**(`cid`): `Promise`<`string`\>

#### Parameters

| Name | Type |
| :------ | :------ |
| `cid` | `CID` |

#### Returns

`Promise`<`string`\>

___

### save

**save**(`credential`): `Promise`<`string`\>

#### Parameters

| Name | Type |
| :------ | :------ |
| `credential` | `string` \| `object` |

#### Returns

`Promise`<`string`\>
53 changes: 52 additions & 1 deletion docs/api/classes/modules_ipfs_ipfs_service.IPFSService.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,67 @@

### Methods

- [get](modules_ipfs_ipfs_service.IPFSService.md#get)
- [save](modules_ipfs_ipfs_service.IPFSService.md#save)
- [isCID](modules_ipfs_ipfs_service.IPFSService.md#iscid)

## Constructors

### constructor

**new IPFSService**()
**new IPFSService**(`didStoreCluster`, `didStoreInfura`, `pinsQueue`, `logger`)

#### Parameters

| Name | Type |
| :------ | :------ |
| `didStoreCluster` | `DidStore` |
| `didStoreInfura` | `DidStore` |
| `pinsQueue` | `Queue`<`string`\> |
| `logger` | [`Logger`](modules_logger_logger_service.Logger.md) |

## Methods

### get

**get**(`cid`): `Promise`<`string`\>

Get claim from cluster. If claim isn't found tries to get from gateway

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `cid` | `string` | Content identifier. |

#### Returns

`Promise`<`string`\>

Stringified credential

___

### save

**save**(`credential`): `Promise`<`string`\>

Saves credential on cluster

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `credential` | `string` | Credential being persisted |

#### Returns

`Promise`<`string`\>

CID of the persisted credential

___

### isCID

`Static` **isCID**(`hash`): `boolean`
Expand Down
Loading

0 comments on commit 894b7eb

Please sign in to comment.