Skip to content

Commit

Permalink
feat: Add support for smart contract verification
Browse files Browse the repository at this point in the history
Signed-off-by: Yaroslav Markovski <[email protected]>
  • Loading branch information
yaroslav-007 committed Mar 21, 2024
1 parent e9e73a6 commit da21838
Show file tree
Hide file tree
Showing 4 changed files with 148 additions and 3 deletions.
12 changes: 12 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,15 @@ PROMETHEUS_IMAGE_TAG=v2.41.0
### Grafana ####
GRAFANA_IMAGE_NAME=grafana/grafana
GRAFANA_IMAGE_TAG=8.5.16

### Sourcify ####
#Sourcify Common
SOURCIFY_TESTING=false
SOURCIFY_TAG=main
SOURCIFY_UI_DOMAIN_NAME=localhost
SOURCIFY_SERVER_REPOSITORY_PATH=/data
#Sourcify Server
SOURCIFY_SERVER_SOLC_REPO=/data/solc-bin/linux-amd64
SOURCIFY_SERVER_SOLJSON_REPO=/data/solc-bin/soljson
SOURCIFY_SERVER_CREATE2_VERIFICATION=false
SOURCIFY_USE_LOCAL_NODE=true
72 changes: 69 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,11 @@ services:
restart: "unless-stopped"
ports:
- "8080:8080"
environment:
DOCKER_LOCAL_MIRROR_NODE_MENU_NAME: ${DOCKER_LOCAL_MIRROR_NODE_MENU_NAME}
DOCKER_LOCAL_MIRROR_NODE_URL: ${DOCKER_LOCAL_MIRROR_NODE_URL}
volumes:
- ./networks-config.json:/app/networks-config.json #workaround to https://github.com/hashgraph/hedera-mirror-node-explorer/issues/933
# environment:
# DOCKER_LOCAL_MIRROR_NODE_MENU_NAME: ${DOCKER_LOCAL_MIRROR_NODE_MENU_NAME}
# DOCKER_LOCAL_MIRROR_NODE_URL: ${DOCKER_LOCAL_MIRROR_NODE_URL}

web3:
image: "${MIRROR_IMAGE_PREFIX}hedera-mirror-web3:${MIRROR_IMAGE_TAG}"
Expand Down Expand Up @@ -492,6 +494,68 @@ services:
network-node-bridge:
ipv4_address: 172.27.0.50

sourcify-repository:
image: ghcr.io/hashgraph/hedera-sourcify:repository-${SOURCIFY_TAG}
restart: unless-stopped
container_name: sourcify-repository-${SOURCIFY_TAG}
ports:
- "10000:80"
volumes:
- sourcify-repository:/data:ro
networks:
- mirror-node
environment:
REPOSITORY_PATH: "${SOURCIFY_SERVER_REPOSITORY_PATH}"
REPOSITORY_SERVER_EXTERNAL_PORT: 10000
UI_DOMAIN_NAME: "${SOURCIFY_UI_DOMAIN_NAME}"
TESTING: "${SOURCIFY_TESTING}"
TAG: "${SOURCIFY_TAG}"

sourcify-server:
image: ghcr.io/hashgraph/hedera-sourcify:server-${SOURCIFY_TAG}
restart: unless-stopped
container_name: sourcify-server-${SOURCIFY_TAG}
ports:
- "5002:5002"
volumes:
- sourcify-repository:/data
networks:
- mirror-node
environment:
SERVER_PORT: "5002"
UI_DOMAIN_NAME: "${SOURCIFY_UI_DOMAIN_NAME}"
SERVER_CREATE2_VERIFICATION: "${SOURCIFY_SERVER_CREATE2_VERIFICATION}"
TESTING: "${SOURCIFY_TESTING}"
TAG: "${SOURCIFY_TAG}"
SOLC_REPO: "${SOURCIFY_SERVER_SOLC_REPO}"
SOLJSON_REPO: "${SOURCIFY_SERVER_SOLJSON_REPO}"
REPOSITORY_PATH: "${SOURCIFY_SERVER_REPOSITORY_PATH}"
REPOSITORY_SERVER_URL: "http://sourcify-repository-${SOURCIFY_TAG}"
USE_LOCAL_NODE: "${SOURCIFY_USE_LOCAL_NODE}"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5002/health"]
interval: 30s
timeout: 10s
retries: 10

sourcify-ui:
image: ghcr.io/hashgraph/hedera-sourcify:ui-${SOURCIFY_TAG}
restart: unless-stopped
container_name: sourcify-ui-${SOURCIFY_TAG}
ports:
- "1234:80"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost"]
interval: 30s
timeout: 10s
retries: 10
volumes:
- type: bind
source: ./sourcify-ui-docker-config.json
target: /usr/share/nginx/html/config.json
networks:
- mirror-node

networks:
network-node-bridge:
name: network-node-bridge
Expand All @@ -518,3 +582,5 @@ volumes:
name: prometheus-data
grafana-data:
name: grafana-data
sourcify-repository:
name: sourcify-repository
54 changes: 54 additions & 0 deletions networks-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
[
{
"name": "mainnet",
"displayName": "MAINNET",
"url": "https://mainnet-public.mirrornode.hedera.com/",
"ledgerID": "00",
"sourcifySetup": {
"activate": true,
"repoURL": "https://repository.local/contracts/",
"serverURL": "https://localhost/server/",
"verifierURL": "https://localhost/#/",
"chainID": 295
}
},
{
"name": "testnet",
"displayName": "TESTNET",
"url": "https://testnet.mirrornode.hedera.com/",
"ledgerID": "01",
"sourcifySetup": {
"activate": true,
"repoURL": "https://repository.local/contracts/",
"serverURL": "https://localhost/server/",
"verifierURL": "https://localhost/#/",
"chainID": 296
}
},
{
"name": "previewnet",
"displayName": "PREVIEWNET",
"url": "https://previewnet.mirrornode.hedera.com/",
"ledgerID": "02",
"sourcifySetup": {
"activate": true,
"repoURL": "https://repository.local/contracts/",
"serverURL": "https://localhost/server/",
"verifierURL": "https://localhost/#/",
"chainID": 297
}
},
{
"name": "local",
"displayName": "LOCALNET",
"url": "http://localhost:5551/",
"ledgerID": "03",
"sourcifySetup": {
"activate": true,
"repoURL": "http://localhost:10000/",
"serverURL": "http://localhost:5002/",
"verifierURL": "http://localhost:1234/#/",
"chainID": 298
}
}
]
13 changes: 13 additions & 0 deletions sourcify-ui-docker-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"SERVER_URL": "http://localhost:5002",
"REPOSITORY_SERVER_URL": "http://localhost:10000",
"EXPLORER_URL": "http://localhost:8080",
"BRAND_PRODUCT_LOGO_URL": "",
"TERMS_OF_SERVICE_URL": "",
"REMOTE_IMPORT": false,
"GITHUB_IMPORT": false,
"CONTRACT_IMPORT": false,
"JSON_IMPORT": false,
"OPEN_IN_REMIX": false,
"CREATE2_VERIFICATION": false
}

0 comments on commit da21838

Please sign in to comment.