From 3fb136a04d6ac18a8f81298540010c3553137860 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Vi=C3=A9not?= Date: Tue, 7 Nov 2023 22:43:40 +0100 Subject: [PATCH] Bump release to 0.1.0-rc3 (#70) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Simon ViƩnot Co-authored-by: Matt Halder --- README.md | 2 +- charts/Chart.yaml | 2 +- .../server-repository/reset-job.yaml | 39 +++++++++ charts/values.yaml | 14 ++++ hedera-patch/h5ai-nginx.patch | 79 +++++++++++++++++-- openapi.yaml | 2 +- package.json | 2 +- ui/src/pages/Verifier/index.tsx | 1 - 8 files changed, 130 insertions(+), 11 deletions(-) create mode 100644 charts/templates/server-repository/reset-job.yaml diff --git a/README.md b/README.md index b3e7df06..4c0c2c8a 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Make sure the repository submodule h5ai-nginx is present: - `git submodule update --init --recursive` Apply the Hedera patch to the `h5ai-nginx` submodule (execute this only once). -- `./scripts/hedera-apply-patch.sh` +- `./scripts/hedera-apply-h5ai-nginx-patch.sh` ## Local build for development diff --git a/charts/Chart.yaml b/charts/Chart.yaml index cbf5db18..b8968307 100644 --- a/charts/Chart.yaml +++ b/charts/Chart.yaml @@ -2,4 +2,4 @@ apiVersion: v2 description: Helm chart of [hashgraph/hedera-sourcify](https://github.com/hashgraph/hedera-sourcify) repository service. name: sourcify type: application -version: 0.1.0-rc2 \ No newline at end of file +version: 0.1.0-rc3 \ No newline at end of file diff --git a/charts/templates/server-repository/reset-job.yaml b/charts/templates/server-repository/reset-job.yaml new file mode 100644 index 00000000..0b20364e --- /dev/null +++ b/charts/templates/server-repository/reset-job.yaml @@ -0,0 +1,39 @@ +{{- if .Values.reset.previewnet-reset.enabled }} +apiVersion: batch/v1 +kind: Job +metadata: + name: {{ printf "%s-%s" .Chart.Name "prvw-reset-job" | trimSuffix "-"| trunc 52 }} +spec: + # activeDeadlineSeconds: 600 ## this is used to termanate the job after 10 minutes. How long does it take to reset and shoud this be set? + # backoffLimit: 0 # Number of failed retries before considering a Job as failed. Defaults to 6 if not set. Should this be set to 0? How many failures are acceptable? + template: + spec: + containers: + - name: reset + image: "{{ .Values.reset.image.repository }}:{{ .Values.reset.image.tag }}" + imagePullPolicy: {{ .Values.reset.image.pullPolicy }} + command: + - /bin/sh + - -c + - https://raw.githubusercontent.com/hashgraph/hedera-sourcify/main/scripts/hedera-reset.sh ; chmod +x hedera-reset.sh ; ./hedera-reset.sh previewnet +{{- end }} +--- +{{- if .Values.reset.testnet-reset.enabled }} +apiVersion: batch/v1 +kind: Job +metadata: + name: {{ printf "%s-%s" .Chart.Name "tsnt-reset-job" | trimSuffix "-"| trunc 52 }} +spec: + # activeDeadlineSeconds: 600 ## this is used to termanate the job after 10 minutes. How long does it take to reset and shoud this be set? + # backoffLimit: 0 # Number of failed retries before considering a Job as failed. Defaults to 6 if not set. Should this be set to 0? How many failures are acceptable? + template: + spec: + containers: + - name: reset + image: "{{ .Values.reset.image.repository }}:{{ .Values.reset.image.tag }}" + imagePullPolicy: {{ .Values.reset.image.pullPolicy }} + command: + - /bin/sh + - -c + - https://raw.githubusercontent.com/hashgraph/hedera-sourcify/main/scripts/hedera-reset.sh ; chmod +x hedera-reset.sh ; ./hedera-reset.sh testnet +{{- end }} \ No newline at end of file diff --git a/charts/values.yaml b/charts/values.yaml index 0cba6b20..fa34479e 100644 --- a/charts/values.yaml +++ b/charts/values.yaml @@ -149,3 +149,17 @@ ui: ## Pod environment variables for UI env: UI_DOMAIN_NAME: "verify.example.com" + +reset: + ## Previewnet reset job, default is to disable + previewnet-reset: + enabled: false + ## Testnet reset job, default is to disable + testnet-reset: + enabled: false + ## Set default immage repository, tag, and pull policy + image: + repository: "apline/curl" + tag: "8.4.0" + pullPolicy: "IfNotPresent" + diff --git a/hedera-patch/h5ai-nginx.patch b/hedera-patch/h5ai-nginx.patch index 692b471f..12c88c2e 100644 --- a/hedera-patch/h5ai-nginx.patch +++ b/hedera-patch/h5ai-nginx.patch @@ -1,4 +1,4 @@ -Subject: [PATCH] h5ai-nginx gets value of SERVER_URL from config.json file. +Subject: [PATCH] h5ai-nginx --- Index: select-contract-form/src/App.js IDEA additional info: @@ -7,7 +7,7 @@ Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP =================================================================== diff --git a/select-contract-form/src/App.js b/select-contract-form/src/App.js --- a/select-contract-form/src/App.js (revision 453a6681ef93a7a43ee339b5301743e27d7a3b62) -+++ b/select-contract-form/src/App.js (date 1695221204280) ++++ b/select-contract-form/src/App.js (date 1699367507735) @@ -2,6 +2,7 @@ import { useEffect, useRef, useState } from "react"; import { Alert, Button, Card, Form, Spinner } from "react-bootstrap"; @@ -16,7 +16,7 @@ diff --git a/select-contract-form/src/App.js b/select-contract-form/src/App.js function App() { const [selectedMatch, setSelectedMatch] = useState("full_match"); -@@ -20,13 +21,26 @@ +@@ -20,17 +21,33 @@ ]; useEffect(() => { @@ -49,6 +49,73 @@ diff --git a/select-contract-form/src/App.js b/select-contract-form/src/App.js return chainsArray; }; getSourcifyChains() +- .then((chains) => setChains(chains)) ++ .then((chains) => { ++ setChains(chains) ++ setChainId(chains[0].chainId) ++ }) + .catch((err) => alert(err)); + }, []); + +Index: Dockerfile +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/Dockerfile b/Dockerfile +--- a/Dockerfile (revision 453a6681ef93a7a43ee339b5301743e27d7a3b62) ++++ b/Dockerfile (date 1699367072922) +@@ -1,6 +1,8 @@ + FROM node:14-alpine + RUN apk add --no-cache git + RUN git clone https://github.com/sourcifyeth/h5ai.git ++COPY h5ai.patch /h5ai.patch ++RUN cd h5ai && git apply /h5ai.patch + RUN cd h5ai && npm install && npm run build + RUN mv $(ls -1 /h5ai/build/*.zip) /h5ai/build/h5ai.zip + RUN ls /h5ai/build/ +Index: h5ai.patch +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/h5ai.patch b/h5ai.patch +new file mode 100644 +--- /dev/null (date 1699293561021) ++++ b/h5ai.patch (date 1699293561021) +@@ -0,0 +1,32 @@ ++Subject: [PATCH] suppress link to remix ++--- ++Index: src/_h5ai/public/js/lib/view/view.js ++IDEA additional info: ++Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP ++<+>UTF-8 ++=================================================================== ++diff --git a/src/_h5ai/public/js/lib/view/view.js b/src/_h5ai/public/js/lib/view/view.js ++--- a/src/_h5ai/public/js/lib/view/view.js (revision 15173ca22fcd4e9b2c0d11bdacc509428dba1bcd) +++++ b/src/_h5ai/public/js/lib/view/view.js (date 1699289694771) ++@@ -32,9 +32,6 @@ ++ ++ ++
++-
++- Open repo in Remix ++-
++ `; ++ const itemTpl = ++ `
  • ++@@ -49,11 +46,9 @@ ++ const $view = dom(viewTpl); ++ const $items = $view.find('#items'); ++ const $hint = $view.find('#view-hint'); ++-const $remix_link = $view.find('#open_in_remix'); ++ const $path = global.window.location.href.split('/'); ++ const $address = $path[6]; ++ const $chainId = $path[5]; ++-$remix_link.attr('href', `https://remix.ethereum.org/?#activate=sourcify&call=sourcify//fetchAndSave//${$address}//${$chainId}`); ++ ++ ++ const cropSize = (size, min, max) => Math.min(max, Math.max(min, size)); Index: select-contract-form/package.json IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP @@ -56,7 +123,7 @@ Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP =================================================================== diff --git a/select-contract-form/package.json b/select-contract-form/package.json --- a/select-contract-form/package.json (revision 453a6681ef93a7a43ee339b5301743e27d7a3b62) -+++ b/select-contract-form/package.json (date 1695221204280) ++++ b/select-contract-form/package.json (date 1699359289868) @@ -6,6 +6,7 @@ "@testing-library/jest-dom": "^5.11.4", "@testing-library/react": "^11.1.0", @@ -72,8 +139,8 @@ Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP =================================================================== diff --git a/select-contract-form/public/config.json b/select-contract-form/public/config.json new file mode 100644 ---- /dev/null (date 1695221304211) -+++ b/select-contract-form/public/config.json (date 1695221304211) +--- /dev/null (date 1699359289869) ++++ b/select-contract-form/public/config.json (date 1699359289869) @@ -0,0 +1,3 @@ + { + "SERVER_URL": "http://localhost:5002" diff --git a/openapi.yaml b/openapi.yaml index fdb8b314..79cb531e 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -1,6 +1,6 @@ openapi: "3.0.0" info: - version: 0.1.0-rc2 + version: 0.1.0-rc3 title: Sourcify API description: API to interact with Sourcify license: diff --git a/package.json b/package.json index 92ca673b..5109d389 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@hashgraph/hedera-sourcify", - "version": "0.1.0-rc2", + "version": "0.1.0-rc3", "description": "A Hedera fork of ethereum sourcify that provides a Solidity metadata-based re-compilation and source verification tool", "private": true, "repository": { diff --git a/ui/src/pages/Verifier/index.tsx b/ui/src/pages/Verifier/index.tsx index aa8339fc..d96eef42 100644 --- a/ui/src/pages/Verifier/index.tsx +++ b/ui/src/pages/Verifier/index.tsx @@ -228,7 +228,6 @@ const Verifier: React.FC = () => { />
    -

    Note: Once a contract is verified it can't be removed from the repository.

    {configuration.termsOfServiceUrl && ( See Terms of Service )}