diff --git a/.dockerignore b/.dockerignore
index 74fcc64c..5658d0f7 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -1,6 +1,4 @@
-node_modules
-/packages/core/node_modules
-/packages/example/node_modules
+**/node_modules
npm-debug.log
Dockerfile
.dockerignore
diff --git a/.github/workflows/deploy_ecs-config-server_STAGE.yaml b/.github/workflows/deploy_ecs-config-server_STAGE.yaml
new file mode 100644
index 00000000..2689cd9c
--- /dev/null
+++ b/.github/workflows/deploy_ecs-config-server_STAGE.yaml
@@ -0,0 +1,58 @@
+name: Deploy ECS Config Server
+
+on:
+ push:
+ branches:
+ - main
+
+# on:
+# workflow_run:
+# workflows:
+# - Docker build and push
+# branches:
+# - main
+# types:
+# - completed
+
+env:
+ AWS_REGION: "us-east-2"
+ ECR_REPOSITORY: config-server-stage
+ ENVIRONMENT: STAGE
+
+jobs:
+ deploy:
+ name: Deploy Config Server
+ runs-on: ubuntu-18.04
+
+ permissions:
+ contents: read
+ id-token: write
+
+ steps:
+ - uses: actions/checkout@v2
+ - run: sleep 5
+ - name: Configure AWS Credentials
+ uses: aws-actions/configure-aws-credentials@v1
+ with:
+ role-to-assume: arn:aws:iam::852551629426:role/github-actions-${{ env.ENVIRONMENT }}-chainbridge
+ aws-region: ${{ env.AWS_REGION }}
+ role-session-name: GithubActions
+
+ - name: Login to Amazon ECR
+ id: login-ecr
+ uses: aws-actions/amazon-ecr-login@v1
+
+ - name: Build, tag, and push image to Amazon ECR
+ env:
+ ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
+ run: |
+ docker build -f ./server.dockerfile -t $ECR_REGISTRY/$ECR_REPOSITORY:${{ env.ENVIRONMENT }} .
+ docker push $ECR_REGISTRY/$ECR_REPOSITORY:${{ env.ENVIRONMENT }}
+
+ - name: Deploy to Amazon ECS
+ uses: aws-actions/amazon-ecs-deploy-task-definition@v1
+ with:
+ task-definition: ecs/task_definition-config-server-${{ env.ENVIRONMENT }}.json
+ service: config-server-service-${{ env.ENVIRONMENT }}
+ cluster: config-server-${{ env.ENVIRONMENT }}
+ wait-for-service-stability: true
\ No newline at end of file
diff --git a/.github/workflows/deploy_ecs-explorer-ui_STAGE.yaml b/.github/workflows/deploy_ecs-explorer-ui_STAGE.yaml
new file mode 100644
index 00000000..93faeec5
--- /dev/null
+++ b/.github/workflows/deploy_ecs-explorer-ui_STAGE.yaml
@@ -0,0 +1,59 @@
+# name: Deploy ECS Explorer UI
+
+# on:
+# push:
+# branches:
+# - devops/ecs-services
+# # on:
+# # workflow_run:
+# # workflows:
+# # - Docker build and push
+# # branches:
+# # - main
+# # types:
+# # - completed
+
+# env:
+# AWS_REGION: "us-east-2"
+# ECR_REPOSITORY: explorer-ui-stage
+# ENVIRONMENT: STAGE
+
+# jobs:
+# deploy:
+# name: Deploy Explorer UI
+# runs-on: ubuntu-18.04
+
+# permissions:
+# contents: read
+# id-token: write
+
+# steps:
+# - uses: actions/checkout@v2
+# - run: sleep 5
+# - name: Configure AWS Credentials
+# uses: aws-actions/configure-aws-credentials@v1
+# with:
+# role-to-assume: arn:aws:iam::852551629426:role/github-actions-${{ env.ENVIRONMENT }}-chainbridge
+# aws-region: ${{ env.AWS_REGION }}
+# role-session-name: GithubActions
+
+# - name: Login to Amazon ECR
+# id: login-ecr
+# uses: aws-actions/amazon-ecr-login@v1
+
+# - name: Build, tag, and push image to Amazon ECR
+# env:
+# ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
+# run: |
+# cp yarn.lock packages/explorer-ui
+# cd packages/explorer-ui
+# docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:${{ env.ENVIRONMENT }} .
+# docker push $ECR_REGISTRY/$ECR_REPOSITORY:${{ env.ENVIRONMENT }}
+
+# - name: Deploy to Amazon ECS
+# uses: aws-actions/amazon-ecs-deploy-task-definition@v1
+# with:
+# task-definition: ecs/task_definition-explorer-ui-${{ env.ENVIRONMENT }}.json
+# service: explorer-ui-service-${{ env.ENVIRONMENT }}
+# cluster: explorer-ui-${{ env.ENVIRONMENT }}
+# wait-for-service-stability: true
\ No newline at end of file
diff --git a/.github/workflows/deploy_ecs-transfer-ui_STAGE.yaml b/.github/workflows/deploy_ecs-transfer-ui_STAGE.yaml
new file mode 100644
index 00000000..6f867ade
--- /dev/null
+++ b/.github/workflows/deploy_ecs-transfer-ui_STAGE.yaml
@@ -0,0 +1,60 @@
+name: Deploy ECS Transfer UI
+
+on:
+ push:
+ branches:
+ - main
+
+# on:
+# workflow_run:
+# workflows:
+# - Docker build and push
+# branches:
+# - main
+# types:
+# - completed
+
+env:
+ AWS_REGION: "us-east-2"
+ ECR_REPOSITORY: transfer-ui-stage
+ ENVIRONMENT: STAGE
+
+jobs:
+ deploy:
+ name: Deploy Transfer UI
+ runs-on: ubuntu-18.04
+
+ permissions:
+ contents: read
+ id-token: write
+
+ steps:
+ - uses: actions/checkout@v2
+ - run: sleep 5
+ - name: Configure AWS Credentials
+ uses: aws-actions/configure-aws-credentials@v1
+ with:
+ role-to-assume: arn:aws:iam::852551629426:role/github-actions-${{ env.ENVIRONMENT }}-chainbridge
+ aws-region: ${{ env.AWS_REGION }}
+ role-session-name: GithubActions
+
+ - name: Login to Amazon ECR
+ id: login-ecr
+ uses: aws-actions/amazon-ecr-login@v1
+
+ - name: Build, tag, and push image to Amazon ECR
+ env:
+ ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
+ CONFIG_SERVER_HOST: config-server-stage.chainsafe.io
+ CONFIG_SERVER_PORT: 443
+ run: |
+ docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:${{ env.ENVIRONMENT }} --build-arg CONFIG_SERVER_HOST=$CONFIG_SERVER_HOST --build-arg CONFIG_SERVER_PORT=$CONFIG_SERVER_PORT .
+ docker push $ECR_REGISTRY/$ECR_REPOSITORY:${{ env.ENVIRONMENT }}
+
+ - name: Deploy to Amazon ECS
+ uses: aws-actions/amazon-ecs-deploy-task-definition@v1
+ with:
+ task-definition: ecs/task_definition-transfer-ui-${{ env.ENVIRONMENT }}.json
+ service: transfer-ui-service-${{ env.ENVIRONMENT }}
+ cluster: transfer-ui-${{ env.ENVIRONMENT }}
+ wait-for-service-stability: true
\ No newline at end of file
diff --git a/Dockerfile b/Dockerfile
index ebe7daeb..6ebd8d4d 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -3,12 +3,23 @@ FROM node:14-alpine AS builder
RUN apk --no-cache add git
WORKDIR /app
COPY . .
-RUN yarn install --frozen-lockfile
+RUN yarn install --frozen-lockfile --network-timeout 100000
RUN ls -al
RUN yarn build:core
RUN ls -al ./packages/core
+
+ARG CONFIG_SERVER_HOST
+ARG CONFIG_SERVER_PORT
+
+RUN sh create-env-file.sh REACT_APP_CONFIG_SERVER_HOST=$CONFIG_SERVER_HOST REACT_APP_CONFIG_SERVER_PORT=$CONFIG_SERVER_PORT
+CMD ["cat", "./packages/exmaple/.env"]
+
RUN yarn build:ui
+# If you want to debug the .env file, uncomment the following line
+# CMD ["cat", ".env"]
+
FROM nginx:1.19-alpine AS server
COPY ./etc/nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=builder ./app/packages/example/build /usr/share/nginx/html
+EXPOSE 8000
diff --git a/README.md b/README.md
index eb03cc54..4da78dc0 100644
--- a/README.md
+++ b/README.md
@@ -1,11 +1,11 @@
-

