Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/ten-protocol/go-ten into je…
Browse files Browse the repository at this point in the history
…nnifer/1958-gateway-assets-fix
  • Loading branch information
Jennievon committed Jun 25, 2024
2 parents 0a825d7 + ddff74a commit a11418c
Show file tree
Hide file tree
Showing 94 changed files with 23,626 additions and 1,305 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-gateway-lib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
steps:
# Check out the repository
- name: Checkout Repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# Set up Node.js
- name: Set up Node.js
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ jobs:
build:
runs-on: self-hosted
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: 1.21.8

Expand Down Expand Up @@ -57,7 +57,7 @@ jobs:
run: go test --failfast -v ./... -count=1 -timeout 5m

- name: Store simulation logs
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: failure()
with:
name: ci-logs
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-gateway-lib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
steps:
# Check out the repository
- name: Checkout Repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# Set up Node.js
- name: Set up Node.js
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/hardhat-pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 18
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/manual-deploy-dexynth-gateway.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
run: |
echo "GitHub Variables = ${{ toJSON(vars) }}"
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: 'Extract branch name'
shell: bash
Expand Down Expand Up @@ -130,10 +130,12 @@ jobs:
-v /proc/:/host/proc/:ro \
-v /opt/datadog-agent/run:/opt/datadog-agent/run:rw \
-v /sys/fs/cgroup/:/host/sys/fs/cgroup:ro \
--log-opt max-file=3 --log-opt max-size=10m \
datadog/agent:latest \
&& cd /home/obscuro/go-obscuro/ \
&& docker run -d -p 80:80 -p 81:81 --name ${{ github.event.inputs.testnet_type }}-OG-${{ GITHUB.RUN_NUMBER }}-dexynth \
-e OBSCURO_GATEWAY_VERSION="${{ GITHUB.RUN_NUMBER }}-${{ GITHUB.SHA }}" \
${{ vars.DOCKER_BUILD_TAG_GATEWAY_DEXYNTH }} \
-host=0.0.0.0 -port=8080 -portWS=81 -nodeHost=${{ vars.L2_RPC_URL_VALIDATOR_DEXYNTH }} -verbose=true \
-logPath=sys_out -dbType=mariaDB -dbConnectionURL="obscurouser:${{ secrets.OBSCURO_GATEWAY_MARIADB_USER_PWD }}@tcp(obscurogateway-mariadb-${{ github.event.inputs.testnet_type }}.uksouth.cloudapp.azure.com:3306)/ogdb"'
--log-opt max-file=3 --log-opt max-size=10m \
${{ vars.DOCKER_BUILD_TAG_GATEWAY_DEXYNTH }} \
-host=0.0.0.0 -port=8080 -portWS=81 -nodeHost=${{ vars.L2_RPC_URL_VALIDATOR_DEXYNTH }} -verbose=true \
-logPath=sys_out -dbType=mariaDB -dbConnectionURL="obscurouser:${{ secrets.OBSCURO_GATEWAY_MARIADB_USER_PWD }}@tcp(obscurogateway-mariadb-${{ github.event.inputs.testnet_type }}.uksouth.cloudapp.azure.com:3306)/ogdb"'
4 changes: 3 additions & 1 deletion .github/workflows/manual-deploy-obscuro-gateway-database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
run: |
echo "GitHub Variables = ${{ toJSON(vars) }}"
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: 'Extract branch name'
shell: bash
Expand Down Expand Up @@ -102,6 +102,7 @@ jobs:
-v /proc/:/host/proc/:ro \
-v /opt/datadog-agent/run:/opt/datadog-agent/run:rw \
-v /sys/fs/cgroup/:/host/sys/fs/cgroup:ro \
--log-opt max-file=3 --log-opt max-size=10m \
datadog/agent:latest \
&& cd /home/obscuro/go-obscuro/ \
&& docker run -d --name ${{ github.event.inputs.testnet_type }}-OG-MariaDB-${{ GITHUB.RUN_NUMBER }} \
Expand All @@ -110,6 +111,7 @@ jobs:
-e MARIADB_USER=obscurouser \
-e MARIADB_PASSWORD=${{ secrets.OBSCURO_GATEWAY_MARIADB_USER_PWD }} \
-v /home/obscuro/go-obscuro/tools/walletextension/storage/database/001_init.sql:/docker-entrypoint-initdb.d/schema.sql \
--log-opt max-file=3 --log-opt max-size=10m \
mariadb:11.1.2-jammy \
--max_password_errors=2'
10 changes: 6 additions & 4 deletions .github/workflows/manual-deploy-obscuro-gateway.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
run: |
echo "GitHub Variables = ${{ toJSON(vars) }}"
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: 'Extract branch name'
shell: bash
Expand Down Expand Up @@ -132,10 +132,12 @@ jobs:
-v /proc/:/host/proc/:ro \
-v /opt/datadog-agent/run:/opt/datadog-agent/run:rw \
-v /sys/fs/cgroup/:/host/sys/fs/cgroup:ro \
--log-opt max-file=3 --log-opt max-size=10m \
datadog/agent:latest \
&& cd /home/obscuro/go-obscuro/ \
&& docker run -d -p 80:80 -p 81:81 --name ${{ github.event.inputs.testnet_type }}-OG-${{ GITHUB.RUN_NUMBER }} \
-e OBSCURO_GATEWAY_VERSION="${{ GITHUB.RUN_NUMBER }}-${{ GITHUB.SHA }}" \
${{ vars.DOCKER_BUILD_TAG_GATEWAY }} \
-host=0.0.0.0 -port=8080 -portWS=81 -nodeHost=${{ vars.L2_RPC_URL_VALIDATOR }} -verbose=true \
-logPath=sys_out -dbType=mariaDB -dbConnectionURL="obscurouser:${{ secrets.OBSCURO_GATEWAY_MARIADB_USER_PWD }}@tcp(obscurogateway-mariadb-${{ github.event.inputs.testnet_type }}.uksouth.cloudapp.azure.com:3306)/ogdb"'
--log-opt max-file=3 --log-opt max-size=10m \
${{ vars.DOCKER_BUILD_TAG_GATEWAY }} \
-host=0.0.0.0 -port=8080 -portWS=81 -nodeHost=${{ vars.L2_RPC_URL_VALIDATOR }} -verbose=true \
-logPath=sys_out -dbType=mariaDB -dbConnectionURL="obscurouser:${{ secrets.OBSCURO_GATEWAY_MARIADB_USER_PWD }}@tcp(obscurogateway-mariadb-${{ github.event.inputs.testnet_type }}.uksouth.cloudapp.azure.com:3306)/ogdb"'
65 changes: 65 additions & 0 deletions .github/workflows/manual-deploy-ten-bridge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Deploys Ten Bridge on Azure for Testnet
# Builds the Ten Bridge image, pushes the image to dockerhub and starts the Ten Bridge on Azure

name: "[M] Deploy Bridge Testnet"
run-name: "[M] Deploy Bridge Testnet ( ${{ github.event.inputs.testnet_type }} )"
on:
workflow_dispatch:
inputs:
testnet_type:
description: "Testnet Type"
required: true
default: "dev-testnet"
type: choice
options:
- "dev-testnet"
- "uat-testnet"
- "sepolia-testnet"

jobs:
build-and-deploy:
runs-on: ubuntu-latest
environment:
name: ${{ github.event.inputs.testnet_type }}
steps:
- name: "Print GitHub variables"
# This is a useful record of what the environment variables were at the time the job ran, for debugging and reference
run: |
echo "GitHub Variables = ${{ toJSON(vars) }}"
- uses: actions/checkout@v3

- name: "Set up Docker"
uses: docker/setup-buildx-action@v1

- name: "Login to Azure docker registry"
uses: azure/docker-login@v1
with:
login-server: testnetobscuronet.azurecr.io
username: testnetobscuronet
password: ${{ secrets.REGISTRY_PASSWORD }}

- name: "Login via Azure CLI"
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}

- name: Build and Push Docker FE Image
run: |
DOCKER_BUILDKIT=1 docker build -t ${{ vars.DOCKER_BUILD_TAG_BRIDGE_FE }} -f ./contracts/src/bridge/frontend/Dockerfile .
docker push ${{ vars.DOCKER_BUILD_TAG_BRIDGE_FE }}
- name: "Deploy FE to Azure Container Instances"
uses: "azure/aci-deploy@v1"
with:
resource-group: ${{ secrets.RESOURCE_GROUP }}
dns-name-label: ${{ github.event.inputs.testnet_type }}-ten-bridge
image: ${{ vars.DOCKER_BUILD_TAG_BRIDGE_FE }}
name: ${{ github.event.inputs.testnet_type }}-fe-ten-bridge
location: "uksouth"
restart-policy: "Never"
environment-variables: NEXT_PUBLIC_BRIDGE_API_HOST=https://${{ github.event.inputs.testnet_type }}-api.tenscan.io NEXT_PUBLIC_FE_VERSION=${{ GITHUB.RUN_NUMBER }}-${{ GITHUB.SHA }}
command-line: npm run start-prod
ports: "80"
cpu: 2
memory: 2
2 changes: 1 addition & 1 deletion .github/workflows/manual-deploy-ten-gateway-frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
echo "Selected Testnet Type: ${{ matrix.testnet_type }}"
echo "Gateway API URL: ${{ matrix.GATEWAY_API_URL }}"
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: 'Extract branch name'
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/manual-deploy-ten-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
run: |
echo "GitHub Variables = ${{ toJSON(vars) }}"
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: "Set up Docker"
uses: docker/setup-buildx-action@v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/manual-deploy-testnet-faucet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
- run: echo "Workflow_dispatch inputs ${{ github.event.inputs.testnet_type }}"
- run: echo "Workflow_call inputs ${{ inputs.testnet_type }}"

- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: 'Set up Docker'
uses: docker/setup-buildx-action@v1
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/manual-deploy-testnet-l1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
run: |
echo "GitHub Variables = ${{ toJSON(vars) }}"
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: 'Set up Docker'
uses: docker/setup-buildx-action@v1
Expand Down Expand Up @@ -125,6 +125,7 @@ jobs:
-v /proc/:/host/proc/:ro \
-v /opt/datadog-agent/run:/opt/datadog-agent/run:rw \
-v /sys/fs/cgroup/:/host/sys/fs/cgroup:ro \
--log-opt max-file=3 --log-opt max-size=10m \
datadog/agent:latest \
&& docker run -d \
-p 8025:8025 -p 8026:8026 -p 9000:9000 -p 9001:9001 \
Expand Down
18 changes: 11 additions & 7 deletions .github/workflows/manual-deploy-testnet-l2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ jobs:
run: |
echo "GitHub Variables = ${{ toJSON(vars) }}"
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: 1.21.8

Expand Down Expand Up @@ -124,7 +124,7 @@ jobs:
done
- name: 'Upload L1 deployer container logs'
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: deploy-l1-artifacts
path: |
Expand Down Expand Up @@ -224,6 +224,9 @@ jobs:
--command-id RunShellScript \
--scripts 'mkdir -p /home/obscuro \
&& git clone --depth 1 -b ${{ env.BRANCH_NAME }} https://github.com/ten-protocol/go-ten.git /home/obscuro/go-obscuro \
&& cp /home/obscuro/go-obscuro/tools/edbconnect/edb-connect.sh /home/obscurouser/edb-connect.sh \
&& chown obscurouser:obscurouser /home/obscurouser/edb-connect.sh \
&& chmod u+x /home/obscurouser/edb-connect.sh \
&& docker network create --driver bridge node_network || true \
&& docker run -d --name datadog-agent \
--network node_network \
Expand All @@ -237,6 +240,7 @@ jobs:
-v /proc/:/host/proc/:ro \
-v /opt/datadog-agent/run:/opt/datadog-agent/run:rw \
-v /sys/fs/cgroup/:/host/sys/fs/cgroup:ro \
--log-opt max-file=3 --log-opt max-size=10m \
datadog/agent:latest \
&& cd /home/obscuro/go-obscuro/ \
&& sudo go run /home/obscuro/go-obscuro/go/node/cmd \
Expand Down Expand Up @@ -271,7 +275,7 @@ jobs:
environment:
name: ${{ github.event.inputs.testnet_type }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: "Wait until obscuro node is healthy"
shell: bash
Expand All @@ -288,7 +292,7 @@ jobs:
environment:
name: ${{ github.event.inputs.testnet_type }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: 'Deploy L2 contracts'
id: deployL2Contracts
Expand All @@ -312,7 +316,7 @@ jobs:
docker logs `docker ps -aqf "name=hh-l2-deployer"` > deploy-l2-contracts.out 2>&1
- name: 'Upload L2 deployer container logs'
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: deploy-l2-artifacts
path: |
Expand All @@ -326,7 +330,7 @@ jobs:
environment:
name: ${{ github.event.inputs.testnet_type }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: 'Login via Azure CLI'
uses: azure/login@v1
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/manual-deploy-testnet-validator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ jobs:
run: |
echo "GitHub Variables = ${{ toJSON(vars) }}"
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: 1.21.8

Expand Down Expand Up @@ -163,6 +163,7 @@ jobs:
-v /proc/:/host/proc/:ro \
-v /opt/datadog-agent/run:/opt/datadog-agent/run:rw \
-v /sys/fs/cgroup/:/host/sys/fs/cgroup:ro \
--log-opt max-file=3 --log-opt max-size=10m \
datadog/agent:latest \
&& cd /home/obscuro/go-obscuro/ \
&& sudo go run /home/obscuro/go-obscuro/go/node/cmd \
Expand Down Expand Up @@ -200,7 +201,7 @@ jobs:
# environment:
# name: ${{ github.event.inputs.testnet_type }}
# steps:
# - uses: actions/checkout@v3
# - uses: actions/checkout@v4
#
# - name: 'Login via Azure CLI'
# uses: azure/login@v1
Expand Down Expand Up @@ -229,7 +230,7 @@ jobs:
environment:
name: ${{ github.event.inputs.testnet_type }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: "Wait until obscuro node is healthy"
shell: bash
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/manual-publish-edb-connect.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Publishes the latest version of edb-connect to the Azure Container Registry
# Users will then have access to this latest version when they run the edb-connect.sh script on the node VMs.

name: "[M] Publish EDB Connect"
run-name: "[M] Publish EDB Connect"
on:
workflow_dispatch:

jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: "Set up Docker"
uses: docker/setup-buildx-action@v1

- name: "Login to Azure docker registry"
uses: azure/docker-login@v1
with:
login-server: testnetobscuronet.azurecr.io
username: testnetobscuronet
password: ${{ secrets.REGISTRY_PASSWORD }}

- name: "Login via Azure CLI"
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}

- name: Build and Push Docker EDB Connect Image
run: |
DOCKER_BUILDKIT=1 docker build -t ${{ vars.DOCKER_BUILD_TAG_EDB_CONNECT }} -f ./tools/edbconnect/Dockerfile .
docker push ${{ vars.DOCKER_BUILD_TAG_EDB_CONNECT }}
4 changes: 2 additions & 2 deletions .github/workflows/manual-recover-network-funds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
run: |
echo "GitHub Variables = ${{ toJSON(vars) }}"
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: 'Login to Azure docker registry'
uses: azure/docker-login@v1
Expand Down Expand Up @@ -65,7 +65,7 @@ jobs:
docker logs `docker ps -aqf "name=recover-funds"` > recover-funds.out 2>&1
- name: 'Upload container logs on failure'
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: failure()
with:
name: recover-funds
Expand Down
Loading

0 comments on commit a11418c

Please sign in to comment.