From 7814a38e884a5b20513cc1403b91baa0c3488c30 Mon Sep 17 00:00:00 2001 From: Jennifer Echenim Date: Wed, 21 Aug 2024 15:54:50 +0400 Subject: [PATCH 1/5] move bridge frontend to tools folder --- .../bridge-frontend}/.eslintrc.json | 0 .../frontend => tools/bridge-frontend}/.gitignore | 0 .../frontend => tools/bridge-frontend}/Dockerfile | 0 .../frontend => tools/bridge-frontend}/README.md | 0 .../bridge-frontend}/components.json | 0 .../frontend => tools/bridge-frontend}/env.example | 0 .../bridge-frontend}/next.config.js | 0 .../bridge-frontend}/package-lock.json | 0 .../frontend => tools/bridge-frontend}/package.json | 0 .../bridge-frontend}/pages/_app.tsx | 0 .../bridge-frontend}/pages/_document.tsx | 0 .../bridge-frontend}/pages/index.tsx | 0 .../bridge-frontend}/postcss.config.js | 0 .../bridge-frontend}/public/favicon.ico | Bin .../bridge-frontend}/src/lib/constants.ts | 0 .../bridge-frontend}/tsconfig.json | 0 .../frontend => tools/bridge-frontend}/vercel.json | 0 17 files changed, 0 insertions(+), 0 deletions(-) rename {contracts/src/bridge/frontend => tools/bridge-frontend}/.eslintrc.json (100%) rename {contracts/src/bridge/frontend => tools/bridge-frontend}/.gitignore (100%) rename {contracts/src/bridge/frontend => tools/bridge-frontend}/Dockerfile (100%) rename {contracts/src/bridge/frontend => tools/bridge-frontend}/README.md (100%) rename {contracts/src/bridge/frontend => tools/bridge-frontend}/components.json (100%) rename {contracts/src/bridge/frontend => tools/bridge-frontend}/env.example (100%) rename {contracts/src/bridge/frontend => tools/bridge-frontend}/next.config.js (100%) rename {contracts/src/bridge/frontend => tools/bridge-frontend}/package-lock.json (100%) rename {contracts/src/bridge/frontend => tools/bridge-frontend}/package.json (100%) rename {contracts/src/bridge/frontend => tools/bridge-frontend}/pages/_app.tsx (100%) rename {contracts/src/bridge/frontend => tools/bridge-frontend}/pages/_document.tsx (100%) rename {contracts/src/bridge/frontend => tools/bridge-frontend}/pages/index.tsx (100%) rename {contracts/src/bridge/frontend => tools/bridge-frontend}/postcss.config.js (100%) rename {contracts/src/bridge/frontend => tools/bridge-frontend}/public/favicon.ico (100%) rename {contracts/src/bridge/frontend => tools/bridge-frontend}/src/lib/constants.ts (100%) rename {contracts/src/bridge/frontend => tools/bridge-frontend}/tsconfig.json (100%) rename {contracts/src/bridge/frontend => tools/bridge-frontend}/vercel.json (100%) diff --git a/contracts/src/bridge/frontend/.eslintrc.json b/tools/bridge-frontend/.eslintrc.json similarity index 100% rename from contracts/src/bridge/frontend/.eslintrc.json rename to tools/bridge-frontend/.eslintrc.json diff --git a/contracts/src/bridge/frontend/.gitignore b/tools/bridge-frontend/.gitignore similarity index 100% rename from contracts/src/bridge/frontend/.gitignore rename to tools/bridge-frontend/.gitignore diff --git a/contracts/src/bridge/frontend/Dockerfile b/tools/bridge-frontend/Dockerfile similarity index 100% rename from contracts/src/bridge/frontend/Dockerfile rename to tools/bridge-frontend/Dockerfile diff --git a/contracts/src/bridge/frontend/README.md b/tools/bridge-frontend/README.md similarity index 100% rename from contracts/src/bridge/frontend/README.md rename to tools/bridge-frontend/README.md diff --git a/contracts/src/bridge/frontend/components.json b/tools/bridge-frontend/components.json similarity index 100% rename from contracts/src/bridge/frontend/components.json rename to tools/bridge-frontend/components.json diff --git a/contracts/src/bridge/frontend/env.example b/tools/bridge-frontend/env.example similarity index 100% rename from contracts/src/bridge/frontend/env.example rename to tools/bridge-frontend/env.example diff --git a/contracts/src/bridge/frontend/next.config.js b/tools/bridge-frontend/next.config.js similarity index 100% rename from contracts/src/bridge/frontend/next.config.js rename to tools/bridge-frontend/next.config.js diff --git a/contracts/src/bridge/frontend/package-lock.json b/tools/bridge-frontend/package-lock.json similarity index 100% rename from contracts/src/bridge/frontend/package-lock.json rename to tools/bridge-frontend/package-lock.json diff --git a/contracts/src/bridge/frontend/package.json b/tools/bridge-frontend/package.json similarity index 100% rename from contracts/src/bridge/frontend/package.json rename to tools/bridge-frontend/package.json diff --git a/contracts/src/bridge/frontend/pages/_app.tsx b/tools/bridge-frontend/pages/_app.tsx similarity index 100% rename from contracts/src/bridge/frontend/pages/_app.tsx rename to tools/bridge-frontend/pages/_app.tsx diff --git a/contracts/src/bridge/frontend/pages/_document.tsx b/tools/bridge-frontend/pages/_document.tsx similarity index 100% rename from contracts/src/bridge/frontend/pages/_document.tsx rename to tools/bridge-frontend/pages/_document.tsx diff --git a/contracts/src/bridge/frontend/pages/index.tsx b/tools/bridge-frontend/pages/index.tsx similarity index 100% rename from contracts/src/bridge/frontend/pages/index.tsx rename to tools/bridge-frontend/pages/index.tsx diff --git a/contracts/src/bridge/frontend/postcss.config.js b/tools/bridge-frontend/postcss.config.js similarity index 100% rename from contracts/src/bridge/frontend/postcss.config.js rename to tools/bridge-frontend/postcss.config.js diff --git a/contracts/src/bridge/frontend/public/favicon.ico b/tools/bridge-frontend/public/favicon.ico similarity index 100% rename from contracts/src/bridge/frontend/public/favicon.ico rename to tools/bridge-frontend/public/favicon.ico diff --git a/contracts/src/bridge/frontend/src/lib/constants.ts b/tools/bridge-frontend/src/lib/constants.ts similarity index 100% rename from contracts/src/bridge/frontend/src/lib/constants.ts rename to tools/bridge-frontend/src/lib/constants.ts diff --git a/contracts/src/bridge/frontend/tsconfig.json b/tools/bridge-frontend/tsconfig.json similarity index 100% rename from contracts/src/bridge/frontend/tsconfig.json rename to tools/bridge-frontend/tsconfig.json diff --git a/contracts/src/bridge/frontend/vercel.json b/tools/bridge-frontend/vercel.json similarity index 100% rename from contracts/src/bridge/frontend/vercel.json rename to tools/bridge-frontend/vercel.json From d998caf8842c681d3656de3be4cc6d3acae26be9 Mon Sep 17 00:00:00 2001 From: Jennifer Echenim Date: Wed, 21 Aug 2024 15:56:59 +0400 Subject: [PATCH 2/5] update Dockerfile and workflow path for bridge frontend --- .github/workflows/manual-deploy-ten-bridge.yml | 2 +- tools/bridge-frontend/Dockerfile | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/manual-deploy-ten-bridge.yml b/.github/workflows/manual-deploy-ten-bridge.yml index e5ab7feb69..14b51c7529 100644 --- a/.github/workflows/manual-deploy-ten-bridge.yml +++ b/.github/workflows/manual-deploy-ten-bridge.yml @@ -46,7 +46,7 @@ jobs: - 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_BUILDKIT=1 docker build -t ${{ vars.DOCKER_BUILD_TAG_BRIDGE_FE }} -f ./tools/bridge-frontend/Dockerfile . docker push ${{ vars.DOCKER_BUILD_TAG_BRIDGE_FE }} - name: "Deploy FE to Azure Container Instances" diff --git a/tools/bridge-frontend/Dockerfile b/tools/bridge-frontend/Dockerfile index 0b68092cf4..1169ef4d3c 100644 --- a/tools/bridge-frontend/Dockerfile +++ b/tools/bridge-frontend/Dockerfile @@ -2,10 +2,10 @@ FROM node:22-alpine # setup container data structure -RUN mkdir -p /home/obscuro/go-obscuro/contracts/src/bridge -COPY ./contracts/src/bridge/frontend /home/obscuro/go-obscuro/contracts/src/bridge/frontend +RUN mkdir -p /home/obscuro/go-obscuro/tools/bridge +COPY ./tools/bridge-frontend /home/obscuro/go-obscuro/tools/bridge-frontend -WORKDIR /home/obscuro/go-obscuro/contracts/src/bridge/frontend +WORKDIR /home/obscuro/go-obscuro/tools/bridge-frontend # ARG for build-time variable ARG API_HOST From df64a04b1ff98708bb2bc1fc580d454b31022c30 Mon Sep 17 00:00:00 2001 From: Jennifer Echenim Date: Wed, 21 Aug 2024 16:00:50 +0400 Subject: [PATCH 3/5] refactor Dockerfile directory structure --- tools/bridge-frontend/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/bridge-frontend/Dockerfile b/tools/bridge-frontend/Dockerfile index 1169ef4d3c..6aa25dea99 100644 --- a/tools/bridge-frontend/Dockerfile +++ b/tools/bridge-frontend/Dockerfile @@ -2,7 +2,7 @@ FROM node:22-alpine # setup container data structure -RUN mkdir -p /home/obscuro/go-obscuro/tools/bridge +RUN mkdir -p /home/obscuro/go-obscuro/tools COPY ./tools/bridge-frontend /home/obscuro/go-obscuro/tools/bridge-frontend WORKDIR /home/obscuro/go-obscuro/tools/bridge-frontend From cb418170bec3893dc207f6f8a24c65cdbdcbcde0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=BDiga=20Kokelj?= Date: Thu, 22 Aug 2024 09:53:23 +0200 Subject: [PATCH 4/5] Separate deployment of Gateway frontend and backend (#2032) --- .../manual-deploy-obscuro-gateway.yml | 2 +- .../manual-deploy-ten-gateway-frontend.yml | 17 +-- tools/walletextension/Dockerfile | 25 ----- tools/walletextension/README.md | 101 ++++++++++++------ tools/walletextension/api/server.go | 24 ----- tools/walletextension/api/static/favicon.ico | Bin 1260 -> 0 bytes tools/walletextension/common/constants.go | 1 - tools/walletextension/entrypoint.sh | 3 - tools/walletextension/frontend/Dockerfile | 47 +++++--- tools/walletextension/frontend/next.config.js | 5 - .../src/components/layouts/header.tsx | 4 +- .../frontend/src/lib/constants.ts | 2 +- .../frontend/src/pages/_app.tsx | 10 +- tools/walletextension/main/main.go | 2 +- tools/walletextension/nginx.conf | 27 ----- .../walletextension_container.go | 13 --- 16 files changed, 117 insertions(+), 166 deletions(-) delete mode 100644 tools/walletextension/api/server.go delete mode 100644 tools/walletextension/api/static/favicon.ico delete mode 100644 tools/walletextension/nginx.conf diff --git a/.github/workflows/manual-deploy-obscuro-gateway.yml b/.github/workflows/manual-deploy-obscuro-gateway.yml index ea85edf663..bf8c1825d1 100644 --- a/.github/workflows/manual-deploy-obscuro-gateway.yml +++ b/.github/workflows/manual-deploy-obscuro-gateway.yml @@ -139,6 +139,6 @@ jobs: -e OBSCURO_GATEWAY_VERSION="${{ GITHUB.RUN_NUMBER }}-${{ GITHUB.SHA }}" \ --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 \ + -host=0.0.0.0 -port=80 -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" \ -rateLimitUserComputeTime=${{ vars.GATEWAY_RATE_LIMIT_USER_COMPUTE_TIME }} -rateLimitWindow=${{ vars.GATEWAY_RATE_LIMIT_WINDOW }} -maxConcurrentRequestsPerUser=${{ vars.GATEWAY_MAX_CONCURRENT_REQUESTS_PER_USER }} ' diff --git a/.github/workflows/manual-deploy-ten-gateway-frontend.yml b/.github/workflows/manual-deploy-ten-gateway-frontend.yml index 8ac6e17e70..b50d0f1506 100644 --- a/.github/workflows/manual-deploy-ten-gateway-frontend.yml +++ b/.github/workflows/manual-deploy-ten-gateway-frontend.yml @@ -15,27 +15,16 @@ on: - 'dev-testnet' - 'uat-testnet' - 'sepolia-testnet' - jobs: build-and-deploy: runs-on: ubuntu-latest environment: name: ${{ github.event.inputs.testnet_type }} - strategy: - fail-fast: false - matrix: - include: - - testnet_type: 'dev-testnet' - GATEWAY_API_URL: 'https://dev-testnet.ten.xyz' - - testnet_type: 'uat-testnet' - GATEWAY_API_URL: 'https://uat-testnet.ten.xyz' - - testnet_type: 'sepolia-testnet' - GATEWAY_API_URL: 'https://testnet.ten.xyz' steps: - name: 'Print GitHub variables' run: | echo "Selected Testnet Type: ${{ matrix.testnet_type }}" - echo "Gateway API URL: ${{ matrix.GATEWAY_API_URL }}" + echo "Gateway API URL: ${{ vars.GATEWAY_URL }}" - uses: actions/checkout@v4 @@ -46,7 +35,7 @@ jobs: echo "BRANCH_NAME=${GITHUB_REF_NAME}" >> $GITHUB_ENV - name: 'Set up Docker' - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v3.6.1 - name: 'Login to Azure docker registry' uses: azure/docker-login@v1 @@ -62,7 +51,7 @@ jobs: - name: Build and Push Docker Image run: | - DOCKER_BUILDKIT=1 docker build --build-arg GATEWAY_API_URL=${{ matrix.GATEWAY_API_URL }} -t ${{ vars.DOCKER_BUILD_TAG_GATEWAY_FE }} -f ./tools/walletextension/frontend/Dockerfile . + DOCKER_BUILDKIT=1 docker build --build-arg GATEWAY_API_URL=${{ vars.GATEWAY_URL }} -t ${{ vars.DOCKER_BUILD_TAG_GATEWAY_FE }} -f ./tools/walletextension/frontend/Dockerfile . docker push ${{ vars.DOCKER_BUILD_TAG_GATEWAY_FE }} - name: "Deploy Gateway FE to Azure Container Instances" diff --git a/tools/walletextension/Dockerfile b/tools/walletextension/Dockerfile index b399a471dd..5a25543b06 100644 --- a/tools/walletextension/Dockerfile +++ b/tools/walletextension/Dockerfile @@ -18,9 +18,6 @@ FROM system as get-dependencies RUN mkdir -p /home/obscuro/go-obscuro -# Install Node.js and npm (needed for frontend) -RUN apk add --update nodejs npm - # Ensures container layer caching when dependencies are not changed WORKDIR /home/obscuro/go-obscuro COPY go.mod . @@ -32,21 +29,6 @@ FROM get-dependencies as build-wallet # make sure the geth network code is available COPY . /home/obscuro/go-obscuro -# Create .env file for frontend -WORKDIR /home/obscuro/go-obscuro/tools/walletextension/frontend -RUN if [ "$TESTNET_TYPE" = "dev-testnet" ]; then \ - echo "NEXT_PUBLIC_API_GATEWAY_URL=https://dev-testnet.ten.xyz" > .env; \ - elif [ "$TESTNET_TYPE" = "uat-testnet" ]; then \ - echo "NEXT_PUBLIC_API_GATEWAY_URL=https://uat-testnet.ten.xyz" > .env; \ - elif [ "$TESTNET_TYPE" = "sepolia-testnet" ]; then \ - echo "NEXT_PUBLIC_API_GATEWAY_URL=https://testnet.ten.xyz" > .env; \ - else \ - echo "NEXT_PUBLIC_API_GATEWAY_URL=http://127.0.0.1:3000" > .env; \ - fi -# Run npm build for frontend -RUN npm install -RUN npm run build - # build the gateway executable WORKDIR /home/obscuro/go-obscuro/tools/walletextension/main RUN --mount=type=cache,target=/root/.cache/go-build \ @@ -55,19 +37,12 @@ RUN --mount=type=cache,target=/root/.cache/go-build \ # Lightweight final build stage. Includes bare minimum to start wallet extension FROM alpine:3.18 -# Install NGINX -RUN apk update && apk add nginx - # copy over the gateway executable COPY --from=build-wallet /home/obscuro/go-obscuro/tools/walletextension/bin /home/obscuro/go-obscuro/tools/walletextension/bin # copy over the .sql migration files COPY --from=build-wallet /home/obscuro/go-obscuro/tools/walletextension/storage/database /home/obscuro/go-obscuro/tools/walletextension/storage/database -# copy over the NGINX configuration file -COPY --from=build-wallet /home/obscuro/go-obscuro/tools/walletextension/nginx.conf /etc/nginx/nginx.conf - - # copy over the entrypoint script COPY --from=build-wallet /home/obscuro/go-obscuro/tools/walletextension/entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh diff --git a/tools/walletextension/README.md b/tools/walletextension/README.md index 6afce4c211..1224fd6d99 100644 --- a/tools/walletextension/README.md +++ b/tools/walletextension/README.md @@ -1,56 +1,95 @@ -# The Ten gateway -See the documentation [here](https://docs.ten.xyz/wallet-extension/wallet-extension/). +# Ten Gateway Documentation -## Developer notes +For a comprehensive overview, refer to the [official documentation](https://docs.ten.xyz/docs/tools-infrastructure/hosted-gateway). -Running gateway frontend locally requires building static files first. -To do that, run `npm run build` in `tools/walletextension/frontend` folder. +## Running the Gateway Locally -The precompiled binaries for macOS ARM64, macOS AMD64, Windows AMD64 and Linux AMD64 can be built by running the -following commands from the `tools/walletextension/main` folder: +### Backend -``` +To run the backend locally, it is recommended to use **port 1443** to avoid conflicts with the frontend service, which typically runs on port 3000. First, build the backend using the `go build` command. Navigate to the `tools/walletextension/main` folder and use the following commands to build for your respective operating system: + +```bash +# macOS AMD64 env GOOS=darwin GOARCH=amd64 go build -o ../bin/wallet_extension_macos_amd64 . - env GOOS=darwin GOARCH=arm64 go build -o ../bin/wallet_extension_macos_arm64 . + +# macOS ARM64 +env GOOS=darwin GOARCH=arm64 go build -o ../bin/wallet_extension_macos_arm64 . + +# Windows AMD64 env GOOS=windows GOARCH=amd64 go build -o ../bin/wallet_extension_win_amd64.exe . + +# Linux AMD64 env GOOS=linux GOARCH=amd64 go build -o ../bin/wallet_extension_linux_amd64 . ``` -The binaries will be created in the `tools/walletextension/bin` folder. +The binaries will be available in the `tools/walletextension/bin` directory. +Run the compiled binary and specify the desired port. +Example: -### Structure - -This package follows the same structure of `host` and `enclave`. - -It uses a container to wrap the services that are required to allow the wallet extension to fulfill the business logic. +```bash +./wallet_extension_macos_arm64 --port 1443 +``` -### Running Wallet Extension with Docker +### Additional Backend Configuration Options + +- **`--host`**: The host where the wallet extension should open the port. Default: `127.0.0.1`. +- **`--port`**: The port on which to serve the wallet extension. Default: `3000`. +- **`--portWS`**: The port on which to serve websocket JSON RPC requests. Default: `3001`. +- **`--nodeHost`**: The host on which to connect to the Obscuro node. Default: `erpc.sepolia-testnet.ten.xyz`. +- **`--nodePortHTTP`**: The port on which to connect to the Obscuro node via RPC over HTTP. Default: `80`. +- **`--nodePortWS`**: The port on which to connect to the Obscuro node via RPC over websockets. Default: `81`. +- **`--logPath`**: The path to use for the wallet extension's log file. Default: `sys_out`. +- **`--databasePath`**: The path for the wallet extension's database file. Default: `.obscuro/gateway_database.db`. +- **`--verbose`**: Flag to enable verbose logging of wallet extension traffic. Default: `false`. +- **`--dbType`**: Define the database type (`sqlite` or `mariaDB`). Default: `sqlite`. +- **`--dbConnectionURL`**: If `dbType` is set to `mariaDB`, this must be set. +- **`--tenChainID`**: ChainID of the Ten network that the gateway is communicating with. Default: `443`. +- **`--storeIncomingTxs`**: Flag to enable storing incoming transactions in the database for debugging purposes. Default: `true`. +- **`--rateLimitUserComputeTime`**: Represents how much compute time a user is allowed to use within the `rateLimitWindow` time. Set to `0` to disable rate limiting. Default: `10s`. +- **`--rateLimitWindow`**: Time window in which a user is allowed to use the defined compute time. Default: `1m`. +- **`--maxConcurrentRequestsPerUser`**: Number of concurrent requests allowed per user. Default: `3`. + + +### Frontend + +Once the backend is running, navigate to the `tools/walletextension/frontend` directory and execute the following commands: + +```bash +npm install +npm run dev +``` -To build a docker image use docker build command. Please note that you need to run it from the root of the repository. -To run the container you can use `./docker_run.sh`. You can add parameters to the script, and they are passed to the wallet extension -(example: `-host=0.0.0.0` to be able to access wallet extension endpoints via localhost). +The frontend will be accessible on `http://localhost:3000`. +## HTTP Endpoints -### HTTP Endpoints +Ten Gateway exposes several HTTP endpoints for interaction: -For interacting with Ten Gateway, there are the following HTTP endpoints available: +- **`GET /v1/join`** + Generates and returns a `userID`, which needs to be added as a query parameter `u` in your Metamask (or another provider) URL to identify you. -- `GET /v1/join` +- **`POST /v1/authenticate?token=$EncryptionToken`** + Submits a signed message in the format `Register for `, proving ownership of the private keys for the account, and links that account with the `userID`. -It generates and returns userID which needs to be added as a query parameter "u" to the URL in your Metamask -(or another provider) as it identifies you. +- **`GET /v1/query/address?token=$EncryptionToken&a=$Address`** + Returns a JSON response indicating whether the address "a" is registered for the user "u". -- `POST /v1/authenticate?token=$EncryptionToken` +- **`POST /v1/revoke?token=$EncryptionToken`** + Deletes the userId along with the associated authenticated viewing keys. -With this endpoint, you submit a signed message in the format `Register for ` -from that account which proves that you hold private keys for it, and it links that account with your userID. +- **`GET /v1/health`** + Returns a health status of the service. -- `GET /v1/query/address?token=$EncryptionToken&a=$Address` +- **`GET /v1/network-health`** + Returns the health status of the node. -This endpoint responds with a JSON of true or false if the address "a" is already registered for user "u" +- **`GET /v1/network-config`** + Returns the network configuration details. +- **`GET /v1/version`** + Returns the current version of the gateway -- `POST "/v1/revoke?token=$EncryptionToken"` +- **`GET /v1/getmessage`** + Generates and returns a message for the user to sign based on the provided encryption token. -When this endpoint is triggered, the userId with the authenticated viewing keys should be deleted. diff --git a/tools/walletextension/api/server.go b/tools/walletextension/api/server.go deleted file mode 100644 index 3552888ae0..0000000000 --- a/tools/walletextension/api/server.go +++ /dev/null @@ -1,24 +0,0 @@ -package api - -import ( - "embed" - "fmt" - "io/fs" - "net/http" -) - -//go:embed all:static -var staticFiles embed.FS - -const ( - staticDir = "static" -) - -func StaticFilesHandler(prefix string) http.Handler { - // Serves the web assets for the management of viewing keys. - fileSystem, err := fs.Sub(staticFiles, staticDir) - if err != nil { - panic(fmt.Sprintf("could not serve static files. Cause: %s", err)) - } - return http.StripPrefix(prefix, http.FileServer(http.FS(fileSystem))) -} diff --git a/tools/walletextension/api/static/favicon.ico b/tools/walletextension/api/static/favicon.ico deleted file mode 100644 index 0e8dea2f715d4fdc30aa83101021fe05fb3e2c21..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1260 zcmVg-p z$Qi$Yq(b+^#>V2{-~fAj zdr*R;7$7`6JXjpa4Q5?#Z*NgtT#T`?F~~)-3!R*tFc+fLQ;L<96&xKMp#;e;MBLom zU}|a#+uPf?xVT{1#o5^zCMM$7gYGFWFGo*L50oI;g}%bY#RYM3afpbBKtMnMixmo3 zLy+=yb#-WIX@OEyGe92;3kxJCCnGvK8VLyr@bvW5UaPIGRYiH?4~)dq(-S5qC)q(+ zXK85(K|w)K8(A?RmDkr-wt>aR$7@~f?d=Wg>+4X8A{VNzu10!#`j^+k!^83X{H#5< zv9ZD2+#HJ$qM@MyO-)Tug5nq$8XEetG@ulzYXD(uYm4dWX|@RxN{vt@h_kb^S+%MU zrATrgeVm+}FgQ4fn3x!LuEYpcf_Qj%SdzS@r6pWlUA5U1^G8E_w3kzBqLq}Cr6{Mhw3z70Q zH8rd>CPqg`QCL{`L59-j%*>47ZhU=x&01Fa6@%g|q_2E`e?Lk}N@b&d& zg&gf2hRSieo|BWqo<;SNDCiByJ?!l4xW2wV?j8EiEBisl&CQM5-`{7~`SO9QtgQU@ znVp@T+{42I$2U%*bWl_awYRsUprC;L@9phHX=y22Vf~f&^YdfpKq}r(T7}!xV*d+lvQ;jqgOsMGNMhD$hQc_YN1>IQ>&5}rY-M&}|cXxLb z6%`4}2^x@*k@0C)l?o{?MR_R*8bB@J^71m2@YQ%l4FnCKnj|kT4{K{{_>G7PVlskK z<8S1DKk(DYHh`}%VQe-xHw9&68<3coh>eX67z^q#1_lNM=2)z|lvK^Ye2k!6=`Y#15sDDo^~AAf~3sSQzaipDr&iFYKeAG58Dg W(m0zVdEl%70000 Logo Logo - + - + Date: Thu, 22 Aug 2024 14:45:08 +0300 Subject: [PATCH 5/5] Lock down dependency. (#2035) Co-authored-by: StefanIliev545 --- contracts/package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contracts/package.json b/contracts/package.json index 951a84f4e7..648e64074c 100644 --- a/contracts/package.json +++ b/contracts/package.json @@ -28,6 +28,7 @@ "ten-hardhat-plugin": "^0.0.9" }, "peerDependencies": { - "@nomicfoundation/hardhat-verify" : "2.0.8" + "@nomicfoundation/hardhat-verify" : "2.0.8", + "@nomicfoundation/hardhat-ethers":"3.0.6" } } \ No newline at end of file