-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
63444ce
commit 2a2db03
Showing
2 changed files
with
25 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -288,15 +288,16 @@ Configuration can be set using environment variables | |
| `DWN_REGISTRATION_PROOF_OF_WORK_ENABLED` | Require new users to complete a proof-of-work challenge | `false` | | ||
| `DWN_REGISTRATION_PROOF_OF_WORK_INITIAL_MAX_HASH` | Initial maximum allowed hash in 64 char HEX string. The more leading zeros (smaller number) the higher the difficulty. | `false` | | ||
| `DWN_STORAGE` | URL to use for storage by default. See [Storage Options](#storage-options) for details | `level://data` | | ||
| `DWN_STORAGE_MESSAGES` | URL to use for storage of messages. | value of `DWN_STORAGE` | | ||
| `DWN_STORAGE_DATA` | URL to use for data storage | value of `DWN_STORAGE` | | ||
| `DWN_STORAGE_EVENTS` | URL to use for event storage | value of `DWN_STORAGE` | | ||
| `DWN_STORAGE_MESSAGES` | Connection URL or file path to custom plugin to use for the message store. | value of `DWN_STORAGE` | | ||
| `DWN_STORAGE_DATA` | Connection URL or file path to custom plugin to use for the data store. | value of `DWN_STORAGE` | | ||
| `DWN_STORAGE_RESUMABLE_TASKS` | Connection URL or file path to custom plugin to use for the resumable task store. | value of `DWN_STORAGE` | | ||
| `DWN_STORAGE_EVENTS` | Connection URL or file path to custom plugin to use for the event store. | value of `DWN_STORAGE` | | ||
| `DWN_TERMS_OF_SERVICE_FILE_PATH` | Required terms of service agreement if set. Value is path to the terms of service file. | unset | | ||
| `DWN_TTL_CACHE_URL` | URL of the TTL cache used by the DWN. Currently only supports SQL databases. | `sqlite://` | | ||
|
||
### Storage Options | ||
|
||
Several storage formats are supported, and may be configured with the `DWN_STORAGE_*` environment variables: | ||
Several built storage options are supported, and may be configured with the `DWN_STORAGE_*` environment variables: | ||
|
||
| Database | Example | Notes | | ||
| ---------- | ----------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
|
@@ -305,6 +306,24 @@ Several storage formats are supported, and may be configured with the `DWN_STORA | |
| MySQL | `mysql://user:pass@host/db?debug=true&timezone=-0700` | [all URL options documented here](https://github.com/mysqljs/mysql#connection-options) | | ||
| PostgreSQL | `postgres:///dwn` | any options other than the URL scheme (`postgres://`) may also be specified via [standard environment variables](https://node-postgres.com/features/connecting#environment-variables) | | ||
|
||
### Plugins | ||
Check failure on line 309 in README.md GitHub Actions / lintHeadings should be surrounded by blank lines
Check failure on line 309 in README.md GitHub Actions / lintHeadings should be surrounded by blank lines
|
||
In some scenarios, you may want to provide a custom implementation of a pluggable module for the DWN Server. The following interfaces defined in `dwn-sdk-js` package are supported: | ||
|
||
- `DataStore` | ||
- `MessageStore` | ||
- `ResumableDataStore` | ||
- `EventLog` | ||
- `EventStream` | ||
|
||
To load your custom plugin, specify the absolute path to the `.js` file of your custom implementation using the corresponding environment variable. For instance, use `DWN_STORAGE_DATA` for a custom DWN Data Store. | ||
|
||
Refer to the `tests/plugins/*.ts` files for examples of plugin implementations. In summary, you need to: | ||
|
||
- Implement the corresponding interface from the `dwn-sdk-js` package. For example, implement the `DataStore` interface for a DWN Data Store. | ||
- Ensure that the built `.js` file that will be referenced by the DWN Server config environment variable contains a class that: | ||
1. Is a default export. This is how DWN Server locates the correct class for instantiation. | ||
1. Has a public constructor that does not take any arguments. This is how DWN Server instantiates the plugin. | ||
|
||
## Registration Requirements | ||
|
||
There are multiple optional registration gates, each of which can be enabled (all are disabled by default). Tenants (DIDs) must comply with whatever | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters