Compare commits

...

10 Commits

Author SHA1 Message Date
tim
e614050c88 Talos; Ethereum node 2024-12-07 19:49:26 -04:00
tim
1cf568dda1 partial work on k8s descriptors for ethereum and arbitrum nodes 2024-11-16 19:33:41 -04:00
tim
c08a694dd2 transaction placement dialog 2024-11-11 20:55:28 -04:00
tim
6992e57299 post-order line draw improvements 2024-11-04 18:39:09 -04:00
tim
caf33232df buy/sell color change fix 2024-11-04 14:39:43 -04:00
tim
a9288a3712 redis init bugfix 2024-11-01 13:33:13 -04:00
tim
5b39d5ccc7 redis fixes 2024-11-01 13:17:13 -04:00
tim
66aada0478 updated Home features 2024-10-31 20:10:08 -04:00
tim
a2ffe92c4d breakout orders 2024-10-31 16:54:57 -04:00
tim
bdf952fbd9 beta announcement 2024-10-30 13:55:25 -04:00
13 changed files with 1645 additions and 81 deletions

1
.gitignore vendored
View File

@@ -7,3 +7,4 @@ node_modules
/.vscode
/ohlc
/tradingview
talosconfig

Submodule backend updated: b133999314...48fdfeeb3f

View File

@@ -22,11 +22,10 @@ spec:
value: 'true'
containers:
- name: arb1
image: offchainlabs/nitro-node:v2.3.4-b4cc111
image: offchainlabs/nitro-node:v3.2.1-d81324d
command: [
'--init.url=https://snapshot.arbitrum.foundation/arb1/nitro-archive.tar',
'--parent-chain.connection.url=https://eth-mainnet.g.alchemy.com/v2/XiM8sruAHL_FKkhVdxqsOw2ardZFMZxX',
'--parent-chain.blob-client.beacon-url=<TODO>'
'--init.latest=archive',
'--parent-chain.connection.url=https://eth-mainnet.g.alchemy.com/v2/Ns3gyYixF9sHKT54_ZOrzXzdG5GOqUSS',
]
volumeMounts:
- name: arb1

View File

@@ -0,0 +1,73 @@
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: dexorder-trade
spec:
secretName: dexorder-trade-tls
commonName: dexorder.trade
dnsNames:
- dexorder.trade
issuerRef:
name: letsencrypt-prod
kind: ClusterIssuer
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: beta-dexorder-trade
spec:
secretName: beta-dexorder-trade-tls
commonName: beta.dexorder.trade
dnsNames:
- beta.dexorder.trade
issuerRef:
name: letsencrypt-prod
kind: ClusterIssuer
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: ws-beta-dexorder-trade-tls
spec:
secretName: ws-beta-dexorder-trade-tls
commonName: ws.beta.dexorder.trade
dnsNames:
- ws.beta.dexorder.trade
issuerRef:
name: letsencrypt-prod
kind: ClusterIssuer
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: rpc-eth-beau-dexorder-trade
namespace: crypto-node
spec:
secretName: rpc-eth-beau-dexorder-trade-tls
commonName: rpc.eth.beau.dexorder.trade
dnsNames:
- rpc.eth.beau.dexorder.trade
issuerRef:
name: letsencrypt-prod
kind: ClusterIssuer
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: ws-eth-beau-dexorder-trade
namespace: crypto-node
spec:
secretName: ws-eth-beau-dexorder-trade-tls
commonName: ws.eth.beau.dexorder.trade
dnsNames:
- ws.eth.beau.dexorder.trade
issuerRef:
name: letsencrypt-prod
kind: ClusterIssuer

248
deploy/k8s/ethereum.yaml Normal file
View File

