Skip to main content

Configuration

Custody Server Configuration

If you want to use an external custody service to store and manage your wallets, then you need to deploy one more service - the Custody Server.

This service also needs the STELLAR_ANCHOR_CONFIG that was previously mentioned. By default, the anchor-config-default-values.yaml config file will be used.

Also, now you don't need to deploy the Stellar Observer since the Custody Server will be responsible for its functionality.

Update the configuration file of the Anchor Platform with the base URL and port.

custody_server:
# The listening port of the Custody Server.
# Default value: 8086
port: 8086
# The base URL of the Custody Server.
# Default value: http://localhost:8086
base_url: http://localhost:8086

Configure authentication type.

custody_server:
auth:
# Type of authentication that is used when the Anchor Platform communicates with the Custody Server.
# Supported values: [none, api_key, jwt]
# Default value: none
type: none

If you set the api_key or jwt authentication type, then you need to add an environment variable.

# dev.env
SECRET_CUSTODY_SERVER_AUTH_SECRET="Custody Server auth secret"

Start the Custody Server using Gradle or Docker.

./gradlew service-runner:bootRun --args=--custody-server
docker run stellar-anchor-platform:latest --custody-server

Anchor Platform Configuration

Update the configuration file of the Anchor Platform with the deposit info generator type for SEP-24 and SEP-31. Also, you need to configure a trustline check, if you use JSON-RPC.

sep24:
# Used to choose how the SEP-24 deposit information (deposit address, memo and memo type) will be generated
# Supported value: [self, custody, none]
# Default value: self
deposit_info_generator_type: custody
sep31:
# Used to choose how the SEP-31 deposit information (deposit address, memo and memo type) will be generated
# Supported value: [self, custody, api]
# Default value: self
deposit_info_generator_type: custody
## Trustline check configuration. Used only when custody integration is enabled
custody:
trustline:
## @param: checkCronExpression
## @type: string
## Cron expression which defines how often a trustline check job runs. By default, a job runs every minute
#
check_cron_expression: "0 * * * * *"
## @param: checkDuration
## @type: integer
## Determines how long (in MINUTES) the trustline will be checked. By default - 1 hour (60 minutes)
#
check_duration: 60
## @param: checkTimeoutMessage
## @type: string
## The message that will be added to the SEP transaction after the duration check is exceeded
#
check_timeout_message: Trustline check timed out
info
  • self - memo and memo type are generated in the local code, and the distribution account is used for the deposit address.
  • custody - memo and memo type are generated through Custody API, for example Fireblocks, as well as the deposit address.
  • none - deposit address, memo, and memo type should be provided by the business in a PATCH/JSON-RPC request.
  • api - memo and memo type are generated through calling the anchor's GET /unique_address endpoint.

Kotlin Reference Server Configuration

Update the configuration file of the Kotlin Reference Server to enable custody integration.

app:
# Flag that indicates that the custody integration is enabled and the payment will be submitted using the Custody Server.
# Default value: false
custodyEnabled: true