Configuration parameters can be passed to domain server either as environment variables or flags.
./ds --public-url https://domains.example.com --registration-credentials
(where https://domains.example.com
is the public, external address where this domain server server is reachable) will launch domain server with sane defaults, but if you for some reason want to modify the default configuration of the domain server, here are the configurations you can customize:
Flag | Environment Variable | Default | Example | Description |
---|---|---|---|---|
--addr |
DS_ADDR |
N/A | :4000 |
The address to listen to for requests. |
--log-level |
DS_LOG_LEVEL |
N/A | debug |
The log level. One of debug, info, warn, error, fatal, panic. |
--postgres-url |
DS_POSTGRES_URL |
N/A | postgres://user:password@host:5432/dbname |
The URL to connect to Postgres. |
--postgres-pool-size |
DS_POSTGRES_POOL_SIZE |
N/A | 10 |
The size of the Postgres connection pool. |
--postgres-trace-level |
DS_POSTGRES_TRACE_LEVEL |
N/A | trace |
Set to trace, debug, or info to log all DB queries. Set to error if you only want to trace errors. More info |
--public-url |
DS_PUBLIC_URL |
N/A | https://example.com |
The public URL of Domain Server. |
--public-key-ttl |
DS_PUBLIC_KEY_TTL |
N/A | 24h |
The TTL of public key cache of DDS. |
--registration-credentials |
DS_REGISTRATION_CREDENTIALS |
N/A | user:password |
The credentials used for registration to DDS. |
--wallet-private-key |
DS_WALLET_PRIVATE_KEY |
N/A | The wallet private key (in hex format). | |
--wallet-private-key-file |
DS_WALLET_PRIVATE_KEY_FILE_PATH |
N/A | The file that contains the private key of a server-unique Ethereum-compatible wallet. It overwrites DS_WALLET_PRIVATE_KEY . |
|
--healthcheck-ttl |
DS_HEALTHCHECK_TTL |
N/A | 5m |
The elapsed time required since the last health check to trigger a new registration. |
--max-retry |
DS_MAX_RETRY |
N/A | 3 |
The maximum number of retries to register to DDS. Set it to -1 if you want to retry forever. |
--default-request-timeout |
DS_DEFAULT_REQUEST_TIMEOUT |
N/A | 30s |
The default request timeout. |
--stream-request-timeout |
DS_STREAM_REQUEST_TIMEOUT |
N/A | 1h |
The timeout for stream requests. |
--default-request-size-limit |
DS_DEFAULT_REQUEST_SIZE_LIMIT |
N/A | 10485760 (10 MB) |
The default request size in bytes. |
--upload-request-size-limit |
DS_UPLOAD_REQUEST_SIZE_LIMIT |
N/A | 104857600 (100 MB) |
The upload request size limit in bytes. |
--domain-data-size-limit |
DS_DOMAIN_DATA_SIZE_LIMIT |
N/A | 10485760 (10 MB) |
The domain data size limit in bytes. |
--storage.local-path |
DS_STORAGE_LOCAL_PATH |
./volume |
/app/data/domain-data |
Where to save domain data |
Every domain server needs a unique wallet. You can generate it in a wallet app of your choice (such as MetaMask) and copy its private key to a file called domain-server-private.key. If you wish to generate a wallet on the command-line, make sure that you back up your private key (for example by adding it to your wallet app) to not lose your stake or rewards. Here is an example command to generate a wallet and save its private key to a file so the domain server can use it:
pip3 install web3
python3 -c "from web3 import Web3; w3 = Web3(); acc = w3.eth.account.create(); print(f'{w3.to_hex(acc.key)}')" > domain-server-private.key
chmod 600 domain-server-private.key
We recommend that the private key is supplied as a file (DS_WALLET_PRIVATE_KEY_FILE_PATH
) rather than directly on the command line or through environment variables (DS_WALLET_PRIVATE_KEY
) as files are more secure.
DO NOT CONFIGURE A WALLET WITH EXISTING ASSETS, instead generate a new wallet for every domain server you operate. The private key of your wallet is only used by the domain server for authentication and verification of your reputation deposit and will stay on your machine. But if someone gains access to the private key file on your server, they will get access to your wallet, so please take appropriate precautions.