@@ -0,0 +1,248 @@
---
apiVersion: v1
kind: Secret
metadata:
name: jwt
namespace: crypto-node
data:
# openssl rand -hex 32 | tr -d "\n" | base64
jwt.hex: 'NTlhMTYxNmUyMjhhNjM1MDg0NGZiMzM5ZWU1NTliMzkxYmMzNmIxNWVmY2Q4NjY5NDdlNzc1NDRhZDE0OTk4Zg=='
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: ethereum
namespace: crypto-node
spec:
replicas: 1
serviceName: ethereum
selector:
matchLabels:
app: ethereum
template:
metadata:
labels:
app: ethereum
spec:
terminationGracePeriodSeconds: 120
containers:
- name: lighthouse
image: sigp/lighthouse
command: [
'lighthouse', 'beacon_node',
'--datadir', '/lighthouse',
'--network', 'mainnet',
'--http',
'--http-address', '0.0.0.0',
'--execution-endpoint', 'http://reth:8551',
'--execution-jwt', '/jwt/jwt.hex',
'--checkpoint-sync-url', 'https://mainnet.checkpoint.sigp.io',
'--checkpoint-sync-url-timeout', '300',
'--disable-deposit-contract-sync', # since we are not staking
'--historic-state-cache-size', '4', # hierarchical snap-diff cache
]
volumeMounts:
- name: lighthouse
mountPath: /lighthouse
- name: jwt
mountPath: /jwt
readOnly: true
ports:
- containerPort: 5052
# peering ports (if exposed)
- containerPort: 9000
protocol: TCP
- containerPort: 9000
protocol: UDP
- containerPort: 9001
protocol: UDP
resources:
requests:
cpu: '1'
memory: '2G'
- name: reth
image: ghcr.io/paradigmxyz/reth
command: [
'reth', 'node',
'--datadir', '/reth',
'--authrpc.jwtsecret', '/jwt/jwt.hex',
'--authrpc.addr', '0.0.0.0',
'--authrpc.port', '8551',
'--http',
'--http.addr', '0.0.0.0',
# '--http.api', 'eth,net,trace',
'--http.api', 'eth',
'--ws',
]
volumeMounts:
- name: reth
mountPath: /reth
- name: jwt
mountPath: /jwt
readOnly: true
ports:
# peering ports (if exposed)
- containerPort: 30303
protocol: TCP
- containerPort: 30303
protocol: UDP
# execution port
- containerPort: 8551
protocol: TCP
name: execution
# rpc port
- containerPort: 8545
protocol: TCP
name: rpc
# ws port
- containerPort: 8546
protocol: TCP
name: ws
resources:
requests:
cpu: '2'
memory: '10G'
volumes:
- name: jwt
secret:
secretName: jwt
- name: lighthouse
persistentVolumeClaim:
claimName: lighthouse
- name: reth
persistentVolumeClaim:
claimName: reth
volumeClaimTemplates:
- metadata:
name: lighthouse
spec:
accessModes: [ "ReadWriteOnce" ]
volumeName: lighthouse
storageClassName: bulk-a
resources:
requests:
storage: 2Ti
- metadata:
name: reth
spec:
accessModes: [ "ReadWriteOnce" ]
volumeName: reth
storageClassName: bulk-a
resources:
requests:
storage: 10Ti
#---
#apiVersion: v1
#kind: Service
#metadata:
# name: lighthouse-peers
# namespace: crypto-node
#spec:
# selector:
# app: ethereum
# type: NodePort
# ports:
# - protocol: TCP
# port: 9000
# name: peer1
# - protocol: UDP
# port: 9000
# name: peer2
# - protocol: UDP
# port: 9001
# name: peer3
---
apiVersion: v1
kind: Service
metadata:
name: reth
namespace: crypto-node
spec:
selector:
app: ethereum
ports:
# - protocol: TCP
# port: 30303
# name: peer1
# - protocol: UDP
# port: 30303
# name: peer2
# expose these ports for the lighthouse container
- protocol: TCP
port: 8551
name: execution
- protocol: TCP
port: 8546
name: ws
---
apiVersion: v1
kind: Service
metadata:
name: eth-rpc
namespace: crypto-node
spec:
selector:
app: ethereum
ports:
- protocol: TCP
port: 8545
name: rpc
- protocol: TCP
port: 8546
name: ws
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: eth-rpc
namespace: crypto-node
spec:
ingressClassName: nginx
tls:
- hosts:
- rpc.eth.beau.dexorder.trade
secretName: rpc-eth-beau-dexorder-trade-tls
rules:
- host: rpc.eth.beau.dexorder.trade
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: eth-rpc
port:
number: 8545
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: eth-ws
namespace: crypto-node
annotations:
# websocket connection timeouts
nginx.ingress.kubernetes.io/proxy-read-timeout: "86400"
nginx.ingress.kubernetes.io/proxy-write-timeout: "86400"
spec:
ingressClassName: nginx
tls:
- hosts:
- ws.eth.beau.dexorder.trade
secretName: ws-eth-beau-dexorder-trade-tls
rules:
- host: ws.eth.beau.dexorder.trade
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: eth-rpc
port:
number: 8546

View File

@@ -104,48 +104,3 @@ spec:
name: server
port:
number: 3001
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: dexorder-trade
spec:
secretName: dexorder-trade-tls
commonName: dexorder.trade
dnsNames:
- dexorder.trade
issuerRef:
name: letsencrypt-prod
kind: ClusterIssuer
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: beta-dexorder-trade
spec:
secretName: beta-dexorder-trade-tls
commonName: beta.dexorder.trade
dnsNames:
- beta.dexorder.trade
issuerRef:
name: letsencrypt-prod
kind: ClusterIssuer
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: ws-beta-dexorder-trade-tls
spec:
secretName: ws-beta-dexorder-trade-tls
commonName: ws.beta.dexorder.trade
dnsNames:
- ws.beta.dexorder.trade
issuerRef:
name: letsencrypt-prod
kind: ClusterIssuer

View File

