diff --git a/.github/workflows/docker_build.yml b/.github/workflows/docker_build.yml index cdfc9d613..c9c62632f 100644 --- a/.github/workflows/docker_build.yml +++ b/.github/workflows/docker_build.yml @@ -92,5 +92,5 @@ jobs: chmod 600 private_key.pem sudo apt update sudo apt install -y --no-install-recommends openssh-server - ssh -o StrictHostKeyChecking=no -i private_key.pem $USER@$HOST bash -c "'sleep 30' && docker image prune -a -f && docker ps | grep main_debug | awk '{print \$1}' | xargs -r docker stop && docker ps -a | grep main_debug | awk '{print \$1}' | xargs -r docker rm -f && docker pull 'ghcr.io/rooch-network/rooch:main_debug' && docker run --rm -v /root:/root ghcr.io/rooch-network/rooch:main_debug server clean -n dev -f && docker run -d -v /root:/root -p 6767:6767 -p 9184:9184 'ghcr.io/rooch-network/rooch:main_debug' server start -n dev --btc-rpc-url '${{secrets.BTC_REGTEST_RPC_URL}}' --btc-rpc-username rooch-regtest --btc-rpc-password '${{secrets.BTC_REGTEST_RPC_PWD}}' --da '{\"internal-da-server\": {\"servers\": [{\"open-da\": {\"scheme\": \"fs\"}}]}}' --traffic-burst-size 100000 --traffic-per-second 10000" + ssh -o StrictHostKeyChecking=no -i private_key.pem $USER@$HOST bash -c "'sleep 30' && docker image prune -a -f && docker ps | grep main_debug | awk '{print \$1}' | xargs -r docker stop && docker ps -a | grep main_debug | awk '{print \$1}' | xargs -r docker rm -f && docker pull 'ghcr.io/rooch-network/rooch:main_debug' && docker run --rm -v /root:/root ghcr.io/rooch-network/rooch:main_debug server clean -n dev -f && docker run -d -v /root:/root -p 6767:6767 -p 9184:9184 'ghcr.io/rooch-network/rooch:main_debug' server start -n dev --btc-rpc-url '${{secrets.BTC_REGTEST_RPC_URL}}' --btc-rpc-username rooch-regtest --btc-rpc-password '${{secrets.BTC_REGTEST_RPC_PWD}}' --da '{\"internal-da-server\": {\"servers\": [{\"open-da\": {\"scheme\": \"fs\"}}]}}' --traffic-burst-size 100000 --traffic-per-second 1" ssh -o StrictHostKeyChecking=no -i private_key.pem $USER@$HOST "cd /root/rooch && git pull origin main && bash scripts/check_dev_deploy_status.sh main_debug '${{ secrets.TESTNET_MNEMONIC_PHRASE }}'" diff --git a/kube/mainnet/faucet/mainnet-faucet-deployment.yaml b/kube/mainnet/faucet/mainnet-faucet-deployment.yaml new file mode 100644 index 000000000..0a479e03c --- /dev/null +++ b/kube/mainnet/faucet/mainnet-faucet-deployment.yaml @@ -0,0 +1,82 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: mainnet-faucet + namespace: mainnet +spec: + replicas: 1 + selector: + matchLabels: + app: mainnet-faucet + template: + metadata: + labels: + app: mainnet-faucet + spec: + initContainers: + - name: init-rooch + image: ghcr.io/rooch-network/rooch:main + command: ["/bin/sh", "-c"] + args: + - | + if [ ! -f /root/.rooch/initialized ]; then + /rooch/rooch init -m "${INIT_SECRET}" --skip-password + /rooch/rooch env switch --alias main + /rooch/rooch account create + /rooch/rooch account create + /rooch/rooch account create + ls -la /root/.rooch/rooch_config/ + touch /root/.rooch/initialized + fi + env: + - name: INIT_SECRET + valueFrom: + secretKeyRef: + name: rooch-mainnet-secrets + key: init-phrase + volumeMounts: + - name: rooch-data + mountPath: /root + containers: + - name: rooch-faucet + image: ghcr.io/rooch-network/rooch:main + command: ["/rooch/rooch"] + args: + - "faucet" + - "server" + - "--faucet-sender" + # the first account + - "rooch1ps458n8n37rzz3vtseu8unvkzf37udant9d4xhudsu5tv4zpzz4s30nlu0" + - "--faucet-module-address" + - "0x701c21bf1c8cd5af8c42983890d8ca55e7a820171b8e744c13f2d9998bf76cc3" + - "--faucet-object-id" + - "0xd5723eda84f691ae2623da79312c7909b1737c5b3866ecc5dbd6aa21718ff15d" + - "--discord-token" + - "$(DISCORD_TOKEN)" + env: + - name: DISCORD_TOKEN + valueFrom: + secretKeyRef: + name: rooch-mainnet-secrets + key: discord-token + ports: + - containerPort: 6868 + readinessProbe: + httpGet: + path: / + port: 6868 + initialDelaySeconds: 10 + periodSeconds: 5 + livenessProbe: + httpGet: + path: / + port: 6868 + initialDelaySeconds: 15 + periodSeconds: 10 + volumeMounts: + - name: rooch-data + mountPath: /root + volumes: + - name: rooch-data + persistentVolumeClaim: + claimName: mainnet-faucet-data \ No newline at end of file diff --git a/kube/rooch-faucet/rooch-faucet-pvc.yaml b/kube/mainnet/faucet/mainnet-faucet-pvc.yaml similarity index 73% rename from kube/rooch-faucet/rooch-faucet-pvc.yaml rename to kube/mainnet/faucet/mainnet-faucet-pvc.yaml index 84e5b923d..0a55ad4e2 100644 --- a/kube/rooch-faucet/rooch-faucet-pvc.yaml +++ b/kube/mainnet/faucet/mainnet-faucet-pvc.yaml @@ -1,7 +1,8 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: rooch-faucet-data + name: mainnet-faucet-data + namespace: mainnet spec: accessModes: - ReadWriteOnce diff --git a/kube/mainnet/mainnet-ingress.yaml b/kube/mainnet/mainnet-ingress.yaml new file mode 100644 index 000000000..7502b38d5 --- /dev/null +++ b/kube/mainnet/mainnet-ingress.yaml @@ -0,0 +1,38 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: mainnet-ingress + namespace: mainnet + annotations: + kubernetes.io/ingress.global-static-ip-name: "mainnet-ingress-static-ip" + #Note: there is a waring: Warning: annotation "kubernetes.io/ingress.class" is deprecated, please use 'spec.ingressClassName' instead + #But if we set the spec.ingressClassName, it do not worked. + kubernetes.io/ingress.class: "gce" + networking.gke.io/managed-certificates: "mainnet-cert" +spec: + rules: + - host: main-faucet.rooch.network + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: mainnet-faucet-service + port: + number: 6868 +--- +apiVersion: v1 +kind: Service +metadata: + name: mainnet-faucet-service + namespace: mainnet +spec: + type: NodePort + ports: + - port: 6868 + targetPort: 6868 + protocol: TCP + name: http + selector: + app: mainnet-faucet \ No newline at end of file diff --git a/kube/mainnet/managed-cert.yaml b/kube/mainnet/managed-cert.yaml new file mode 100644 index 000000000..cc8182176 --- /dev/null +++ b/kube/mainnet/managed-cert.yaml @@ -0,0 +1,8 @@ +apiVersion: networking.gke.io/v1 +kind: ManagedCertificate +metadata: + name: mainnet-cert + namespace: mainnet +spec: + domains: + - main-faucet.rooch.network \ No newline at end of file diff --git a/kube/mainnet/oracle/mainnet-oracle-binance-deployment.yaml b/kube/mainnet/oracle/mainnet-oracle-binance-deployment.yaml new file mode 100644 index 000000000..851ccf68f --- /dev/null +++ b/kube/mainnet/oracle/mainnet-oracle-binance-deployment.yaml @@ -0,0 +1,68 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: mainnet-oracle-binance + namespace: mainnet +spec: + replicas: 1 + selector: + matchLabels: + app: mainnet-oracle-binance + template: + metadata: + labels: + app: mainnet-oracle-binance + spec: + initContainers: + - name: init-rooch + image: ghcr.io/rooch-network/rooch:main + command: ["/bin/sh", "-c"] + args: + - | + if [ ! -f /root/.rooch/initialized ]; then + /rooch/rooch init -m "${INIT_SECRET}" --skip-password + /rooch/rooch env switch --alias main + /rooch/rooch account create + /rooch/rooch account create + /rooch/rooch account create + ls -la /root/.rooch/rooch_config/ + touch /root/.rooch/initialized + fi + env: + - name: INIT_SECRET + valueFrom: + secretKeyRef: + name: rooch-mainnet-secrets + key: init-phrase + volumeMounts: + - name: rooch-data + mountPath: /root + containers: + - name: rooch-oracle + image: ghcr.io/rooch-network/rooch:main + command: ["/rooch/rooch"] + args: + - "oracle" + - "reporter" + - "--sender" + #the fourth account + - "rooch1mfaa7tnexzyzq3rrcwf5h9u5s3lly7wshcznk69uvn9q4fw5te6qtpwwsg" + - "--oracle-id" + - "0x8316bdaf22b346fcbe43dab84faab08d039cf753a08342164150afcab718c1d2" + - "--oracle-admin-id" + - "0x54dcf30e42ef37ba2fc3f700cecb7f9ab92717247b0e4e8b5e32a54e26ce39cd" + - "--data-source" + - "binance" + - "--ticker" + - "btcusd" + - "--aggregate-strategy" + - "average" + - "--report-interval" + - "10" + volumeMounts: + - name: rooch-data + mountPath: /root + volumes: + - name: rooch-data + persistentVolumeClaim: + claimName: mainnet-oracle-binance-data \ No newline at end of file diff --git a/kube/mainnet/oracle/mainnet-oracle-binance-pvc.yaml b/kube/mainnet/oracle/mainnet-oracle-binance-pvc.yaml new file mode 100644 index 000000000..4c9ab5ae6 --- /dev/null +++ b/kube/mainnet/oracle/mainnet-oracle-binance-pvc.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: mainnet-oracle-binance-data + namespace: mainnet +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi \ No newline at end of file diff --git a/kube/mainnet/oracle/mainnet-oracle-okx-deployment.yaml b/kube/mainnet/oracle/mainnet-oracle-okx-deployment.yaml new file mode 100644 index 000000000..53e37703a --- /dev/null +++ b/kube/mainnet/oracle/mainnet-oracle-okx-deployment.yaml @@ -0,0 +1,68 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: mainnet-oracle-okx + namespace: mainnet +spec: + replicas: 1 + selector: + matchLabels: + app: mainnet-oracle-okx + template: + metadata: + labels: + app: mainnet-oracle-okx + spec: + initContainers: + - name: init-rooch + image: ghcr.io/rooch-network/rooch:main + command: ["/bin/sh", "-c"] + args: + - | + if [ ! -f /root/.rooch/initialized ]; then + /rooch/rooch init -m "${INIT_SECRET}" --skip-password + /rooch/rooch env switch --alias main + /rooch/rooch account create + /rooch/rooch account create + /rooch/rooch account create + ls -la /root/.rooch/rooch_config/ + touch /root/.rooch/initialized + fi + env: + - name: INIT_SECRET + valueFrom: + secretKeyRef: + name: rooch-mainnet-secrets + key: init-phrase + volumeMounts: + - name: rooch-data + mountPath: /root + containers: + - name: rooch-oracle + image: ghcr.io/rooch-network/rooch:main + command: ["/rooch/rooch"] + args: + - "oracle" + - "reporter" + - "--sender" + #the second account + - "rooch13gcqyg5y7ta9tchlpdmk23ck67d95ah0jf5493g2vhas0ktkwdyqgd0vpq" + - "--oracle-id" + - "0x1b83e993dec577fd5ab73aefa04113bcc15b255c80f87ed9fd9ab0f141757a2b" + - "--oracle-admin-id" + - "0x369f16946b39c0800c6fd2fa61e95afd8ce539d75d70eec21fa1fbdee6932d94" + - "--data-source" + - "okx" + - "--ticker" + - "btcusd" + - "--aggregate-strategy" + - "average" + - "--report-interval" + - "10" + volumeMounts: + - name: rooch-data + mountPath: /root + volumes: + - name: rooch-data + persistentVolumeClaim: + claimName: mainnet-oracle-okx-data \ No newline at end of file diff --git a/kube/mainnet/oracle/mainnet-oracle-okx-pvc.yaml b/kube/mainnet/oracle/mainnet-oracle-okx-pvc.yaml new file mode 100644 index 000000000..f0e319dbf --- /dev/null +++ b/kube/mainnet/oracle/mainnet-oracle-okx-pvc.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: mainnet-oracle-okx-data + namespace: mainnet +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi \ No newline at end of file diff --git a/kube/mainnet/oracle/mainnet-oracle-pyth-deployment.yaml b/kube/mainnet/oracle/mainnet-oracle-pyth-deployment.yaml new file mode 100644 index 000000000..3dfcc3615 --- /dev/null +++ b/kube/mainnet/oracle/mainnet-oracle-pyth-deployment.yaml @@ -0,0 +1,68 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: mainnet-oracle-pyth + namespace: mainnet +spec: + replicas: 1 + selector: + matchLabels: + app: mainnet-oracle-pyth + template: + metadata: + labels: + app: mainnet-oracle-pyth + spec: + initContainers: + - name: init-rooch + image: ghcr.io/rooch-network/rooch:main + command: ["/bin/sh", "-c"] + args: + - | + if [ ! -f /root/.rooch/initialized ]; then + /rooch/rooch init -m "${INIT_SECRET}" --skip-password + /rooch/rooch env switch --alias main + /rooch/rooch account create + /rooch/rooch account create + /rooch/rooch account create + ls -la /root/.rooch/rooch_config/ + touch /root/.rooch/initialized + fi + env: + - name: INIT_SECRET + valueFrom: + secretKeyRef: + name: rooch-mainnet-secrets + key: init-phrase + volumeMounts: + - name: rooch-data + mountPath: /root + containers: + - name: rooch-oracle + image: ghcr.io/rooch-network/rooch:main + command: ["/rooch/rooch"] + args: + - "oracle" + - "reporter" + - "--sender" + #the third account + - "rooch1ydvn7z4tlhhm09a8rt29ma0y5apv0aemx02hpndcrhml5aewv2rqvgll6q" + - "--oracle-id" + - "0x4dabcae5783f5c2da59e5ad828a05ba6f0ec02cf91f4f8266be126dc92d6e5c1" + - "--oracle-admin-id" + - "0x719bfa2c592bd3f90188ac5c95f70b3b743970f10fe91da45f3f4a0f781ae34e" + - "--data-source" + - "pyth" + - "--ticker" + - "btcusd" + - "--aggregate-strategy" + - "average" + - "--report-interval" + - "10" + volumeMounts: + - name: rooch-data + mountPath: /root + volumes: + - name: rooch-data + persistentVolumeClaim: + claimName: mainnet-oracle-pyth-data \ No newline at end of file diff --git a/kube/mainnet/oracle/mainnet-oracle-pyth-pvc.yaml b/kube/mainnet/oracle/mainnet-oracle-pyth-pvc.yaml new file mode 100644 index 000000000..9e7b52e8c --- /dev/null +++ b/kube/mainnet/oracle/mainnet-oracle-pyth-pvc.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: mainnet-oracle-pyth-data + namespace: mainnet +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi \ No newline at end of file diff --git a/kube/mainnet/schedule/mainnet-gas-market-schedule-pvc.yaml b/kube/mainnet/schedule/mainnet-gas-market-schedule-pvc.yaml new file mode 100644 index 000000000..681c31962 --- /dev/null +++ b/kube/mainnet/schedule/mainnet-gas-market-schedule-pvc.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: mainnet-gas-market-schedule-data + namespace: mainnet +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi \ No newline at end of file diff --git a/kube/mainnet/schedule/mainnet-gas-market-schedule.yaml b/kube/mainnet/schedule/mainnet-gas-market-schedule.yaml new file mode 100644 index 000000000..e1b99e94d --- /dev/null +++ b/kube/mainnet/schedule/mainnet-gas-market-schedule.yaml @@ -0,0 +1,67 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: mainnet-gas-market-schedule + namespace: mainnet +spec: + replicas: 1 + selector: + matchLabels: + app: mainnet-gas-market-schedule + template: + metadata: + labels: + app: mainnet-gas-market-schedule + spec: + initContainers: + - name: init-rooch + image: ghcr.io/rooch-network/rooch:main + command: ["/bin/sh", "-c"] + args: + - | + if [ ! -f /root/.rooch/initialized ]; then + /rooch/rooch init -m "${INIT_SECRET}" --skip-password + /rooch/rooch env switch --alias main + /rooch/rooch account create + /rooch/rooch account create + /rooch/rooch account create + /rooch/rooch account create + ls -la /root/.rooch/rooch_config/ + touch /root/.rooch/initialized + fi + env: + - name: INIT_SECRET + valueFrom: + secretKeyRef: + name: rooch-mainnet-secrets + key: init-phrase + volumeMounts: + - name: rooch-data + mountPath: /root + containers: + - name: rooch-schedule + image: ghcr.io/rooch-network/rooch:main + command: ["/rooch/rooch"] + args: + - "task" + - "schedule" + - "--sender" + # the five account + - "rooch1h3sv3a79v7ae76tfhchjh87cqtlpvd9v6s8jmzyazqar6eqcua3qs45djk" + - "--checker-function" + - "0x701c21bf1c8cd5af8c42983890d8ca55e7a820171b8e744c13f2d9998bf76cc3::gas_market::exists_new_events" + - "--checker-args" + - "object:0xdd83de197cc2f4829fc5004ce2a0cb1905601eac24a3f11a1e9c99a926c3dab2" + - "--runner-function" + - "0x701c21bf1c8cd5af8c42983890d8ca55e7a820171b8e744c13f2d9998bf76cc3::gas_market::consume_event" + - "--runner-args" + - "object:0xdd83de197cc2f4829fc5004ce2a0cb1905601eac24a3f11a1e9c99a926c3dab2" + - "--checker-interval" + - "5" + volumeMounts: + - name: rooch-data + mountPath: /root + volumes: + - name: rooch-data + persistentVolumeClaim: + claimName: mainnet-gas-market-schedule-data \ No newline at end of file diff --git a/kube/rooch-faucet/rooch-faucet-deployment.yaml b/kube/rooch-faucet/rooch-faucet-deployment.yaml deleted file mode 100644 index 6ed1e125c..000000000 --- a/kube/rooch-faucet/rooch-faucet-deployment.yaml +++ /dev/null @@ -1,57 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: rooch-faucet -spec: - replicas: 1 - selector: - matchLabels: - app: rooch-faucet - template: - metadata: - labels: - app: rooch-faucet - spec: - initContainers: - - name: init-rooch - image: ghcr.io/rooch-network/rooch:v0.7.0 - command: ["/bin/sh", "-c"] - args: - - | - if [ ! -f /root/.rooch/initialized ]; then - /rooch/rooch init -m "${INIT_SECRET}" --skip-password - /rooch/rooch env switch --alias test - ls -la /root/.rooch/rooch_config/ - touch /root/.rooch/initialized - fi - env: - - name: INIT_SECRET - valueFrom: - secretKeyRef: - name: rooch-faucet-secrets - key: init-phrase - volumeMounts: - - name: rooch-data - mountPath: /root - containers: - - name: rooch-faucet - image: ghcr.io/rooch-network/rooch:v0.7.0 - command: ["/rooch-faucet/rooch-faucet"] - args: - - "--discord-token" - - "$(DISCORD_TOKEN)" - - "--faucet-grant-amount" - - "1000000000" - env: - - name: DISCORD_TOKEN - valueFrom: - secretKeyRef: - name: rooch-faucet-secrets - key: discord-token - volumeMounts: - - name: rooch-data - mountPath: /root - volumes: - - name: rooch-data - persistentVolumeClaim: - claimName: rooch-faucet-data \ No newline at end of file diff --git a/kube/testnet/faucet/testnet-faucet-deployment.yaml b/kube/testnet/faucet/testnet-faucet-deployment.yaml new file mode 100644 index 000000000..fcb893ceb --- /dev/null +++ b/kube/testnet/faucet/testnet-faucet-deployment.yaml @@ -0,0 +1,82 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: testnet-faucet + namespace: testnet +spec: + replicas: 1 + selector: + matchLabels: + app: testnet-faucet + template: + metadata: + labels: + app: testnet-faucet + spec: + initContainers: + - name: init-rooch + image: ghcr.io/rooch-network/rooch:main + command: ["/bin/sh", "-c"] + args: + - | + if [ ! -f /root/.rooch/initialized ]; then + /rooch/rooch init -m "${INIT_SECRET}" --skip-password + /rooch/rooch env switch --alias test + /rooch/rooch account create + /rooch/rooch account create + /rooch/rooch account create + ls -la /root/.rooch/rooch_config/ + touch /root/.rooch/initialized + fi + env: + - name: INIT_SECRET + valueFrom: + secretKeyRef: + name: rooch-testnet-secrets + key: init-phrase + volumeMounts: + - name: rooch-data + mountPath: /root + containers: + - name: rooch-faucet + image: ghcr.io/rooch-network/rooch:main + command: ["/rooch/rooch"] + args: + - "faucet" + - "server" + - "--faucet-sender" + # the first account + - "rooch19p2jn4laz0lum2wcnnf9pdqztw5jymqw9etltj3awwwtydkuykwsas4mgf" + - "--faucet-module-address" + - "0x701c21bf1c8cd5af8c42983890d8ca55e7a820171b8e744c13f2d9998bf76cc3" + - "--faucet-object-id" + - "0xd5723eda84f691ae2623da79312c7909b1737c5b3866ecc5dbd6aa21718ff15d" + - "--discord-token" + - "$(DISCORD_TOKEN)" + env: + - name: DISCORD_TOKEN + valueFrom: + secretKeyRef: + name: rooch-testnet-secrets + key: discord-token + ports: + - containerPort: 6868 + readinessProbe: + httpGet: + path: / + port: 6868 + initialDelaySeconds: 10 + periodSeconds: 5 + livenessProbe: + httpGet: + path: / + port: 6868 + initialDelaySeconds: 15 + periodSeconds: 10 + volumeMounts: + - name: rooch-data + mountPath: /root + volumes: + - name: rooch-data + persistentVolumeClaim: + claimName: testnet-faucet-data \ No newline at end of file diff --git a/kube/testnet/faucet/testnet-faucet-pvc.yaml b/kube/testnet/faucet/testnet-faucet-pvc.yaml new file mode 100644 index 000000000..179e66df3 --- /dev/null +++ b/kube/testnet/faucet/testnet-faucet-pvc.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: testnet-faucet-data + namespace: testnet +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi \ No newline at end of file diff --git a/kube/testnet/managed-cert.yaml b/kube/testnet/managed-cert.yaml new file mode 100644 index 000000000..93d0f160a --- /dev/null +++ b/kube/testnet/managed-cert.yaml @@ -0,0 +1,8 @@ +apiVersion: networking.gke.io/v1 +kind: ManagedCertificate +metadata: + name: testnet-cert + namespace: testnet +spec: + domains: + - test-faucet.rooch.network \ No newline at end of file diff --git a/kube/testnet/oracle/testnet-oracle-binance-deployment.yaml b/kube/testnet/oracle/testnet-oracle-binance-deployment.yaml new file mode 100644 index 000000000..18352abe6 --- /dev/null +++ b/kube/testnet/oracle/testnet-oracle-binance-deployment.yaml @@ -0,0 +1,68 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: testnet-oracle-binance + namespace: testnet +spec: + replicas: 1 + selector: + matchLabels: + app: testnet-oracle-binance + template: + metadata: + labels: + app: testnet-oracle-binance + spec: + initContainers: + - name: init-rooch + image: ghcr.io/rooch-network/rooch:main + command: ["/bin/sh", "-c"] + args: + - | + if [ ! -f /root/.rooch/initialized ]; then + /rooch/rooch init -m "${INIT_SECRET}" --skip-password + /rooch/rooch env switch --alias test + /rooch/rooch account create + /rooch/rooch account create + /rooch/rooch account create + ls -la /root/.rooch/rooch_config/ + touch /root/.rooch/initialized + fi + env: + - name: INIT_SECRET + valueFrom: + secretKeyRef: + name: rooch-testnet-secrets + key: init-phrase + volumeMounts: + - name: rooch-data + mountPath: /root + containers: + - name: rooch-oracle + image: ghcr.io/rooch-network/rooch:main + command: ["/rooch/rooch"] + args: + - "oracle" + - "reporter" + - "--sender" + #the fourth account + - "rooch1h7pdshjeyqcfq8x2jj2ddqhdjzhtjyll0jxw39d87aqp483qp8mqrsul3q" + - "--oracle-id" + - "0x5e56b5fe247d3e77997a1a981cc3103c9a1fa9040ba5054cd831c1fdf1c03a6d" + - "--oracle-admin-id" + - "0xc11d4323a12688492f5abd96cb5e5c1854d8a54562e3dec74c5fd46c7623b684" + - "--data-source" + - "binance" + - "--ticker" + - "btcusd" + - "--aggregate-strategy" + - "average" + - "--report-interval" + - "10" + volumeMounts: + - name: rooch-data + mountPath: /root + volumes: + - name: rooch-data + persistentVolumeClaim: + claimName: testnet-oracle-binance-data \ No newline at end of file diff --git a/kube/testnet/oracle/testnet-oracle-binance-pvc.yaml b/kube/testnet/oracle/testnet-oracle-binance-pvc.yaml new file mode 100644 index 000000000..3f701eafd --- /dev/null +++ b/kube/testnet/oracle/testnet-oracle-binance-pvc.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: testnet-oracle-binance-data + namespace: testnet +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi \ No newline at end of file diff --git a/kube/testnet/oracle/testnet-oracle-okx-deployment.yaml b/kube/testnet/oracle/testnet-oracle-okx-deployment.yaml new file mode 100644 index 000000000..3fbe2c154 --- /dev/null +++ b/kube/testnet/oracle/testnet-oracle-okx-deployment.yaml @@ -0,0 +1,68 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: testnet-oracle-okx + namespace: testnet +spec: + replicas: 1 + selector: + matchLabels: + app: testnet-oracle-okx + template: + metadata: + labels: + app: testnet-oracle-okx + spec: + initContainers: + - name: init-rooch + image: ghcr.io/rooch-network/rooch:main + command: ["/bin/sh", "-c"] + args: + - | + if [ ! -f /root/.rooch/initialized ]; then + /rooch/rooch init -m "${INIT_SECRET}" --skip-password + /rooch/rooch env switch --alias test + /rooch/rooch account create + /rooch/rooch account create + /rooch/rooch account create + ls -la /root/.rooch/rooch_config/ + touch /root/.rooch/initialized + fi + env: + - name: INIT_SECRET + valueFrom: + secretKeyRef: + name: rooch-testnet-secrets + key: init-phrase + volumeMounts: + - name: rooch-data + mountPath: /root + containers: + - name: rooch-oracle + image: ghcr.io/rooch-network/rooch:main + command: ["/rooch/rooch"] + args: + - "oracle" + - "reporter" + - "--sender" + #the second account + - "rooch1nt0yvc6dzhcqpl98htp0ygfpr8vz83zns3hs6hzwgsqndt9q7ewqlrhhz8" + - "--oracle-id" + - "0x107ea9cde1caae6bcb97f2939fff45eff81838bfa1fbdca810f37e51f0d26930" + - "--oracle-admin-id" + - "0x39d4d3a82f8bda01c2c3b00ab03892dd5ba44eb062d828bae5322b07daf326d1" + - "--data-source" + - "okx" + - "--ticker" + - "btcusd" + - "--aggregate-strategy" + - "average" + - "--report-interval" + - "10" + volumeMounts: + - name: rooch-data + mountPath: /root + volumes: + - name: rooch-data + persistentVolumeClaim: + claimName: testnet-oracle-okx-data \ No newline at end of file diff --git a/kube/testnet/oracle/testnet-oracle-okx-pvc.yaml b/kube/testnet/oracle/testnet-oracle-okx-pvc.yaml new file mode 100644 index 000000000..8de0083cf --- /dev/null +++ b/kube/testnet/oracle/testnet-oracle-okx-pvc.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: testnet-oracle-okx-data + namespace: testnet +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi \ No newline at end of file diff --git a/kube/testnet/oracle/testnet-oracle-pyth-deployment.yaml b/kube/testnet/oracle/testnet-oracle-pyth-deployment.yaml new file mode 100644 index 000000000..63084c0f5 --- /dev/null +++ b/kube/testnet/oracle/testnet-oracle-pyth-deployment.yaml @@ -0,0 +1,68 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: testnet-oracle-pyth + namespace: testnet +spec: + replicas: 1 + selector: + matchLabels: + app: testnet-oracle-pyth + template: + metadata: + labels: + app: testnet-oracle-pyth + spec: + initContainers: + - name: init-rooch + image: ghcr.io/rooch-network/rooch:main + command: ["/bin/sh", "-c"] + args: + - | + if [ ! -f /root/.rooch/initialized ]; then + /rooch/rooch init -m "${INIT_SECRET}" --skip-password + /rooch/rooch env switch --alias test + /rooch/rooch account create + /rooch/rooch account create + /rooch/rooch account create + ls -la /root/.rooch/rooch_config/ + touch /root/.rooch/initialized + fi + env: + - name: INIT_SECRET + valueFrom: + secretKeyRef: + name: rooch-testnet-secrets + key: init-phrase + volumeMounts: + - name: rooch-data + mountPath: /root + containers: + - name: rooch-oracle + image: ghcr.io/rooch-network/rooch:main + command: ["/rooch/rooch"] + args: + - "oracle" + - "reporter" + - "--sender" + #the third account + - "rooch1n0fhj4dgwsrekglx0pqqertfh5eehv8cphhxhg2tgjdw48u6er5qe3jwh3" + - "--oracle-id" + - "0x1dced3d6de05a08e229fbba350cfffe159e0e123f54c35cca9f6723b0a5b8b1a" + - "--oracle-admin-id" + - "0xdb5988bfeeca0605aacab4d5b426feafa68af0b26d43be7c5eb3e938b4da65eb" + - "--data-source" + - "pyth" + - "--ticker" + - "btcusd" + - "--aggregate-strategy" + - "average" + - "--report-interval" + - "10" + volumeMounts: + - name: rooch-data + mountPath: /root + volumes: + - name: rooch-data + persistentVolumeClaim: + claimName: testnet-oracle-pyth-data \ No newline at end of file diff --git a/kube/testnet/oracle/testnet-oracle-pyth-pvc.yaml b/kube/testnet/oracle/testnet-oracle-pyth-pvc.yaml new file mode 100644 index 000000000..c8df11719 --- /dev/null +++ b/kube/testnet/oracle/testnet-oracle-pyth-pvc.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: testnet-oracle-pyth-data + namespace: testnet +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi \ No newline at end of file diff --git a/kube/testnet/schedule/testnet-gas-market-schedule-pvc.yaml b/kube/testnet/schedule/testnet-gas-market-schedule-pvc.yaml new file mode 100644 index 000000000..032f3786a --- /dev/null +++ b/kube/testnet/schedule/testnet-gas-market-schedule-pvc.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: testnet-gas-market-schedule-data + namespace: testnet +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi \ No newline at end of file diff --git a/kube/testnet/schedule/testnet-gas-market-schedule.yaml b/kube/testnet/schedule/testnet-gas-market-schedule.yaml new file mode 100644 index 000000000..da3203696 --- /dev/null +++ b/kube/testnet/schedule/testnet-gas-market-schedule.yaml @@ -0,0 +1,67 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: testnet-gas-market-schedule + namespace: testnet +spec: + replicas: 1 + selector: + matchLabels: + app: testnet-gas-market-schedule + template: + metadata: + labels: + app: testnet-gas-market-schedule + spec: + initContainers: + - name: init-rooch + image: ghcr.io/rooch-network/rooch:main + command: ["/bin/sh", "-c"] + args: + - | + if [ ! -f /root/.rooch/initialized ]; then + /rooch/rooch init -m "${INIT_SECRET}" --skip-password + /rooch/rooch env switch --alias test + /rooch/rooch account create + /rooch/rooch account create + /rooch/rooch account create + /rooch/rooch account create + ls -la /root/.rooch/rooch_config/ + touch /root/.rooch/initialized + fi + env: + - name: INIT_SECRET + valueFrom: + secretKeyRef: + name: rooch-testnet-secrets + key: init-phrase + volumeMounts: + - name: rooch-data + mountPath: /root + containers: + - name: rooch-schedule + image: ghcr.io/rooch-network/rooch:main + command: ["/rooch/rooch"] + args: + - "task" + - "schedule" + - "--sender" + # the five account + - "rooch1cqqagzda3lsegvz73yp0ga5hppsmpegw06uyusexte4c7fhxg5qqd9x6mw" + - "--checker-function" + - "0x701c21bf1c8cd5af8c42983890d8ca55e7a820171b8e744c13f2d9998bf76cc3::gas_market::exists_new_events" + - "--checker-args" + - "object:0xdd83de197cc2f4829fc5004ce2a0cb1905601eac24a3f11a1e9c99a926c3dab2" + - "--runner-function" + - "0x701c21bf1c8cd5af8c42983890d8ca55e7a820171b8e744c13f2d9998bf76cc3::gas_market::consume_event" + - "--runner-args" + - "object:0xdd83de197cc2f4829fc5004ce2a0cb1905601eac24a3f11a1e9c99a926c3dab2" + - "--checker-interval" + - "5" + volumeMounts: + - name: rooch-data + mountPath: /root + volumes: + - name: rooch-data + persistentVolumeClaim: + claimName: testnet-gas-market-schedule-data \ No newline at end of file diff --git a/kube/testnet/testnet-ingress.yaml b/kube/testnet/testnet-ingress.yaml new file mode 100644 index 000000000..c82291509 --- /dev/null +++ b/kube/testnet/testnet-ingress.yaml @@ -0,0 +1,38 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: testnet-ingress + namespace: testnet + annotations: + kubernetes.io/ingress.global-static-ip-name: "testnet-ingress-static-ip" + #Note: there is a waring: Warning: annotation "kubernetes.io/ingress.class" is deprecated, please use 'spec.ingressClassName' instead + #But if we set the spec.ingressClassName, it do not worked. + kubernetes.io/ingress.class: "gce" + networking.gke.io/managed-certificates: "testnet-cert" +spec: + rules: + - host: test-faucet.rooch.network + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: testnet-faucet-service + port: + number: 6868 +--- +apiVersion: v1 +kind: Service +metadata: + name: testnet-faucet-service + namespace: testnet +spec: + type: NodePort + ports: + - port: 6868 + targetPort: 6868 + protocol: TCP + name: http + selector: + app: testnet-faucet \ No newline at end of file diff --git a/scripts/deploy_rooch_mainnet.sh b/scripts/deploy_rooch_mainnet.sh index 1d8f941b4..80ff63251 100644 --- a/scripts/deploy_rooch_mainnet.sh +++ b/scripts/deploy_rooch_mainnet.sh @@ -18,4 +18,4 @@ docker run -d --name rooch-mainnet --restart unless-stopped -v /data:/root -p 67 --btc-rpc-username rooch-main \ --btc-rpc-password "$BTC_MAIN_RPC_PWD" \ --traffic-burst-size 100000 \ - --traffic-per-second 10000 + --traffic-per-second 1 diff --git a/scripts/deploy_rooch_testnet.sh b/scripts/deploy_rooch_testnet.sh index d4f2f1ee0..a89b97748 100644 --- a/scripts/deploy_rooch_testnet.sh +++ b/scripts/deploy_rooch_testnet.sh @@ -20,5 +20,5 @@ docker run -d --name rooch-testnet --restart unless-stopped -v /data:/root -p 67 --btc-rpc-username rooch-test \ --btc-rpc-password "$BTC_TEST_RPC_PWD" \ --traffic-burst-size 100000 \ - --traffic-per-second 10000 \ + --traffic-per-second 1 \ --da "{\"internal-da-server\": {\"servers\": [{\"open-da\": {\"scheme\": \"gcs\", \"config\": {\"bucket\": \"$OPENDA_GCP_TESTNET_BUCKET\", \"credential\": \"$OPENDA_GCP_TESTNET_CREDENTIAL\"}}}]}}"