Skip to content

Commit

Permalink
[ANCHOR-672] Flatten anchor config fields in value file (#1345)
Browse files Browse the repository at this point in the history
### Description

All fields are configurable by the `config` struct in the value file.
Previously, only the callback API was configurable using this method.

### Context

We need to be able to configure using a separate Horizon instance.
Rather than hardcoding the value mapping like the callback API, this
refactors how config management is done.

### Testing

- `./gradlew test`
- Testing with the demo wallet

### Documentation

N/A

### Known limitations

This is a breaking change so the deployed environments will need to be
updated.
  • Loading branch information
philipliu authored May 1, 2024
1 parent 7256673 commit 53f6f6a
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 29 deletions.
1 change: 0 additions & 1 deletion helm-charts/reference-server/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ data:
version: 0.0.1
isTest: false
port: 8091
horizonEndpoint: https://horizon-testnet.stellar.org
distributionWallet: GBN4NNCDGJO4XW4KQU3CBIESUJWFVBUZPOKUZHT7W7WRB7CWOA7BXVQF
distributionWalletMemo:
distributionWalletMemoType:
Expand Down
1 change: 1 addition & 0 deletions helm-charts/reference-server/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ container:

config:
app:
horizonEndpoint: https://horizon-testnet.stellar.org
platformApiEndpoint: http://anchor-platform-svc-platform:8085
data:
url: postgresql-ref:5432
Expand Down
8 changes: 6 additions & 2 deletions helm-charts/sep-service/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ metadata:
name: anchor-config
namespace: {{ .Values.namespace }}
data:
{{ include "common.addMultiline" (list "anchor-config.yaml" .Values.anchor_config )}}
{{ include "common.addMultiline" (list "sep1.toml" .Values.sep1_toml )}}
{{ include "common.addMultiline" (list "assets.yaml" .Values.assets_config )}}
{{ include "common.addMultiline" (list "assets.yaml" .Values.assets_config )}}
anchor-config.yaml: |
version: 1
{{- range $key, $value := .Values.config }}
{{ $key }}: {{ toYaml $value | nindent 6 }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,6 @@ spec:
secretKeyRef:
name: {{ .Values.fullName }}-secrets
key: SEP6_MORE_INFO_URL_JWT_SECRET
- name: PLATFORM_API_BASE_URL
value: {{ print "http://" .Values.fullName "-svc-" .Values.services.platform.name ":" .Values.services.platform.containerPort }}
- name: CALLBACK_API_BASE_URL
value: {{ .Values.config.callbackApi.baseUrl }}
- name: SECRET_EVENTS_QUEUE_KAFKA_USERNAME
valueFrom:
secretKeyRef:
Expand Down
2 changes: 0 additions & 2 deletions helm-charts/sep-service/templates/observer-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@ spec:
secretKeyRef:
name: {{ .Values.fullName }}-secrets
key: SEP6_MORE_INFO_URL_JWT_SECRET
- name: PLATFORM_API_BASE_URL
value: {{ print "http://" .Values.fullName "-svc-" .Values.services.platform.name ":" .Values.services.platform.containerPort | default 8085 }}
resources:
requests:
memory: {{ .Values.services.observer.deployment.resources.requests.memory }}
Expand Down
4 changes: 0 additions & 4 deletions helm-charts/sep-service/templates/sepserver-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,6 @@ spec:
secretKeyRef:
name: {{ .Values.fullName }}-secrets
key: SEP10_SIGNING_SEED
- name: PLATFORM_API_BASE_URL
value: {{ print "http://" .Values.fullName "-svc-" .Values.services.platform.name ":" .Values.services.platform.containerPort | default 8085 }}
- name: CALLBACK_API_BASE_URL
value: {{ .Values.config.callbackApi.baseUrl }}
- name: SECRET_EVENTS_QUEUE_KAFKA_USERNAME
valueFrom:
secretKeyRef:
Expand Down
32 changes: 16 additions & 16 deletions helm-charts/sep-service/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,18 +69,6 @@ services:
cpu: 1

config:
callbackApi:
baseUrl: http://reference-server-svc-reference-server:8091

ingress:
name: ingress-anchor-platform
className: nginx
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /

anchor_config: |
version: 1
app_logging:
stellar_level: DEBUG
request_logger_enabled: true
Expand All @@ -97,6 +85,12 @@ anchor_config: |
flyway_enabled: true
ddl_auto: update

callback_api:
base_url: http://reference-server-svc-reference-server:8091

platform_api:
base_url: http://anchor-platform-svc-platform:8085

events:
enabled: true
queue:
Expand All @@ -111,18 +105,18 @@ anchor_config: |
toml:
type: file
value: /config/sep1.toml

sep6:
enabled: true

sep10:
enabled: true
web_auth_domain: localhost:8080
home_domains: localhost:8080

sep12:
enabled: true

sep31:
enabled: true

Expand All @@ -136,6 +130,12 @@ anchor_config: |
more_info_url:
base_url: http://localhost:8091

ingress:
name: ingress-anchor-platform
className: nginx
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /

sep1_toml: |
ACCOUNTS = ["GCSGSR6KQQ5BP2FXVPWRL6SWPUSFWLVONLIBJZUKTVQB5FYJFVL6XOXE"]
VERSION = "0.1.0"
Expand Down

0 comments on commit 53f6f6a

Please sign in to comment.