Skip to content

Commit

Permalink
Merge pull request #20 from chainflip-io/chore/engine-migrations
Browse files Browse the repository at this point in the history
chore: engine migrations
  • Loading branch information
tomjohnburton authored Oct 6, 2023
2 parents 006ffd5 + 8b03e73 commit 6516e73
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:

- name: Install helm-unittest
run: |
helm plugin install https://github.com/helm-unittest/helm-unittest.git
helm plugin install https://github.com/helm-unittest/helm-unittest --version 0.3.4
- name: Test charts
run: |
Expand Down
2 changes: 1 addition & 1 deletion charts/node/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ maintainers:

type: application

version: 0.3.1
version: 0.4.0

appVersion: "0.9.0"
25 changes: 23 additions & 2 deletions charts/node/templates/engine-cm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,17 @@ data:
[eth]
# Ethereum private key file path. Default is the docker secrets path. This file should contain a hex-encoded private key.
private_key_file = "{{ .Values.common.keys.keysPath }}/{{ .Values.common.keys.ethereumKeyFileName }}"
[eth.rpc]
ws_node_endpoint = "{{ required "Please provide a ws_node_endpoint of an Ethereum node" .Values.engine.settings.eth.ws_node_endpoint }}"
http_node_endpoint = "{{ required "Please provide a http_node_endpoint of an Ethereum node" .Values.engine.settings.eth.http_node_endpoint }}"
{{ if .Values.engine.settings.eth_backup.enabled }}
[eth.backup_rpc]
http_node_endpoint = "{{ .Values.engine.settings.eth_backup.http_node_endpoint }}"
ws_node_endpoint = "{{ .Values.engine.settings.eth_backup.ws_node_endpoint }}"
{{- end }}
{{ if .Values.engine.ports.healthcheck.enabled }}
[health_check]
hostname = "{{ .Values.engine.ports.healthcheck.hostname }}"
Expand All @@ -33,15 +41,28 @@ data:
[signing]
db_file = "{{ .Values.common.basePath }}/data.db"
[dot]
[dot.rpc]
ws_node_endpoint = "{{ required "Please provide a ws_node_endpoint of an Polkadot node" .Values.engine.settings.dot.ws_node_endpoint }}"
http_node_endpoint = "{{ required "Please provide a http_node_endpoint of an Polkadot node" .Values.engine.settings.dot.http_node_endpoint }}"
[btc]
{{ if .Values.engine.settings.dot_backup.enabled }}
[dot.backup_rpc]
http_node_endpoint = "{{ .Values.engine.settings.dot_backup.http_node_endpoint }}"
ws_node_endpoint = "{{ .Values.engine.settings.dot_backup.ws_node_endpoint }}"
{{- end }}
[btc.rpc]
http_node_endpoint = "{{ required "Please provide a http_node_endpoint of an Bitcoin node" .Values.engine.settings.btc.http_node_endpoint }}"
rpc_user = "{{ .Values.engine.settings.btc.rpc_user }}"
rpc_password = "{{ .Values.engine.settings.btc.rpc_password }}"
{{ if .Values.engine.settings.btc_backup.enabled }}
[btc.backup_rpc]
http_node_endpoint = "{{ .Values.engine.settings.btc_backup.http_node_endpoint }}"
rpc_user = "{{ .Values.engine.settings.btc_backup.rpc_user }}"
rpc_password = "{{ .Values.engine.settings.btc_backup.rpc_password }}"
{{- end }}
{{- if .Values.engine.ports.metrics.enabled }}
[prometheus]
hostname = "{{ .Values.engine.ports.metrics.hostname }}"
Expand Down
20 changes: 19 additions & 1 deletion charts/node/tests/engine_settings_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,22 @@ tests:
engine.settings.existingConfigMap: "test"
asserts:
- hasDocuments:
count: 0
count: 0
- it: should specify backup nodes if set
set:
engine.settings.eth_backup.enabled: true
engine.settings.eth_backup.ws_node_endpoint: "ws://test"
engine.settings.eth_backup.http_node_endpoint: "http://test"
engine.settings.dot_backup.enabled: true
engine.settings.dot_backup.ws_node_endpoint: "ws://test"
engine.settings.dot_backup.http_node_endpoint: "http://test"
engine.settings.btc_backup.enabled: true
engine.settings.btc_backup.http_node_endpoint: "http://test"
engine.settings.btc_backup.rpc_user: "test"
engine.settings.btc_backup.rpc_password: "test"
asserts:
- hasDocuments:
count: 1
- matchRegex:
path: data['Settings.toml']
pattern: "[(eth|dot|btc)].backup_rpc"
43 changes: 40 additions & 3 deletions charts/node/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ node:
ingressClassName: ""
annotations: {}
hosts: []
tls: {}
tls: []

# -- set node selector
nodeSelector: {}
Expand Down Expand Up @@ -331,6 +331,18 @@ engine:
# -- ethereum node ws endpoint
http_node_endpoint: ""

# -- set up an optional backup ethereum node
eth_backup:

# -- enabled
enabled: false

# -- ethereum backup node ws endpoint
ws_node_endpoint: ""

# -- ethereum backup node http endpoint
http_node_endpoint: ""

# -- polkadot settings
dot:
# -- polkadot node ws endpoint
Expand All @@ -339,16 +351,41 @@ engine:
# -- polkadot node http endpoint
http_node_endpoint: ""

# -- set up an optional backup ethereum node
dot_backup:

# -- enabled
enabled: false

# -- polkadot backup node ws endpoint
ws_node_endpoint: ""

# -- polkadot backup node http endpoint
http_node_endpoint: ""

# -- bitcoin settings
btc:
# -- bitcoin node http endpoint
http_node_endpoint: ""

# -- bitcoin rpc user
rpc_user: "flip"
rpc_user: ""

# -- bitcoin rpc password
rpc_password: "flip"
rpc_password: ""

btc_backup:
# -- enabled
enabled: false

# -- bitcoin backup node http endpoint
http_node_endpoint: ""

# -- bitcoin backup rpc user
rpc_user: ""

# -- bitcoin backup rpc password
rpc_password: ""

# -- define extra init containers on the engine
extraInitContainers: []
Expand Down

0 comments on commit 6516e73

Please sign in to comment.