+
-# ChainbridgeUI
+# SygmaUI
## Introduction
-**Chainbridge UI** is an OpenSource (under GNU Lesser General Public License v3.0) whitelabel application for developers
-to work with Chainsafe [Chainbridge](https://github.com/ChainSafe/chainbridge-core). UI consist of two part:
-BridgeUI is used to interact with [Bridge](https://github.com/chainsafe/chainbridge-solidity) smart contracts
+**Sygma UI** is an OpenSource (under GNU Lesser General Public License v3.0) whitelabel application for developers
+to work with [Sygma](https://github.com/ChainSafe/sygma). UI consist of two part:
+BridgeUI is used to interact with [Bridge](https://github.com/chainsafe/sygma-solidity) smart contracts
in order to send deposits.
ExplorerUI is used to track and navigate every bridging that happens over specific Bridge smart contract.
@@ -17,10 +17,221 @@ It requires you to have MetaMask wallet and to have some ETH on those network in
***NOTE*** this is under an active development so can be broken occasionally.
## Running locally
-TODO
+
+For you to run our **UI** locally you need a couple of dependencies. As this is a bridge project, it needs some running parts before even using the UI in the browser.
+
+### Requisites
+
+Before running our bridge code you will need to have installed `golang`, `docker` and `docker-compose`. Follow the instructions here for installing those dependencies:
+
+* golang -> [install](https://go.dev/doc/install)
+* docker -> [install](https://docs.docker.com/engine/install/)
+* docker-compose -> [install](https://docs.docker.com/compose/install/)
+
+In order for your to bridge tokens from one network to another, you are going to need to clone [Sygma](https://github.com/ChainSafe/sygma). This project contains everything you need to run a bridge with two `evm` networks, and all the contracts deployed. Check the [README](https://github.com/ChainSafe/sygma/blob/main/README.md) and follow the instructions to install and have everything ready.
+
+After you cloned `sygma` you can run the following command:
+
+```bash
+make example
+```
+
+This command is going to run a script that creates two evm nodes and I will run three relayers. After this is going to deploy all the contracts to the `evm` nodes. This process could take a couple of minutes to complete. After that, you are going to see something like this message:
+
+```bash
+===============================================
+🎉🎉🎉 Sygma Successfully Deployed 🎉🎉🎉
+
+- Chain 1 -
+Bridge: 0xd606A00c1A39dA53EA7Bb3Ab570BBE40b156EB66
+ERC20: 0x75dF75bcdCa8eA2360c562b4aaDBAF3dfAf5b19b
+ERC20 Handler: 0xb83065680e6AEc805774d8545516dF4e936F0dC0
+ERC721: 0xb911DF90bCccd3D76a1d8f5fDcd32471e28Cc2c1
+ERC721 Handler: 0x05C5AFACf64A6082D4933752FfB447AED63581b1
+Generic Handler: 0x7573B1c6de00a73e98CDac5Cd2c4a252BdC87600
+Asset Store: 0x3cA3808176Ad060Ad80c4e08F30d85973Ef1d99e
+ERC20 resourceId: 0x0000000000000000000000000000000000000000000000000000000000000000
+ERC721 resourceId 0x0000000000000000000000000000000000000000000000000000000000000200
+Generic resourceId 0x0000000000000000000000000000000000000000000000000000000000000100
+
+- Chain 2 -
+Bridge: 0xd606A00c1A39dA53EA7Bb3Ab570BBE40b156EB66
+ERC20: 0x75dF75bcdCa8eA2360c562b4aaDBAF3dfAf5b19b
+ERC20 Handler: 0xb83065680e6AEc805774d8545516dF4e936F0dC0
+ERC721: 0xb911DF90bCccd3D76a1d8f5fDcd32471e28Cc2c1
+ERC721 Handler: 0x05C5AFACf64A6082D4933752FfB447AED63581b1
+Generic Handler: 0x7573B1c6de00a73e98CDac5Cd2c4a252BdC87600
+Asset Store: 0x3cA3808176Ad060Ad80c4e08F30d85973Ef1d99e
+ERC20 resourceId: 0x0000000000000000000000000000000000000000000000000000000000000000
+ERC721 resourceId 0x0000000000000000000000000000000000000000000000000000000000000200
+Generic resourceId 0x0000000000000000000000000000000000000000000000000000000000000100
+
+===============================================
+```
+
+This means that you have all the address that you need to run the UI locally.
+
+A quick note aside: if you want to check the logs of your nodes or the relayers, you can go `/e2e/evm-evm` folder and run the following command:
+
+```bash
+# inside the root directory of sygma
+cd example
+docker-compose -f ./docker-compose.yml logs setup
+```
+
+This is going to output the `relayer1` logs. You can also run the command with the `-f` flag to follow the output of your services. If you want to see all the logs of your services just run `docker-compose -f docker-compose.yml logs -f`.
+
+After you get the address for the contracts deployed on your local setup, we need to add this to the `runtime` config of our UI.
+
+Go to `/packages/example` that contains our full UI, and inside the config folder, edit the `sygma-runtime-config.evm.js` file with the addresses that you got after the deploy.
+
+You will end up with something like this:
+
+```js
+window.__RUNTIME_CONFIG__ = {
+ INDEXER__URL: "http://localhost:8000",
+ SYGMA: {
+ chains: [
+ {
+ domainId: 1,
+ networkId: 422,
+ name: "Local EVM 1",
+ decimals: 18,
+ bridgeAddress: "0xd606A00c1A39dA53EA7Bb3Ab570BBE40b156EB66",
+ erc20HandlerAddress: "0xb83065680e6AEc805774d8545516dF4e936F0dC0",
+ rpcUrl: "http://localhost:8545",
+ type: "Ethereum",
+ nativeTokenSymbol: "ETH",
+ tokens: [
+ {
+ address: "0x75dF75bcdCa8eA2360c562b4aaDBAF3dfAf5b19b",
+ name: "an ERC20",
+ symbol: "ERC20",
+ imageUri: "WETHIcon",
+ resourceId:
+ "0x0000000000000000000000000000000000000000000000000000000000000200",
+ },
+ ],
+ },
+ {
+ domainId: 2,
+ networkId: 422,
+ name: "Local EVM 2",
+ decimals: 18,
+ bridgeAddress: "0xd606A00c1A39dA53EA7Bb3Ab570BBE40b156EB66",
+ erc20HandlerAddress: "0xb83065680e6AEc805774d8545516dF4e936F0dC0",
+ rpcUrl: "http://localhost:8547",
+ type: "Ethereum",
+ nativeTokenSymbol: "ETH",
+ tokens: [
+ {
+ address: "0x75dF75bcdCa8eA2360c562b4aaDBAF3dfAf5b19b",
+ name: "an ERC20",
+ symbol: "ERC20",
+ imageUri: "WETHIcon",
+ resourceId:
+ "0x0000000000000000000000000000000000000000000000000000000000000200",
+ },
+ ],
+ },
+ ],
+ },
+};
+```
+
+**note: the parameters `domainId` and `networkId` are the ones that are being used by the local networks**
+
+Then you can start the UI and you can try to connect using metamask. For this you will also need to add the local nodes to the `networks` section of your metamaks. The relevant data to setup local networks on metamaks are the endpoints of the networks, already defined in the runtime config, and the `chainId` also already defined in the runtime config as `networkId`.
+
+After this you will also need to import the token to your metamask wallet. Notice that the local nodes have some accounts that hold some tokens. You can check those accounts and the private keys of them.
+
+In the case of the local setup `alice`, `bob` and `charlie` are some of the accounts with tokens. Also the three of the are the main relayers. So, if you want to import `alice` account to metamask, you will need to use her private key:
+
+This is are the most relevant private keys
+
+```bash
+0x000000000000000000000000000000000000000000000000000000616c696365 // ALICE PRIVATE KEY
+0x0000000000000000000000000000000000000000000000000000000000657665 // EVE PRIVATE KEY
+```
+
+`Eve` is the bridge admin. She holds 10 `erc20` tokens on her side. `Alice` has native tokens that you can transfer using metamask to your personal account. It is recommended that you don't use relayers accounts to test transfers in your local setup. For this you can use [sygma-core-example](https://github.com/ChainSafe/sygma-core-example) to build the binary and have access to the cli to perform some task.
+### Minting some tokens.
+
+
+Now we are ready to mint some tokens. Eve has 10 TST tokens already minted, but we can mint more.
+
+```bash
+./sygma-core-example \
+evm-cli \
+--url \
+--private-key \
+erc20 \
+mint \
+--amount 200 \
+--decimals 18 \
+--contract
+--recipient
+```
+
+So using `Eve` private key you would have the following command:
+
+```bash
+./sygma-core-example \
+evm-cli \
+--url "http://localhost:8545" \
+--private-key "0000000000000000000000000000000000000000000000000000000000657665" \
+erc20 \
+mint \
+--amount 666 \
+--decimals 18 \
+--recipient "0x56A492AdbEFEC91a7A23031787B372bc80fEE7B1" \
+--contract "0x75dF75bcdCa8eA2360c562b4aaDBAF3dfAf5b19b"
+
+```
+
+After minting some tokens, you can send a few to your imported account in order for you to test a transfer or you just can mint to your testing account in metamask.
+
+## Starting UI
+First install dependencies
+```bash
+yarn install
+```
+Then build a core ui library
+```bash
+yarn build:core
+```
+Finally run ui
+```bash
+yarn start:ui
+```
+
+And that's it, you are going to see the UI connected to local networks
+
+## Deployment configuration for AWS
+The configuration consists of nodejs server which pulls the config from SSM and provides it as JSON for TransferUI frontend application.
+So we need to deploy two services:
+### [config-server](../packages/config-server)
+Environment variables for AWS:
+
+- AWS_ACCESS_KEY_ID
+- AWS_SECRET_ACCESS_KEY
+- AWS_SESSION_TOKEN
+
+Environment variables for configuration nodejs application:
+
+- HOST=localhost (could be any other host)
+- PORT=8000
+- SSM_PARAMETER_NAME=/chainbridge/chainbridge-ui-local (i’ve created test parameter in SSM but it could any other new param like /chainbridge/chainbridge-ui-prod or such)
+
+### [transfer-ui](../packages/example)
+environment variables:
+- CONFIG_SERVER_HOST=localhost (the host of config server)
+- CONFIG_SERVER_PORT=8000 ( the port of config server)
+For ease of understanding config, I created [docker-compose.yml](../docker-compose.yml) with all this services and env examples and dockerfiles for transfer UI and for config-server (edited)
+
## FAQ
-Please check our [Q&A section](https://github.com/ChainSafe/chainbridge-ui/discussions/categories/q-a)
+Please check our [Q&A section](https://github.com/ChainSafe/sygma-ui/discussions/categories/q-a)
## Support
diff --git a/assets/chainsafe_logo.png b/assets/chainsafe_logo.png
deleted file mode 100644
index eee4cbc3..00000000
Binary files a/assets/chainsafe_logo.png and /dev/null differ
diff --git a/assets/full-logo.png b/assets/full-logo.png
new file mode 100644
index 00000000..b8611089
Binary files /dev/null and b/assets/full-logo.png differ
diff --git a/create-env-file.sh b/create-env-file.sh
new file mode 100644
index 00000000..c3c519e1
--- /dev/null
+++ b/create-env-file.sh
@@ -0,0 +1,6 @@
+touch .env
+
+for envvar in "$@"
+do
+ echo "$envvar" >> ./packages/example/.env
+done
\ No newline at end of file
diff --git a/docker-compose.yml b/docker-compose.yml
new file mode 100644
index 00000000..d5566400
--- /dev/null
+++ b/docker-compose.yml
@@ -0,0 +1,23 @@
+version: '3' # specify docker-compose version
+
+services:
+ config-server:
+ build:
+ context: ./
+ dockerfile: server.dockerfile
+ ports:
+ - "8000:8000" # specify port mapping
+ environment:
+ - HOST=localhost
+ - PORT=8000
+
+ transfer-ui:
+ build:
+ context: ./
+ dockerfile: Dockerfile
+ args:
+ - CONFIG_SERVER_HOST=localhost
+ - CONFIG_SERVER_PORT=8000
+ ports:
+ - "3002:80" # specify port mapping
+
diff --git a/ecs/task_definition-config-server-STAGE.json b/ecs/task_definition-config-server-STAGE.json
new file mode 100644
index 00000000..f5b55e73
--- /dev/null
+++ b/ecs/task_definition-config-server-STAGE.json
@@ -0,0 +1,144 @@
+{
+ "containerDefinitions": [
+ {
+ "name": "config-server-container-STAGE",
+ "essential": true,
+ "image": "852551629426.dkr.ecr.us-east-2.amazonaws.com/config-server-stage:STAGE",
+ "logConfiguration": {
+ "logDriver": "awsfirelens",
+ "options": {
+ "provider": "ecs",
+ "dd_service": "config-server",
+ "dd_tags": "env:STAGE,project:chainexplorer",
+ "dd_message_key": "log",
+ "Host": "http-intake.logs.datadoghq.com",
+ "TLS": "on",
+ "dd_source": "config-server-container-STAGE",
+ "Name": "datadog"
+ },
+ "secretOptions": [
+ {
+ "name": "apikey",
+ "valueFrom": "arn:aws:ssm:us-east-2:852551629426:parameter/common/datadog/key"
+ }
+ ]
+ },
+ "portMappings": [
+ {
+ "containerPort": 8000,
+ "hostPort": 8000,
+ "protocol": "tcp"
+ }
+ ],
+ "environment": [
+ {
+ "value": "config-server",
+ "name": "DD_SERVICE"
+ },
+ {
+ "name": "PORT",
+ "value": "8000"
+ },
+ {
+ "name": "HOST",
+ "value": "localhost"
+ },
+ {
+ "name": "SSM_PARAMETER_NAME",
+ "value": "/chainbridge/chainbridge-ui/configuration"
+ }
+ ],
+ },
+ {
+ "name": "datadog-agent",
+ "image": "gcr.io/datadoghq/agent:latest",
+ "essential": true,
+ "logConfiguration": {
+ "logDriver": "awslogs",
+ "options": {
+ "awslogs-group": "/ecs/config-server-STAGE",
+ "awslogs-region": "us-east-2",
+ "awslogs-stream-prefix": "ecs"
+ }
+ },
+ "portMappings": [
+ {
+ "hostPort": 8126,
+ "protocol": "tcp",
+ "containerPort": 8126
+ }
+ ],
+ "command": [],
+ "cpu": 0,
+ "environment": [
+ {
+ "name": "DD_APM_ENABLED",
+ "value": "true"
+ },
+ {
+ "name": "DD_APM_NON_LOCAL_TRAFFIC",
+ "value": "true"
+ },
+ {
+ "name": "DD_TAGS",
+ "value": "env:STAGE,project:config-server"
+ },
+ {
+ "name": "ECS_FARGATE",
+ "value": "true"
+ },
+ {
+ "name": "ENV",
+ "value": "STAGE"
+ }
+ ],
+ "secrets": [
+ {
+ "name": "DD_API_KEY",
+ "valueFrom": "arn:aws:ssm:us-east-2:852551629426:parameter/common/datadog/key"
+ }
+ ],
+ "mountPoints" : [],
+ "volumesFrom" : []
+ },
+ {
+ "name": "log_router",
+ "image": "906394416424.dkr.ecr.us-east-2.amazonaws.com/aws-for-fluent-bit:latest",
+ "essential": true,
+ "firelensConfiguration": {
+ "type": "fluentbit",
+ "options": {
+ "enable-ecs-log-metadata": "true"
+ }
+ },
+ "logConfiguration": {
+ "logDriver": "awslogs",
+ "options": {
+ "awslogs-group": "/ecs/config-server-STAGE",
+ "awslogs-region": "us-east-2",
+ "awslogs-stream-prefix": "ecs"
+ }
+ },
+ "portMappings": [],
+ "command": [],
+ "cpu": 0,
+ "environment": [],
+ "mountPoints": [],
+ "user": "0",
+ "volumesFrom": []
+ }
+ ],
+ "cpu": "256",
+ "executionRoleArn": "arn:aws:iam::852551629426:role/config-server-ecsTaskExecutionRole",
+ "taskRoleArn": "arn:aws:iam::852551629426:role/config-server-ecsTaskRole",
+ "family": "config-server-container-STAGE",
+ "memory": "512",
+ "networkMode": "awsvpc",
+ "runtimePlatform": {
+ "operatingSystemFamily": "LINUX"
+ },
+
+ "requiresCompatibilities": [
+ "FARGATE"
+ ]
+}
diff --git a/ecs/task_definition-explorer-ui-STAGE.json b/ecs/task_definition-explorer-ui-STAGE.json
new file mode 100644
index 00000000..40c652e8
--- /dev/null
+++ b/ecs/task_definition-explorer-ui-STAGE.json
@@ -0,0 +1,138 @@
+{
+ "containerDefinitions": [
+ {
+ "name": "explorer-ui-container-STAGE",
+ "essential": true,
+ "image": "852551629426.dkr.ecr.us-east-2.amazonaws.com/explorer-ui-stage:STAGE",
+ "logConfiguration": {
+ "logDriver": "awsfirelens",
+ "options": {
+ "provider": "ecs",
+ "dd_service": "explorer-ui",
+ "dd_tags": "env:STAGE,project:chainexplorer",
+ "dd_message_key": "log",
+ "Host": "http-intake.logs.datadoghq.com",
+ "TLS": "on",
+ "dd_source": "explorer-ui-container-STAGE",
+ "Name": "datadog"
+ },
+ "secretOptions": [
+ {
+ "name": "apikey",
+ "valueFrom": "arn:aws:ssm:us-east-2:852551629426:parameter/common/datadog/key"
+ }
+ ]
+ },
+ "portMappings": [
+ {
+ "containerPort": 8000,
+ "hostPort": 8000,
+ "protocol": "tcp"
+ }
+ ],
+ "environment": [
+ {
+ "value": "explorer-ui",
+ "name": "DD_SERVICE"
+ }
+ ],
+ "secrets": [
+ {
+ "name": "mychainexplorersecret",
+ "valueFrom": "arn:aws:ssm:us-east-2:852551629426:parameter/chainexplorer/example"
+ }
+ ]
+ },
+ {
+ "name": "datadog-agent",
+ "image": "gcr.io/datadoghq/agent:latest",
+ "essential": true,
+ "logConfiguration": {
+ "logDriver": "awslogs",
+ "options": {
+ "awslogs-group": "/ecs/explorer-ui-STAGE",
+ "awslogs-region": "us-east-2",
+ "awslogs-stream-prefix": "ecs"
+ }
+ },
+ "portMappings": [
+ {
+ "hostPort": 8126,
+ "protocol": "tcp",
+ "containerPort": 8126
+ }
+ ],
+ "command": [],
+ "cpu": 0,
+ "environment": [
+ {
+ "name": "DD_APM_ENABLED",
+ "value": "true"
+ },
+ {
+ "name": "DD_APM_NON_LOCAL_TRAFFIC",
+ "value": "true"
+ },
+ {
+ "name": "DD_TAGS",
+ "value": "env:STAGE,project:explorer-ui"
+ },
+ {
+ "name": "ECS_FARGATE",
+ "value": "true"
+ },
+ {
+ "name": "ENV",
+ "value": "STAGE"
+ }
+ ],
+ "secrets": [
+ {
+ "name": "DD_API_KEY",
+ "valueFrom": "arn:aws:ssm:us-east-2:852551629426:parameter/common/datadog/key"
+ }
+ ],
+ "mountPoints" : [],
+ "volumesFrom" : []
+ },
+ {
+ "name": "log_router",
+ "image": "906394416424.dkr.ecr.us-east-2.amazonaws.com/aws-for-fluent-bit:latest",
+ "essential": true,
+ "firelensConfiguration": {
+ "type": "fluentbit",
+ "options": {
+ "enable-ecs-log-metadata": "true"
+ }
+ },
+ "logConfiguration": {
+ "logDriver": "awslogs",
+ "options": {
+ "awslogs-group": "/ecs/explorer-ui-STAGE",
+ "awslogs-region": "us-east-2",
+ "awslogs-stream-prefix": "ecs"
+ }
+ },
+ "portMappings": [],
+ "command": [],
+ "cpu": 0,
+ "environment": [],
+ "mountPoints": [],
+ "user": "0",
+ "volumesFrom": []
+ }
+ ],
+ "cpu": "256",
+ "executionRoleArn": "arn:aws:iam::852551629426:role/explorer-ui-ecsTaskExecutionRole",
+ "taskRoleArn": "arn:aws:iam::852551629426:role/explorer-ui-ecsTaskRole",
+ "family": "explorer-ui-container-STAGE",
+ "memory": "512",
+ "networkMode": "awsvpc",
+ "runtimePlatform": {
+ "operatingSystemFamily": "LINUX"
+ },
+
+ "requiresCompatibilities": [
+ "FARGATE"
+ ]
+}
diff --git a/ecs/task_definition-transfer-ui-STAGE.json b/ecs/task_definition-transfer-ui-STAGE.json
new file mode 100644
index 00000000..4299e47e
--- /dev/null
+++ b/ecs/task_definition-transfer-ui-STAGE.json
@@ -0,0 +1,147 @@
+{
+ "containerDefinitions": [
+ {
+ "name": "transfer-ui-container-STAGE",
+ "essential": true,
+ "image": "852551629426.dkr.ecr.us-east-2.amazonaws.com/transfer-ui-stage:STAGE",
+ "logConfiguration": {
+ "logDriver": "awsfirelens",
+ "options": {
+ "provider": "ecs",
+ "dd_service": "transfer-ui",
+ "dd_tags": "env:STAGE,project:chainbridge",
+ "dd_message_key": "log",
+ "Host": "http-intake.logs.datadoghq.com",
+ "TLS": "on",
+ "dd_source": "transfer-ui-container-STAGE",
+ "Name": "datadog"
+ },
+ "secretOptions": [
+ {
+ "name": "apikey",
+ "valueFrom": "arn:aws:ssm:us-east-2:852551629426:parameter/common/datadog/key"
+ }
+ ]
+ },
+ "portMappings": [
+ {
+ "containerPort": 8000,
+ "hostPort": 8000,
+ "protocol": "tcp"
+ }
+ ],
+ "environment": [
+ {
+ "value": "transfer-ui",
+ "name": "DD_SERVICE"
+ },
+ {
+ "value": "https://config-server-stage.chainsafe.io",
+ "name": "CONFIG_SERVER_HOST"
+ },
+ {
+ "value": "8000",
+ "name": "CONFIG_SERVER_PORT"
+ }
+ ],
+ "secrets": [
+ {
+ "name": "mychainbridgesecret",
+ "valueFrom": "arn:aws:ssm:us-east-2:852551629426:parameter/chainbridge/example"
+ }
+ ]
+ },
+ {
+ "name": "datadog-agent",
+ "image": "gcr.io/datadoghq/agent:latest",
+ "essential": true,
+ "logConfiguration": {
+ "logDriver": "awslogs",
+ "options": {
+ "awslogs-group": "/ecs/transfer-ui-STAGE",
+ "awslogs-region": "us-east-2",
+ "awslogs-stream-prefix": "ecs"
+ }
+ },
+ "portMappings": [
+ {
+ "hostPort": 8126,
+ "protocol": "tcp",
+ "containerPort": 8126
+ }
+ ],
+ "command": [],
+ "cpu": 0,
+ "environment": [
+ {
+ "name": "DD_APM_ENABLED",
+ "value": "true"
+ },
+ {
+ "name": "DD_APM_NON_LOCAL_TRAFFIC",
+ "value": "true"
+ },
+ {
+ "name": "DD_TAGS",
+ "value": "env:STAGE,project:transfer-ui"
+ },
+ {
+ "name": "ECS_FARGATE",
+ "value": "true"
+ },
+ {
+ "name": "ENV",
+ "value": "STAGE"
+ }
+ ],
+ "secrets": [
+ {
+ "name": "DD_API_KEY",
+ "valueFrom": "arn:aws:ssm:us-east-2:852551629426:parameter/common/datadog/key"
+ }
+ ],
+ "mountPoints" : [],
+ "volumesFrom" : []
+ },
+ {
+ "name": "log_router",
+ "image": "906394416424.dkr.ecr.us-east-2.amazonaws.com/aws-for-fluent-bit:latest",
+ "essential": true,
+ "firelensConfiguration": {
+ "type": "fluentbit",
+ "options": {
+ "enable-ecs-log-metadata": "true"
+ }
+ },
+ "logConfiguration": {
+ "logDriver": "awslogs",
+ "options": {
+ "awslogs-group": "/ecs/transfer-ui-STAGE",
+ "awslogs-region": "us-east-2",
+ "awslogs-stream-prefix": "ecs"
+ }
+ },
+ "portMappings": [],
+ "command": [],
+ "cpu": 0,
+ "environment": [],
+ "mountPoints": [],
+ "user": "0",
+ "volumesFrom": []
+ }
+ ],
+ "cpu": "256",
+ "executionRoleArn": "arn:aws:iam::852551629426:role/transfer-ui-ecsTaskExecutionRole",
+ "taskRoleArn": "arn:aws:iam::852551629426:role/transfer-ui-ecsTaskRole",
+ "family": "transfer-ui-container-STAGE",
+ "memory": "512",
+ "networkMode": "awsvpc",
+ "runtimePlatform": {
+ "operatingSystemFamily": "LINUX"
+ },
+
+ "requiresCompatibilities": [
+ "FARGATE"
+ ]
+ }
+
\ No newline at end of file
diff --git a/etc/nginx.conf b/etc/nginx.conf
index 654357ad..f0f38b93 100644
--- a/etc/nginx.conf
+++ b/etc/nginx.conf
@@ -1,6 +1,6 @@
server {
- listen 80;
- listen [::]:80 default ipv6only=on;
+ listen 8000;
+ listen [::]:8000 default ipv6only=on;
root /usr/share/nginx/html;
index index.html;
@@ -22,4 +22,9 @@ server {
location / {
try_files $uri /index.html;
}
+
+ location /health {
+ return 200 'OK';
+ add_header Content-Type text/plain;
+ }
}
diff --git a/package.json b/package.json
index 802871be..ef97384b 100644
--- a/package.json
+++ b/package.json
@@ -12,32 +12,37 @@
"yarn": ">=1"
},
"dependencies": {
- "@chainsafe/chainbridge-ui-core": "1.0.3",
+ "@chainsafe/sygma-ui-core": "1.0.0",
"@changesets/cli": "^2.14.1",
"ethers": "5.4.5",
"prettier": "2.1.2",
"wsrun": "^5.2.4"
},
"scripts": {
- "start:ui": "yarn wsrun -p @chainsafe/chainbridge-ui -c start",
- "build:ui": "yarn wsrun -p @chainsafe/chainbridge-ui -c build",
+ "start:ui": "yarn wsrun -p @chainsafe/sygma-ui -c start",
+ "start:ui:prod": "NODE_ENV=production SSM_PARAMETER_NAME=/chainbridge/chainbridge-ui-local yarn start:ui",
+ "build:server": "yarn wsrun -p @chainsafe/sygma-ui-config-server -c build:server",
+ "start:config-server": "yarn wsrun -p @chainsafe/sygma-ui-config-server -c start:prod",
+ "build:ui": "yarn wsrun -p @chainsafe/sygma-ui -c build",
+ "build:explorer": "yarn wsrun -p @chainsafe/explorer-ui -c build",
"start:basic": "yarn wsrun -p @chainsafe/chainbridge-basic -c start",
- "build:core": "yarn wsrun -p @chainsafe/chainbridge-ui-core -c build",
- "publish:core": "yarn wsrun -p @chainsafe/chainbridge-ui-core -c publish",
- "sentry:ui": "yarn wsrun -p @chainsafe/chainbridge-ui -c sentry",
- "release:ui": "yarn wsrun -p @chainsafe/chainbridge-ui -c release",
- "test:ui": "yarn wsrun -p @chainsafe/chainbridge-ui -c test",
- "analyze:ui": "yarn wsrun -p @chainsafe/chainbridge-ui -c analyze",
- "clean-dependencies:ui": "yarn wsrun -p @chainsafe/chainbridge-ui -c clean:dependencies",
- "clean-dist:ui": "yarn wsrun -p @chainsafe/chainbridge-ui -c clean:dist",
- "clean:ui": "yarn wsrun -p @chainsafe/chainbridge-ui -c clean",
- "prettier:ui": "yarn wsrun -p @chainsafe/chainbridge-ui -c prettier",
- "start-tunnel:ui": "yarn wsrun -p @chainsafe/chainbridge-ui -c start:tunnel",
- "start-substrate:ui": "yarn wsrun -p @chainsafe/chainbridge-ui -c start:substrate",
- "start-evm-example:ui": "yarn wsrun -p @chainsafe/chainbridge-ui -c start:evm-example",
- "setup-example:ui": "yarn wsrun -p @chainsafe/chainbridge-ui -c setup:example",
- "setup-centrifuge:ui": "yarn wsrun -p @chainsafe/chainbridge-ui -c setup:centrifuge",
- "start:example": "yarn wsrun -p example -c start"
+ "build:core": "yarn wsrun -p @chainsafe/sygma-ui-core -c build",
+ "publish:core": "yarn wsrun -p @chainsafe/sygma-ui-core -c publish",
+ "sentry:ui": "yarn wsrun -p @chainsafe/sygma-ui -c sentry",
+ "release:ui": "yarn wsrun -p @chainsafe/sygma-ui -c release",
+ "test:ui": "yarn wsrun -p @chainsafe/sygma-ui -c test",
+ "analyze:ui": "yarn wsrun -p @chainsafe/sygma-ui -c analyze",
+ "clean-dependencies:ui": "yarn wsrun -p @chainsafe/sygma-ui -c clean:dependencies",
+ "clean-dist:ui": "yarn wsrun -p @chainsafe/sygma-ui -c clean:dist",
+ "clean:ui": "yarn wsrun -p @chainsafe/sygma-ui -c clean",
+ "prettier:ui": "yarn wsrun -p @chainsafe/sygma-ui -c prettier",
+ "start-tunnel:ui": "yarn wsrun -p @chainsafe/sygma-ui -c start:tunnel",
+ "start-substrate:ui": "yarn wsrun -p @chainsafe/sygma-ui -c start:substrate",
+ "start-evm-example:ui": "yarn wsrun -p @chainsafe/sygma-ui -c start:evm-example",
+ "setup-example:ui": "yarn wsrun -p @chainsafe/sygma-ui -c setup:example",
+ "setup-centrifuge:ui": "yarn wsrun -p @chainsafe/sygma-ui -c setup:centrifuge",
+ "start:example": "yarn wsrun -p example -c start",
+ "start:explorer-ui": "yarn wsrun -p @chainsafe/explorer-ui -c start"
},
"workspaces": {
"packages": [
diff --git a/packages/basic-example/README.md b/packages/basic-example/README.md
index 35482fcc..9bd4dd6c 100644
--- a/packages/basic-example/README.md
+++ b/packages/basic-example/README.md
@@ -1,4 +1,4 @@
-# Chainbridge basic example
+# Sygma basic example
This package demonstrate basic usage and implementation of our context providers for bridge purposes
diff --git a/packages/basic-example/config/chainbridge-runtime-config.celo.js b/packages/basic-example/config/sygma-runtime-config.celo.js
similarity index 100%
rename from packages/basic-example/config/chainbridge-runtime-config.celo.js
rename to packages/basic-example/config/sygma-runtime-config.celo.js
diff --git a/packages/basic-example/config/chainbridge-runtime-config.evm.js b/packages/basic-example/config/sygma-runtime-config.evm.js
similarity index 100%
rename from packages/basic-example/config/chainbridge-runtime-config.evm.js
rename to packages/basic-example/config/sygma-runtime-config.evm.js
diff --git a/packages/basic-example/package.json b/packages/basic-example/package.json
index f238a37f..f377be95 100644
--- a/packages/basic-example/package.json
+++ b/packages/basic-example/package.json
@@ -7,8 +7,7 @@
"@babel/runtime": "^7.12.1",
"@celo-tools/celo-ethers-wrapper": "^0.0.5",
"@chainsafe/chainbridge-contracts": "2.0.0",
- "@chainsafe/common-components": "1.0.26",
- "@chainsafe/chainbridge-ui-core": "^1.0.3",
+ "@chainsafe/sygma-ui-core": "^1.0.0",
"@chainsafe/common-theme": "1.0.10",
"@chainsafe/web3-context": "1.2.0",
"@hookform/resolvers": "^2.8.4",
@@ -17,9 +16,6 @@
"@mui/lab": "^5.0.0-alpha.57",
"@mui/material": "^5.2.1",
"@mui/styled-engine-sc": "^5.1.0",
- "@polkadot/keyring": "5.6.3",
- "@polkadot/util": "5.6.3",
- "@polkadot/util-crypto": "5.6.3",
"@sentry/react": "^5.26.0",
"@use-it/interval": "^1.0.0",
"clsx": "^1.1.1",
@@ -37,8 +33,6 @@
"yup": "^0.29.3"
},
"devDependencies": {
- "@polkadot/api": "3.11.1",
- "@polkadot/typegen": "^4.11.2",
"@sentry/cli": "1.58.0",
"@sheerun/mutationobserver-shim": "^0.3.3",
"@testing-library/jest-dom": "^5.11.4",
diff --git a/packages/basic-example/public/index.html b/packages/basic-example/public/index.html
index 75b9ca14..637b6cc0 100644
--- a/packages/basic-example/public/index.html
+++ b/packages/basic-example/public/index.html
@@ -11,7 +11,7 @@
/>
-
+
-
+
+
+
+
+
+ Chainbrdige Explorer UI
+
+
+
+
+
+
+
+