Skip to content

Commit

Permalink
Update default favicon (#60)
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Viénot <[email protected]>
(cherry picked from commit d69a87c)
  • Loading branch information
svienot committed Nov 2, 2023
1 parent 341166c commit 599174f
Show file tree
Hide file tree
Showing 7 changed files with 89 additions and 35 deletions.
76 changes: 44 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,14 @@ or build the images locally.

- Run `docker-compose -f environments/docker-compose-hedera.yaml down`

### Reset network

- To reset **testnet**:
`docker exec server-latest /home/app/hedera-reset-docker.sh testnet`

- To reset **previewnet**:
`docker exec server-latest /home/app/hedera-reset-docker.sh previewnet`

## Test

### Basic non-regression server test
Expand All @@ -110,6 +118,8 @@ Example contents for `config.json`:
"SERVER_URL": "https://server.sourcify-integration.hedera-devops.com",
"REPOSITORY_SERVER_URL": "https://repository.sourcify-integration.hedera-devops.com",
"EXPLORER_URL": "http://localhost:8080",
"BRAND_PRODUCT_LOGO_URL": "http://example.com/path/to/my-logo.jpg",
"TERMS_OF_SERVICE_URL": http://example.com/path/to/my-terms.html"",
"REMOTE_IMPORT": false,
"GITHUB_IMPORT": false,
"CONTRACT_IMPORT": false,
Expand All @@ -120,36 +130,38 @@ Example contents for `config.json`:
```
The following properties can be provided in config.json

| Name | Description |
|----------------------------|------------------------------------------------------------------------------|
| `SERVER_URL` | URL of the server (from outside the cluster). |
| `REPOSITORY_SERVER_URL` | HTTP port exposed by container |
| `EXPLORER_URL` | URL of the mirror-node explorer |
| `REMOTE_IMPORT` | Flag to activate mode "Import from remote" |
| `GITHUB_IMPORT` | Flag to activate mode "Import from GitHub" |
| `CONTRACT_IMPORT` | Flag to activate mode "Import from contract's metadata" |
| `JSON_IMPORT` | Flag to activate mode "Import contracts from Solidity's Standard JSON Input" |
| `OPEN_IN_REMIX` | Flag to activate link "Open in Remix" |
| `CREATE2_VERIFICATION` | Flag to activate create2 verification |
| Name | Description |
|-----------------------------|-------------------------------------------------------------------------------------------------|
| `SERVER_URL` | URL of the server (from outside the cluster). |
| `REPOSITORY_SERVER_URL` | HTTP port exposed by container |
| `EXPLORER_URL` | URL of the mirror-node explorer |
| `BRAND_PRODUCT_LOGO_URL` | URL of the header top left product logo (default is Hedera logo) |
| `TERMS_OF_SERVICE_URL` | URL of the terms-of-service document linked from bottom of page (default is no link) |
| `REMOTE_IMPORT` | Flag to activate mode "Import from remote" (default is false) |
| `GITHUB_IMPORT` | Flag to activate mode "Import from GitHub" (default is false) |
| `CONTRACT_IMPORT` | Flag to activate mode "Import from contract's metadata" (default is false) |
| `JSON_IMPORT` | Flag to activate mode "Import contracts from Solidity's Standard JSON Input" (default is false) |
| `OPEN_IN_REMIX` | Flag to activate link "Open in Remix" (default is false) |
| `CREATE2_VERIFICATION` | Flag to activate create2 verification (default is false) |

### _server_ module

The following environment variables are needed by the _server_ at runtime:

| Name | Example value | Description |
|-------------------------------|-----------------------------------------------------------|-----------------------------------------------------------------------------------------|
| `REPOSITORY_PATH` | ../../data/repository | DO NOT CHANGE - Path of the contract repository, both inside container and on the host. |
| `SOLC_REPO` | /home/data/solc-bin/linux-amd64 | Path where Solidity compiler binaries will be saved (inside container) |
| `SOLJSON_REPO` | /home/data/solc-bin/soljson | Path where Solidity JS compilers will be saved (inside container) |
| `SOLC_REPO_HOST` | ../../data/solc-bin/linux-amd64 | Path for the Solidity compiler binaries downloaded (on host machine) |
| `SOLJSON_REPO_HOST` | ../../data/solc-bin/soljson | Path for the Solidity JS compilers downloaded (on host machine) |
| `SERVER_PORT` | 80 | HTTP port used inside container |
| `SERVER_EXTERNAL_PORT` | 5002 | HTTP port exposed by container |
| `UI_DOMAIN_NAME` | sourcify-integration.hedera-devops.com | Fully qualified domain name of the host running the ui |
| `SERVER_CREATE2_VERIFICATION` | false | Flag to activate server API endpoints related to create2 {true, false} |
| `REPOSITORY_SERVER_URL` | https://repository.sourcify-integration.hedera-devops.com | URL of repository server (from outside the cluster) |
| `TESTING` | false | DO NOT CHANGE |
| `TAG` | latest | DO NOT CHANGE |
| Name | Example value | Description |
|-------------------------------|---------------------------------|-----------------------------------------------------------------------------------------|
| `REPOSITORY_PATH` | ../../data/repository | DO NOT CHANGE - Path of the contract repository, both inside container and on the host. |
| `SOLC_REPO` | /home/data/solc-bin/linux-amd64 | Path where Solidity compiler binaries will be saved (inside container) |
| `SOLJSON_REPO` | /home/data/solc-bin/soljson | Path where Solidity JS compilers will be saved (inside container) |
| `SOLC_REPO_HOST` | ../../data/solc-bin/linux-amd64 | Path for the Solidity compiler binaries downloaded (on host machine) |
| `SOLJSON_REPO_HOST` | ../../data/solc-bin/soljson | Path for the Solidity JS compilers downloaded (on host machine) |
| `SERVER_PORT` | 80 | HTTP port used inside container |
| `SERVER_EXTERNAL_PORT` | 5002 | HTTP port exposed by container |
| `UI_DOMAIN_NAME` | example.com | Fully qualified domain name of the host running the ui |
| `SERVER_CREATE2_VERIFICATION` | false | Flag to activate server API endpoints related to create2 {true, false} |
| `REPOSITORY_SERVER_URL` | repository.example.com | URL of repository server (from outside the cluster) |
| `TESTING` | false | DO NOT CHANGE |
| `TAG` | latest | Added to the docker image tags (e.g. ui-latest, server-latest, repository-latest) |

### _repository_ module

Expand All @@ -162,13 +174,13 @@ even though the only useful item for the _repository_ is the following:

- The web server part needs the following environment variables at runtime:

| Name | Example value | Description |
|-----------------------------------|----------------------------------------|--------------------------------------------------------|
| `REPOSITORY_PATH` | ../../data/repository | Path of the contract repository on the host. |
| `REPOSITORY_SERVER_EXTERNAL_PORT` | 10000 | HTTP port exposed by container |
| `UI_DOMAIN_NAME` | sourcify-integration.hedera-devops.com | Fully qualified domain name of the host running the ui |
| `TESTING` | false | DO NOT CHANGE |
| `TAG` | latest | DO NOT CHANGE |
| Name | Example value | Description |
|-----------------------------------|-----------------------|----------------------------------------------------------------------------------------|
| `REPOSITORY_PATH` | ../../data/repository | Path of the contract repository on the host. |
| `REPOSITORY_SERVER_EXTERNAL_PORT` | 10000 | HTTP port exposed by container |
| `UI_DOMAIN_NAME` | example.com | Fully qualified domain name of the host running the ui |
| `TESTING` | false | DO NOT CHANGE |
| `TAG` | latest | Added to the docker image tags (e.g. ui-latest, server-latest, repository-latest) |


## Release
Expand Down
41 changes: 41 additions & 0 deletions scripts/hedera-reset-docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/bash
#
# Resets the contract verifications for the given network by removing the 2 directories
# in the repository which store the partial matches and full matches.
# Assumes that the services (server, ui, repository) are shutdown
#

if [ "$#" -ne 1 ]; then
echo "Usage: hedera-reset-docker.sh testnet | previewnet"
exit 22
fi

case ${1} in
previewnet) CHAIN_ID=297 ;;
testnet) CHAIN_ID=296 ;;
*) echo "Usage: hedera-reset-docker.sh testnet | previewnet"; exit 22;;
esac

CONTRACT_PATH="/home/data/repository/contracts"

if [ ! -d "${CONTRACT_PATH}" ]; then
echo "Expected contract repository was not found at this path: ${CONTRACT_PATH}"
exit 2
fi

PARTIAL_MATCH_PATH="${CONTRACT_PATH}/partial_match/${CHAIN_ID}"
FULL_MATCH_PATH="${CONTRACT_PATH}/full_match/${CHAIN_ID}"

reset_network () {
NETWORK_PATH=${1}
if [ -d "${NETWORK_PATH}" ]; then
echo " Erasing contents of ${NETWORK_PATH}"
rm -rf "${NETWORK_PATH}"
else
echo " ${NETWORK_PATH} does not exist"
fi
}

echo "Resetting Hedera ${1} (Chain ID: ${CHAIN_ID})"
reset_network ${PARTIAL_MATCH_PATH}
reset_network ${FULL_MATCH_PATH}
1 change: 1 addition & 0 deletions src/Dockerfile.server
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ COPY packages ./packages
COPY src ./src
COPY *.json ./
COPY openapi.yaml ./openapi.yaml
COPY scripts/hedera-reset-docker.sh ./

RUN npm config set fetch-retry-mintimeout 20000
RUN npm config set fetch-retry-maxtimeout 120000
Expand Down
Binary file modified ui/public/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ui/public/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ui/public/favicon.ico
Binary file not shown.
6 changes: 3 additions & 3 deletions ui/public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"short_name": "sourcify.eth",
"name": "sourcify.eth",
"description": "Sourcify: Solidity contract source code and metadata verification tool",
"short_name": "Hedera Verifier",
"name": "Hedera Verifier",
"description": "Hedera Verifier: Solidity contract source code and metadata verification tool",
"icons": [
{
"src": "favicon.ico",
Expand Down

0 comments on commit 599174f

Please sign in to comment.