@@ -0,0 +1,43 @@
---
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
name: letsencrypt-prod
spec:
acme:
email: tim@dexorder.trade
server: https://acme-v02.api.letsencrypt.org/directory
privateKeySecretRef:
name: letsencrypt-privkey-prod
solvers:
- http01:
ingress:
ingressClassName: nginx
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: lighthouse
spec:
storageClassName: bulk-a
capacity:
storage: 10Ti
accessModes:
- ReadWriteOnce
hostPath:
path: /var/mnt/bulk/a/lighthouse
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: reth
spec:
storageClassName: bulk-a
capacity:
storage: 10Ti
accessModes:
- ReadWriteOnce
hostPath:
path: /var/mnt/bulk/a/reth

View File

@@ -1,10 +1,11 @@
apiVersion: apps/v1
kind: Deployment
kind: StatefulSet
metadata:
name: redis
labels:
app: redis
spec:
serviceName: "redis"
replicas: 1
selector:
matchLabels:
@@ -15,30 +16,14 @@ spec:
app: redis
spec:
containers:
- name: redis
image: docker.dragonflydb.io/dragonflydb/dragonfly:latest
ports:
- containerPort: 6379
resources:
limits:
cpu: '1'
memory: 2Gi
requests:
cpu: 100m
memory: 500Mi
---
apiVersion: v1
kind: Service
metadata:
name: redis
labels:
app: redis
spec:
selector:
app: redis
ports:
- protocol: TCP
port: 6379
name: redis
- name: redis
image: docker.dragonflydb.io/dragonflydb/dragonfly:latest
ports:
- containerPort: 6379
resources:
limits:
cpu: '1'
memory: 2Gi
requests:
cpu: 100m
memory: 500Mi

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,61 @@
classes:
- name: bulk-a # Defines name of storage classes.
hostDir: /var/mnt/bulk/a
mountDir: /var/mnt/bulk/a
volumeMode: Filesystem
fsType: ext4
namePattern: "*"
allowedTopologies:
blockCleanerCommand:
# Do a quick reset of the block device during its cleanup.
- "/scripts/quick_reset.sh"
# or use dd to zero out block dev in two iterations by uncommenting these lines
# - "/scripts/dd_zero.sh"
# - "2"
# or run shred utility for 2 iteration.s
# - "/scripts/shred.sh"
# - "2"
# or blkdiscard utility by uncommenting the line below.
# - "/scripts/blkdiscard.sh"
storageClass:
reclaimPolicy: Retain
- name: bulk-b # Defines name of storage classes.
hostDir: /var/mnt/bulk/b
mountDir: /var/mnt/bulk/b
volumeMode: Filesystem
fsType: ext4
namePattern: "*"
allowedTopologies:
blockCleanerCommand:
# Do a quick reset of the block device during its cleanup.
- "/scripts/quick_reset.sh"
# or use dd to zero out block dev in two iterations by uncommenting these lines
# - "/scripts/dd_zero.sh"
# - "2"
# or run shred utility for 2 iteration.s
# - "/scripts/shred.sh"
# - "2"
# or blkdiscard utility by uncommenting the line below.
# - "/scripts/blkdiscard.sh"
storageClass:
reclaimPolicy: Retain
- name: fast-a # Defines name of storage classes.
hostDir: /var/mnt/fast/a
mountDir: /var/mnt/fast/a
volumeMode: Filesystem
fsType: ext4
namePattern: "*"
allowedTopologies:
blockCleanerCommand:
# Do a quick reset of the block device during its cleanup.
- "/scripts/quick_reset.sh"
# or use dd to zero out block dev in two iterations by uncommenting these lines
# - "/scripts/dd_zero.sh"
# - "2"
# or run shred utility for 2 iteration.s
# - "/scripts/shred.sh"
# - "2"
# or blkdiscard utility by uncommenting the line below.
# - "/scripts/blkdiscard.sh"
storageClass:
reclaimPolicy: Retain

View File

@@ -1,5 +1,8 @@
1. Create cluster in GKE
2. [Install ingress-nginx](https://kubernetes.github.io/ingress-nginx/deploy/#gce-gke)
1. Create k8s cluster
2. [Install ingress-nginx](https://kubernetes.github.io/ingress-nginx/deploy/)
* for Talos, I deployed nginx as a daemonset using hostPort mode to bind 80/443. This also required changes to the
* `helm upgrade --install ingress-nginx ingress-nginx --repo https://kubernetes.github.io/ingress-nginx --namespace ingress-nginx --create-namespace --values ingress-nginx.helm.yaml`
* local storage https://github.com/kubernetes-sigs/sig-storage-local-static-provisioner/blob/master/helm/README.md#install-local-volume-provisioner-with-helm
3. [Install cert-manager](https://cert-manager.io/docs/installation/kubectl/)
4. `cd deploy/k8s`
5. `kubectl apply -f init-cluster.yaml -f postgres.yaml -f redis.yaml -f ingress.yaml`

2
web

Submodule web updated: 5d3d1d6f5a...a9bf23ddbb