Skip to content

Commit

Permalink
Add XRP
Browse files Browse the repository at this point in the history
  • Loading branch information
yukonet committed Jan 11, 2024
1 parent 11b2578 commit ad76044
Show file tree
Hide file tree
Showing 8 changed files with 286 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/shkeeper/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.3.29
version: 1.3.30

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
79 changes: 79 additions & 0 deletions charts/shkeeper/templates/configmaps/xrp-fullnode-rippled.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
{{- if .Values.xrp_fullnode.enabled }}
apiVersion: v1
kind: ConfigMap
metadata:
name: xrp-fullnode-config
namespace: shkeeper
data:
rippled.cfg: |
[server]
port_rpc_admin_local
port_http
[port_rpc_admin_local]
port = 5005
ip = 127.0.0.1
admin = 127.0.0.1
protocol = http
[port_http]
port = 51234
ip = 0.0.0.0
protocol = http
[node_size]
tiny
[node_db]
type=NuDB
path=/var/lib/rippled/db/nudb
advisory_delete=0
# How many ledgers do we want to keep (history)?
# Integer value that defines the number of ledgers
# between online deletion events
online_delete=256000 #about 10 days
[ledger_history]
# How many ledgers do we want to keep (history)?
# Integer value (ledger count)
# or (if you have lots of TB SSD storage): 'full'
256000 #about 10 days
[database_path]
/var/lib/rippled/db
[debug_logfile]
/var/log/rippled/debug.log
[sntp_servers]
time.windows.com
time.apple.com
time.nist.gov
pool.ntp.org
[ips]
r.ripple.com 51235
[validators_file]
validators.txt
[rpc_startup]
{ "command": "log_level", "severity": "info" }
# severity (order: lots of information .. only errors)
# debug
# info
# warn
# error
# fatal
[ssl_verify]
1
validators.txt: |
[validator_list_sites]
https://vl.ripple.com
[validator_list_keys]
ED2677ABFFD1B33AC6FBC3062B71F1E8397C1505E1C42C64D11AD1B28FF73F4734
{{- end }}
42 changes: 42 additions & 0 deletions charts/shkeeper/templates/deployments/xrp-fullnode.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{{- if .Values.bnb_fullnode.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: xrp
namespace: shkeeper
labels:
app: xrp
spec:
strategy:
type: Recreate
replicas: 1
selector:
matchLabels:
app: xrp
template:
metadata:
labels:
app: xrp
spec:
terminationGracePeriodSeconds: 300
tolerations: {{- toYaml .Values.xrp_fullnode.tolerations | nindent 8 }}
nodeSelector: {{- toYaml .Values.xrp_fullnode.nodeSelector | nindent 8 }}
containers:

# executor
- name: xrp
image: xrpllabsofficial/xrpld:1.12.0
volumeMounts:
- name: xrp-fullnode-config
mountPath: /config/rippled.cfg
subPath: rippled.cfg
- name: xrp-fullnode-config
mountPath: /config/validators.txt
subPath: validators.txt


volumes:
- name: xrp-fullnode-config
configMap:
name: xrp-fullnode-config
{{- end }}
105 changes: 105 additions & 0 deletions charts/shkeeper/templates/deployments/xrp-shkeeper.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
{{- if .Values.xrp.enabled}}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: xrp-shkeeper
namespace: shkeeper
labels:
app: xrp-shkeeper
spec:
replicas: 1
selector:
matchLabels:
app: xrp-shkeeper
template:
metadata:
labels:
app: xrp-shkeeper
spec:
{{- with .Values.dev.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}

containers:

- name: app
image: {{ .Values.xrp_shkeeper.image }}
command:
- gunicorn
- --access-logfile=-
- --workers=1
- --threads=16
- --timeout=600
- --bind=0.0.0.0:6000
- run:server
ports:
- containerPort: 6000
name: http
env:
- name: XRP_USERNAME
valueFrom:
secretKeyRef:
name: xrp-rpc
key: username
- name: XRP_PASSWORD
valueFrom:
secretKeyRef:
name: xrp-rpc
key: password
- name: SHKEEPER_BACKEND_KEY
valueFrom:
secretKeyRef:
name: shkeeper-btc-key
key: password
- name: XRP_NETWORK
{{- if .Values.XRP_fullnode.mainnet }}
value: &XRP_NETWORK_VALUE "main"
{{- else }}
value: &XRP_NETWORK_VALUE "testnet"
{{- end }}
- name: FULLNODE_URL
value: {{ .Values.xrp_fullnode.url }}
{{- range $name, $value := .Values.xrp_shkeeper.extraEnv }}
- name: {{ $name | quote }}
value: {{ $value | quote }}
{{- end }}

- name: tasks
image: {{ .Values.xrp_shkeeper.image }}
command: ["celery", "-A", "celery_worker.celery", "worker", "--loglevel=info", "-B"]
env:
- name: XRP_USERNAME
valueFrom:
secretKeyRef:
name: xrp-rpc
key: username
- name: XRP_PASSWORD
valueFrom:
secretKeyRef:
name: xrp-rpc
key: password
- name: SHKEEPER_BACKEND_KEY
valueFrom:
secretKeyRef:
name: shkeeper-btc-key
key: password
- name: XRP_NETWORK
{{- if .Values.xrp_fullnode.mainnet }}
value: *XRP_NETWORK_VALUE
{{- else }}
value: *XRP_NETWORK_VALUE
{{- end }}
- name: FULLNODE_URL
value: {{ .Values.xrp_fullnode.url }}
- name: C_FORCE_ROOT
value: "1"
{{- range $name, $value := .Values.xrp_shkeeper.extraEnv }}
- name: {{ $name | quote }}
value: {{ $value | quote }}
{{- end }}

- name: redis
image: redis
{{- end }}
12 changes: 12 additions & 0 deletions charts/shkeeper/templates/secrets/rpcvalues.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,15 @@ metadata:
data:
username: Yml0Y29pbmQtdXNlcg==
{{ end }}
{{- if .Values.xrp.enabled}}
---
apiVersion: v1
kind: Secret
metadata:
name: xrp-rpc
namespace: shkeeper
annotations:
secret-generator.v1.mittwald.de/autogenerate: password
data:
username: Yml0Y29pbmQtdXNlcg==
{{ end }}
15 changes: 15 additions & 0 deletions charts/shkeeper/templates/services/xrp-fullnode.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{{ if .Values.xrp_fullnode.enabled }}
---
apiVersion: v1
kind: Service
metadata:
name: xrp
namespace: shkeeper
spec:
selector:
app: xrp
ports:
- name: http-tcp
port: 51234
protocol: TCP
{{ end }}
15 changes: 15 additions & 0 deletions charts/shkeeper/templates/services/xrp-shkeeper.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{{- if .Values.xrp.enabled}}
---
apiVersion: v1
kind: Service
metadata:
name: xrp-shkeeper
namespace: shkeeper
spec:
selector:
app: xrp-shkeeper
ports:
- name: app-tcp
port: 6000
protocol: TCP
{{ end }}
17 changes: 17 additions & 0 deletions charts/shkeeper/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,21 @@ bnb:
bnb_usdt:
enabled: false
bnb_usdc:
enabled: false

#
# XRP
#

xrp_fullnode:
enabled: false
url: http://xrp:51234
mainnet: true
nodeSelector: {}
tolerations: []

xrp_shkeeper:
image: vsyshost/xrp-shkeeper:1.0.1

xrp:
enabled: false

0 comments on commit ad76044

Please sign in to comment.