Skip to content

Commit

Permalink
feat: pass fx adapter api keys to oracles (#10443)
Browse files Browse the repository at this point in the history
  • Loading branch information
philbow61 authored Aug 3, 2023
1 parent fe5e228 commit 98dbf1d
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/celotool/src/lib/env-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ export enum envVar {
ORACLE_DOCKER_IMAGE_REPOSITORY = 'ORACLE_DOCKER_IMAGE_REPOSITORY',
ORACLE_DOCKER_IMAGE_TAG = 'ORACLE_DOCKER_IMAGE_TAG',
ORACLE_UNUSED_ORACLE_ADDRESSES = 'ORACLE_UNUSED_ORACLE_ADDRESSES',
ORACLE_FX_ADAPTERS_API_KEYS = 'ORACLE_FX_ADAPTERS_API_KEYS',
PRIVATE_NODE_DISK_SIZE_GB = 'PRIVATE_NODE_DISK_SIZE_GB',
PRIVATE_TX_NODES = 'PRIVATE_TX_NODES',
PROMETHEUS_DISABLE_STACKDRIVER_SIDECAR = 'PROMETHEUS_DISABLE_STACKDRIVER_SIDECAR',
Expand Down
1 change: 1 addition & 0 deletions packages/celotool/src/lib/k8s-oracle/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export abstract class BaseOracleDeployer {
? getFornoWebSocketUrl(this.celoEnv)
: getFullNodeWebSocketRpcInternalUrl(this.celoEnv)
return [
`--set oracle.api_keys=${fetchEnv(envVar.ORACLE_FX_ADAPTERS_API_KEYS)}`,
`--set environment.name=${this.celoEnv}`,
`--set image.repository=${fetchEnv(envVar.ORACLE_DOCKER_IMAGE_REPOSITORY)}`,
`--set image.tag=${fetchEnv(envVar.ORACLE_DOCKER_IMAGE_TAG)}`,
Expand Down
12 changes: 11 additions & 1 deletion packages/celotool/src/lib/oracle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,17 @@ const mnemonicBasedOracleIdentityConfigDynamicEnvVars: {
*/
export function addCurrencyPairMiddleware(argv: yargs.Argv) {
return argv.option('currencyPair', {
choices: ['CELOUSD', 'CELOEUR', 'CELOBRL', 'USDCUSD', 'USDCEUR', 'USDCBRL'],
choices: [
'CELOUSD',
'CELOEUR',
'CELOBRL',
'USDCUSD',
'USDCEUR',
'USDCBRL',
'CELOXOF',
'EUROCXOF',
'EUROCEUR',
],
description: 'Oracle deployment to target based on currency pair',
demandOption: true,
type: 'string',
Expand Down
7 changes: 7 additions & 0 deletions packages/helm-charts/oracle/templates/api_keys-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v1
kind: Secret
metadata:
name: api-keys
type: Opaque
data:
api_keys: {{ .Values.oracle.api_keys | b64enc }}
5 changes: 5 additions & 0 deletions packages/helm-charts/oracle/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: API_KEYS
valueFrom:
secretKeyRef:
key: api_keys
name: api-keys
{{ include "common.env-var" (dict "name" "API_REQUEST_TIMEOUT" "dict" .Values.oracle "value_name" "apiRequestTimeoutMs" "optional" true) | indent 8 }}
{{ include "common.env-var" (dict "name" "AZURE_HSM_INIT_TRY_COUNT" "dict" .Values.oracle.azureHsm "value_name" "initTryCount") | indent 8 }}
{{ include "common.env-var" (dict "name" "AZURE_HSM_INIT_MAX_RETRY_BACKOFF_MS" "dict" .Values.oracle.azureHsm "value_name" "initMaxRetryBackoffMs") | indent 8 }}
Expand Down

0 comments on commit 98dbf1d

Please sign in to comment.