Configure servers for Tessera API
You can configure the servers for the Tessera API in the Tessera configuration file.
Specify the servers to be started as a list in serverConfigs.
Server configuration
"serverConfigs": [
    <server settings>
]
Server addresses
The server configuration has two address entries:
- serverAddress- Address of the server. This can be specified as an IP address or a DNS name.
- bindingAddress- (optional) Endpoint to use for the binding. Specify to bind to an internal IP while advertising an external IP using- serverAddress.
Each server is individually configured and can advertise over HTTP, HTTPS, or a Unix Socket.
You can also configure CORS for the ThirdParty server type.
HTTP server configuration
- Syntax
- ThirdParty example
{
  "app": "<app type>",
  "serverAddress": "http://[host]:[port]/[path]",
  "communicationType": "REST"
}
{
  "app": "ThirdParty",
  "serverAddress": "http://localhost:9081",
  "communicationType": "REST"
}
HTTPS server configuration
- Syntax
- P2P example
{
    "app": "<app type>",
    "serverAddress": "https://[host]:[port]/[path]",
    "communicationType" : "REST",
    "sslConfig": {
        <SSL settings>
    }
}
{
  "app": "P2P",
  "serverAddress": "http://localhost:9001",
  "sslConfig": {
    "tls": "enum STRICT,OFF",
    "generateKeyStoreIfNotExisted": "boolean",
    "serverKeyStore": "Path",
    "serverTlsKeyPath": "Path",
    "serverTlsCertificatePath": "Path",
    "serverKeyStorePassword": "String",
    "serverTrustStore": "Path",
    "serverTrustCertificates": ["Path"],
    "serverTrustStorePassword": "String",
    "serverTrustMode": "TOFU",
    "clientKeyStore": "Path",
    "clientTlsKeyPath": "Path",
    "clientTlsCertificatePath": "Path",
    "clientKeyStorePassword": "String",
    "clientTrustStore": "Path",
    "clientTrustCertificates": ["Path"],
    "clientTrustStorePassword": "String",
    "clientTrustMode": "TOFU",
    "knownClientsFile": "Path",
    "knownServersFile": "Path"
  },
  "communicationType": "REST",
  "properties": {
    "partyInfoInterval": "Long",
    "enclaveKeySyncInterval": "Long",
    "syncInterval": "Long",
    "resendWaitTime": "Long"
  }
}
Unix socket server configuration
- Syntax
- Q2T example
{
  "app": "<app type>",
  "serverAddress": "unix://[path]",
  "communicationType": "REST"
}
{
  "app": "Q2T",
  "serverAddress": "unix:/tmp/tm.ipc",
  "communicationType": "REST"
}
Configure CORS
The ThirdParty server type supports configuring CORS to control access to resources.
ThirdParty CORS configuration
{
  "app": "ThirdParty",
  "serverAddress": "http://localhost:9081",
  "communicationType": "REST",
  "cors": {
    "allowedMethods": ["GET", "POST", "PUT", "DELETE", "OPTIONS", "HEAD"],
    "allowedOrigins": ["http://localhost:63342"],
    "allowedHeaders": ["content-type"],
    "allowCredentials": true
  }
}