generated from TBD54566975/tbd-project-template
-
Notifications
You must be signed in to change notification settings - Fork 18
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
gabe
committed
Oct 23, 2023
1 parent
1a821a7
commit 5050727
Showing
1 changed file
with
41 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Server Implementation | ||
|
||
- Heavily a work-in-progress | ||
- Designed to be run as a single instance | ||
|
||
## Config | ||
|
||
# TOML Config File | ||
|
||
Config is managed using a [TOML](https://toml.io/en/) [file](../../config/dev.toml). There are sets of configuration values for the server | ||
(e.g. which port to listen on), the services (e.g. which database to use), and each service. | ||
|
||
Each service may define specific configuration, such as which DID methods are enabled for the DID service. | ||
|
||
A full config example is [provided here](../../config/kitchensink.toml). | ||
|
||
## Usage | ||
|
||
How it works: | ||
|
||
1. On startup the service loads default values into the `ServiceConfig` | ||
2. Checks for a TOML config file: | ||
- If exists, load toml file | ||
- If does not exist, it uses a default config defined in the code inline | ||
3. Loads the `config/.env` file and adds the env variables defined in this file to the final `ServiceConfig` | ||
|
||
## Build & Run | ||
|
||
Run: | ||
|
||
``` | ||
docker build . -t did-dht -f build/Dockerfile | ||
``` | ||
|
||
and then | ||
|
||
``` | ||
docker run -p8305:8305 did-dht | ||
``` | ||
|
||
|