-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1960 from ten-protocol/initiate-bridge-deployment
Initiate bridge deployment
- Loading branch information
Showing
25 changed files
with
21,816 additions
and
363 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": "next/core-web-vitals" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
/.pnp | ||
.pnp.js | ||
.yarn/install-state.gz | ||
|
||
# testing | ||
/coverage | ||
|
||
# next.js | ||
/.next/ | ||
/out/ | ||
|
||
# production | ||
/build | ||
|
||
# misc | ||
.DS_Store | ||
*.pem | ||
|
||
# debug | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# local env files | ||
.env*.local | ||
|
||
# vercel | ||
.vercel | ||
|
||
# typescript | ||
*.tsbuildinfo | ||
next-env.d.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Use an official Node.js 22 as a parent image | ||
FROM node:22-alpine | ||
|
||
WORKDIR /usr/src/app | ||
|
||
# ARG for build-time variable | ||
ARG API_HOST | ||
ARG L1_BRIDGE | ||
ARG L2_BRIDGE | ||
ARG MESSAGE_BUS | ||
ARG GOOGLE_ANALYTICS_ID | ||
|
||
# ENV for URL to be used in the app | ||
ENV NEXT_PUBLIC_BRIDGE_API_HOST=${API_HOST} | ||
ENV NEXT_PUBLIC_BRIDGE_L1=${L1_BRIDGE} | ||
ENV NEXT_PUBLIC_BRIDGE_L2=${L2_BRIDGE} | ||
ENV NEXT_PUBLIC_BRIDGE_MESSAGE_BUS=${MESSAGE_BUS} | ||
ENV NEXT_PUBLIC_BRIDGE_GOOGLE_ANALYTICS_ID=${GOOGLE_ANALYTICS_ID} | ||
|
||
# Copy package.json and package-lock.json (or yarn.lock) into the container | ||
COPY package*.json ./ | ||
|
||
RUN npm install | ||
COPY . . | ||
RUN npm run build | ||
EXPOSE 80 | ||
CMD ["npm", "start"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# Bridge: Bridge for The Encryption Network (TEN) | ||
<!-- ut essentially for us, he want to support the moving of assets (any) between Ethereum and TEN --> | ||
<!-- Not yet, but we should support ETH, TEN, USDT, USDC at least to begin with --> | ||
|
||
The Ten Bridge is a decentralized bridge that allows users to move assets between the Ethereum network and the TEN network. The bridge is a critical component of the TEN ecosystem, enabling users to move assets between the two networks seamlessly. | ||
|
||
For more information on the TEN bridge, please refer to the [TEN Bridge Documentation](https://docs.ten.xyz/bridge). | ||
|
||
## Folder Structure | ||
|
||
``` | ||
📁 Bridge | ||
├── 📁 pages - Typically used for Next.js pages. Each .tsx or .js file in this directory becomes a route in your application | ||
├── 📁 public - This directory is used to serve static assets. Files inside this directory can be referenced in your code with a URL path | ||
├── 📁 src - Main source code directory for this project | ||
│ ├── 📁 components - Contains reusable React components used throughout the application | ||
│ ├── 📁 hooks - Custom React hooks that can be shared and reused across components | ||
│ ├── 📁 lib - Utility functions or modules that provide common functionalities across the application | ||
│ ├── 📁 routes - Route-related logic or configuration can be placed in this directory | ||
│ ├── 📁 services - Used for services that interact with external APIs or handle other data-related tasks | ||
│ └── 📁 types - Type definitions (.d.ts files or TypeScript files) for TypeScript, describing the shape of data and objects used in the application | ||
└── 📁 styles - Global styles, stylesheets, or styling-related configurations for this project | ||
``` | ||
|
||
## Getting Started | ||
|
||
1. **Clone the Repository:** | ||
```bash | ||
git clone https://github.com/ten-protocol/go-ten.git | ||
cd go-ten/tools/tenscan/frontend | ||
``` | ||
|
||
2. **Install Dependencies:** | ||
```bash | ||
npm install | ||
``` | ||
|
||
3. **Run the Development Server:** | ||
```bash | ||
npm run dev | ||
``` | ||
|
||
The application will be accessible at [http://localhost:3000](http://localhost:3000). | ||
|
||
## Usage | ||
|
||
- Visit the different sections of the explorer through the navigation links in the UI. | ||
- Explore the different blocks, transactions, batches, resources, and personal data on the TEN. | ||
- View the details of each batch by their hash. | ||
|
||
## Built With | ||
|
||
- [Next.js](https://nextjs.org/) | ||
- [Tailwind CSS](https://tailwindcss.com/) | ||
- [Shadcn-UI](https://shadcn.com/) | ||
- [TypeScript](https://www.typescriptlang.org/) | ||
|
||
|
||
## Contributing | ||
|
||
Contributions are welcome! Please follow our [contribution guidelines](/docs/_docs/community/contributions.md). | ||
|
||
## License | ||
|
||
This project is licensed under the [GNU Affero General Public License v3.0](/LICENSE). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"$schema": "https://ui.shadcn.com/schema.json", | ||
"style": "default", | ||
"rsc": false, | ||
"tsx": true, | ||
"tailwind": { | ||
"config": "tailwind.config.js", | ||
"css": "app/globals.css", | ||
"baseColor": "slate", | ||
"cssVariables": true | ||
}, | ||
"aliases": { | ||
"components": "@/src/components", | ||
"utils": "@/src/lib/utils" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
NEXT_PUBLIC_BRIDGE_API_HOST= | ||
|
||
NEXT_PUBLIC_BRIDGE_L1= | ||
NEXT_PUBLIC_BRIDGE_L2= | ||
NEXT_PUBLIC_BRIDGE_MESSAGE_BUS= | ||
NEXT_PUBLIC_BRIDGE_GOOGLE_ANALYTICS_ID= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = { | ||
reactStrictMode: true, | ||
images: { | ||
unoptimized: true, | ||
}, | ||
}; | ||
|
||
module.exports = nextConfig; |
Oops, something went wrong.