-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(feat) Squash and merge Zilliqa local changes.
- Loading branch information
1 parent
4ce2e10
commit 49d7123
Showing
83 changed files
with
4,425 additions
and
183 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
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,134 @@ | ||
name: Publish Docker image | ||
|
||
on: | ||
push: | ||
branches: | ||
- "develop" | ||
tags: | ||
- "*" | ||
|
||
env: | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
platform: | ||
- linux/amd64 | ||
- linux/arm64 | ||
steps: | ||
- name: Prepare | ||
run: | | ||
platform=${{ matrix.platform }} | ||
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Docker Setup Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Docker Login | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Docker Login | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USER }} | ||
password: ${{ secrets.DOCKERHUB_PASSWORD }} | ||
|
||
- name: Docker Metadata action | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: | | ||
otterscan/otterscan | ||
ghcr.io/${{ env.IMAGE_NAME }} | ||
|
||
- name: Build and push by digest | ||
id: build | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
platforms: ${{ matrix.platform }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
outputs: type=image,name=${{ env.IMAGE_NAME }},push-by-digest=true,name-canonical=true,push=true | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
|
||
- name: Export digest | ||
run: | | ||
mkdir -p /tmp/digests | ||
digest="${{ steps.build.outputs.digest }}" | ||
touch "/tmp/digests/${digest#sha256:}" | ||
|
||
- name: Upload digest | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: digests-${{ env.PLATFORM_PAIR }} | ||
path: /tmp/digests/* | ||
if-no-files-found: error | ||
retention-days: 1 | ||
|
||
merge: | ||
name: Push Docker image to Docker Hub | ||
runs-on: ubuntu-latest | ||
needs: | ||
- build | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Download digests | ||
uses: actions/download-artifact@v4 | ||
with: | ||
path: /tmp/digests | ||
pattern: digests-* | ||
merge-multiple: true | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: | | ||
otterscan/otterscan | ||
ghcr.io/${{ env.IMAGE_NAME }} | ||
|
||
- name: Docker Login | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Docker Login | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USER }} | ||
password: ${{ secrets.DOCKERHUB_PASSWORD }} | ||
|
||
- name: Create manifest list and push | ||
working-directory: /tmp/digests | ||
run: | | ||
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ | ||
$(printf '${{ env.IMAGE_NAME }}@sha256:%s ' *) | ||
|
||
- name: Inspect image | ||
run: | | ||
docker buildx imagetools inspect ${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.version }} |
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,25 @@ | ||
--- .github/workflows/docker-publish.yaml | ||
+++ .github/workflows/docker-publish.yaml | ||
@@ -47,15 +37,19 @@ jobs: | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: | | ||
- otterscan/otterscan | ||
- ghcr.io/${{ env.IMAGE_NAME }} | ||
+ zilliqa/otterscan | ||
+ tags: | | ||
+ type=ref,enable=false,priority=600,prefix=pr-,suffix=,event=pr | ||
+ type=ref,event=branch | ||
+ type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }} | ||
+ type=semver,pattern={{raw}} | ||
|
||
- name: Build and push Docker images | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
push: true | ||
- platforms: linux/amd64,linux/arm64 | ||
+ platforms: linux/amd64 | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
cache-from: type=local,src=/tmp/.buildx-cache |
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,13 @@ | ||
name: Check main PR source branch | ||
on: | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
jobs: | ||
check-pr-source: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Verify source branch | ||
if: github.base_ref == 'main' && github.head_ref != 'develop' | ||
run: | | ||
echo "Error: Pull request source branch is not 'develop'." | ||
exit 1 |
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,30 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
/.pnp | ||
.pnp.js | ||
|
||
# testing | ||
/coverage | ||
/storybook-static | ||
/cypress/screenshots | ||
/cypress/videos | ||
|
||
# production | ||
/build | ||
/dist | ||
|
||
# misc | ||
.DS_Store | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
/.vscode | ||
.gitsigners |
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,12 @@ | ||
--- .gitignore | ||
+++ .gitignore | ||
@@ -14,6 +21,9 @@ | ||
|
||
# testing | ||
/coverage | ||
+/storybook-static | ||
+/cypress/screenshots | ||
+/cypress/videos | ||
|
||
# production | ||
/build |
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,12 @@ | ||
--- .storybook/main.ts | ||
+++ .storybook/main.ts | ||
@@ -17,6 +17,9 @@ const config: StorybookConfig = { | ||
typescript: { | ||
reactDocgen: false, | ||
}, | ||
+ core: { | ||
+ disableTelemetry: true, | ||
+ }, | ||
}; | ||
|
||
export default config; |
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 @@ | ||
--- .storybook/preview-head.html | ||
+++ .storybook/preview-head.html | ||
@@ -1,3 +1,3 @@ | ||
<script> | ||
window.global = window; | ||
-</script>+</script> |
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,20 @@ | ||
--- .storybook/preview.tsx | ||
+++ .storybook/preview.tsx | ||
@@ -1,12 +1,11 @@ | ||
-import React from "react"; | ||
-import { Decorator } from "@storybook/react"; | ||
-import { INITIAL_VIEWPORTS } from "@storybook/addon-viewport"; | ||
-import { BrowserRouter as Router } from "react-router-dom"; | ||
import "@fontsource/fira-code/index.css"; | ||
-import "@fontsource/space-grotesk/index.css"; | ||
-import "@fontsource/roboto/index.css"; | ||
import "@fontsource/roboto-mono/index.css"; | ||
+import "@fontsource/roboto/index.css"; | ||
import "@fontsource/space-grotesk/files/space-grotesk-latin-400-normal.woff2"; | ||
+import "@fontsource/space-grotesk/index.css"; | ||
+import { INITIAL_VIEWPORTS } from "@storybook/addon-viewport"; | ||
+import { Decorator } from "@storybook/react"; | ||
+import { BrowserRouter as Router } from "react-router-dom"; | ||
import "../src/index.css"; | ||
|
||
export const parameters = { |
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,42 @@ | ||
--- Dockerfile | ||
+++ Dockerfile | ||
@@ -1,10 +1,10 @@ | ||
-FROM node:20.8.1-alpine3.17 AS builder | ||
+FROM node:20.10.0-alpine3.17 AS builder | ||
WORKDIR /otterscan-build | ||
-COPY ["package.json", "package-lock.json", "/otterscan-build/"] | ||
-RUN npm ci | ||
-COPY ["run-nginx.sh", "tsconfig.json", "tsconfig.node.json", "postcss.config.js", "tailwind.config.js", "vite.config.ts", "index.html", "/otterscan-build/"] | ||
-COPY ["public", "/otterscan-build/public/"] | ||
-COPY ["src", "/otterscan-build/src/"] | ||
+COPY --link ["package.json", "package-lock.json", "/otterscan-build/"] | ||
+RUN npm ci --fetch-timeout 600000 --verbose | ||
+COPY --link ["run-nginx.sh", "tsconfig.json", "tsconfig.node.json", "postcss.config.js", "tailwind.config.js", "vite.config.ts", "index.html", "/otterscan-build/"] | ||
+COPY --link ["public", "/otterscan-build/public/"] | ||
+COPY --link ["src", "/otterscan-build/src/"] | ||
RUN npm run build | ||
|
||
# Add brotli module to official nginx image | ||
@@ -71,14 +71,14 @@ RUN set -ex \ | ||
&& rm -rf /tmp/packages | ||
RUN apk update && apk add jq | ||
WORKDIR /usr/share/nginx/html/ | ||
-COPY --from=otterscan/otterscan-assets:v1.1.1 /usr/share/nginx/html/chains chains/ | ||
-COPY --from=otterscan/otterscan-assets:v1.1.1 /usr/share/nginx/html/topic0 topic0/ | ||
-COPY --from=otterscan/otterscan-assets:v1.1.1 /usr/share/nginx/html/assets assets/ | ||
-COPY --from=otterscan/otterscan-assets:v1.1.1 /usr/share/nginx/html/signatures signatures/ | ||
-COPY nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf | ||
-COPY nginx/nginx.conf /etc/nginx/nginx.conf | ||
-COPY --from=builder /otterscan-build/dist /usr/share/nginx/html/ | ||
-COPY --from=builder /otterscan-build/run-nginx.sh / | ||
+COPY --link --from=otterscan/otterscan-assets:v1.1.1 /usr/share/nginx/html/chains chains/ | ||
+COPY --link --from=otterscan/otterscan-assets:v1.1.1 /usr/share/nginx/html/topic0 topic0/ | ||
+COPY --link --from=otterscan/otterscan-assets:v1.1.1 /usr/share/nginx/html/assets assets/ | ||
+COPY --link --from=otterscan/otterscan-assets:v1.1.1 /usr/share/nginx/html/signatures signatures/ | ||
+COPY --link nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf | ||
+COPY --link nginx/nginx.conf /etc/nginx/nginx.conf | ||
+COPY --link --from=builder /otterscan-build/dist /usr/share/nginx/html/ | ||
+COPY --link --from=builder /otterscan-build/run-nginx.sh / | ||
WORKDIR / | ||
|
||
CMD ["/run-nginx.sh"] |
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,10 @@ | ||
--- README.md | ||
+++ README.md | ||
@@ -118,4 +118,6 @@ Follow the creator on Twitter for more updates ([@wmitsuda](https://twitter.com/ | ||
|
||
### Donation address | ||
|
||
-If you like this project, feel free to send donations to `otterscan.eth` or use our gitcoin grant page: https://gitcoin.co/grants/3224/otterscan | ||
+If you like this project, feel free to send donations to `otterscan.eth` on any EVM chain (it's an EOA). | ||
+ | ||
+We also participate regularly on Gitcoin Grants rounds. |
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
Oops, something went wrong.