Skip to content

Commit

Permalink
Merge pull request #823 from ethereum/staging
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
marcocastignoli authored Oct 19, 2022
2 parents d1ee011 + d328ca1 commit 6d40731
Show file tree
Hide file tree
Showing 29 changed files with 311 additions and 227 deletions.
72 changes: 72 additions & 0 deletions environments/.env.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Server config
REPOSITORY_PATH=/tmp/sourcify/repository
SOLC_REPO=/tmp/solc-bin/linux-amd64
SOLJSON_REPO=/tmp/solc-bin/soljson
SERVER_PORT=5555
SESSION_SECRET=yoursessionsecret
IPFS_GATEWAY=http://ipfs.io/ipfs/

# Repository web server config
REPOSITORY_SERVER_URL=http://localhost:10000

# Monitor config
MONITOR_PORT=80
MONITOR_FETCH_TIMEOUT=300000

# S3 config
AWS_S3_ACCESS_KEY_ID=xxx
AWS_S3_SECRET_ACCESS_KEY=xxx
BUCKET_NAME=s3://sourcify-backup-s3
# Chainsafe Storage S3 config
CHAINSAFE_S3_ACCESS_KEY_ID=xxx
CHAINSAFE_S3_SECRET_ACCESS_KEY=xxx

# IPFS config
IPFS_SECRET=xxx
# IPNS=k51qzi5uqu5dkuzo866rys9qexfvbfdwxjc20njcln808mzjrhnorgu5rh30lb
IPNS=repo.staging.sourcify.dev # Use DNSLink
# Leave API blank if you don't run an ipfs node
IPFS_API=
# IPs to announce with the ipfs id
PUBLIC_IP=xxx
LOCAL_IP=xxx
# Pinning services
ESTUARY_PINNING_SECRET=xxx
WEB3_STORAGE_PINNING_SECRET=xxx

# NPM config
NPM_TOKEN=xxx

# Docker config
## Where to mount the downloaded compilers directory on the host machine
SOLC_REPO_HOST=/home/gather/staging/data/solc-bin/linux-amd64
SOLJSON_REPO_HOST=/home/gather/staging/data/solc-bin/bin
## Ports to access containers from the host
SERVER_EXTERNAL_PORT=5555
UI_EXTERNAL_PORT=1234
REPOSITORY_SERVER_EXTERNAL_PORT=10000
MONITOR_EXTERNAL_PORT=3000
IPFS_GW_EXTERNAL_PORT=5050
IPFS_LIBP2P_EXTERNAL_PORT=4002
IPFS_API_EXTERNAL_PORT=5002
SERVER_URL=https://staging.sourcify.dev/server

# Custom nodes
NODE_ADDRESS=
NODE_PORT_MAINNET=
NODE_PORT_RINKEBY=
NODE_PORT_GOERLI=
NODE_PORT_SEPOLIA=

# Other config
TESTING=false
TAG=latest
NODE_ENV=development
INFURA_ID=xxx
ALCHEMY_ID=xxx
# Optional, if not set will use ALCHEMY_ID
ALCHEMY_ID_OPTIMISM=
# Optional, if not set will use ALCHEMY_ID
ALCHEMY_ID_ARBITRUM=
# Needed for the Import from Etherscan functionality
ETHERSCAN_API_KEY=
51 changes: 24 additions & 27 deletions environments/.env.latest
Original file line number Diff line number Diff line change
@@ -1,24 +1,18 @@
# Monitor config
MONITOR_EXTERNAL_PORT=3000
MONITOR_PORT=80
MONITOR_FETCH_TIMEOUT=300000

# UI config
UI_EXTERNAL_PORT=1234

# Server config
SERVER_EXTERNAL_PORT=5000
SERVER_PORT=80
SERVER_URL=https://staging.sourcify.dev/server
REPOSITORY_PATH=../../data/repository
SOLC_REPO=/home/data/solc-bin/linux-amd64
SOLJSON_REPO=/home/data/solc-bin/soljson
SERVER_PORT=80
SESSION_SECRET=xxx
IPFS_GATEWAY=http://ipfs-latest:8080/ipfs/

# Repository config
REPOSITORY_EXTERNAL_PORT=10000
REPOSITORY_PORT=80
REPOSITORY_URL=https://repo.staging.sourcify.dev
REPOSITORY_PATH=../../data/repository
# Repository web server config
REPOSITORY_SERVER_PORT=80
REPOSITORY_SERVER_URL=https://repo.staging.sourcify.dev

# Monitor config
MONITOR_PORT=80
MONITOR_FETCH_TIMEOUT=300000

# S3 config
AWS_S3_ACCESS_KEY_ID=xxx
Expand All @@ -30,12 +24,8 @@ CHAINSAFE_S3_SECRET_ACCESS_KEY=xxx

# IPFS config
IPFS_SECRET=xxx
IPFS_GW_EXTERNAL_PORT=5050
IPFS_LIBP2P_EXTERNAL_PORT=4002
IPFS_API_EXTERNAL_PORT=5002
# IPNS=k51qzi5uqu5dkuzo866rys9qexfvbfdwxjc20njcln808mzjrhnorgu5rh30lb
IPNS=repo.staging.sourcify.dev # Use DNSLink
IPFS_GATEWAY=http://ipfs-latest:8080/ipfs/
# Leave API blank if you don't run an ipfs node
# IPFS_API=http://ipfs-latest:5001
# IPs to announce with the ipfs id
Expand All @@ -45,23 +35,30 @@ LOCAL_IP=xxx
ESTUARY_PINNING_SECRET=xxx
WEB3_STORAGE_PINNING_SECRET=xxx

# Fetch config
FETCH_TIMEOUT=1500

# NPM config
NPM_TOKEN=xxx

# Docker config
## Where to mount the downloaded compilers directory on the host machine
SOLC_REPO_HOST=/home/gather/staging/data/solc-bin/linux-amd64
SOLJSON_REPO_HOST=/home/gather/staging/data/solc-bin/bin
## Ports to access containers from the host
SERVER_EXTERNAL_PORT=5000
UI_EXTERNAL_PORT=1234
REPOSITORY_SERVER_EXTERNAL_PORT=10000
MONITOR_EXTERNAL_PORT=3000
IPFS_GW_EXTERNAL_PORT=5050
IPFS_LIBP2P_EXTERNAL_PORT=4002
IPFS_API_EXTERNAL_PORT=5002
SERVER_URL=https://staging.sourcify.dev/server

# Custom nodes
NODE_ADDRESS=http://10.10.42.102
NODE_PORT_MAINNET=8541
NODE_PORT_RINKEBY=8544
NODE_PORT_GOERLI=8545
NODE_PORT_SEPOLIA=8546

# Docker config
SOLC_REPO_HOST=/home/gather/staging/data/solc-bin/linux-amd64
SOLJSON_REPO_HOST=/home/gather/staging/data/solc-bin/bin

# Other config
TESTING=false
TAG=latest
Expand Down
49 changes: 23 additions & 26 deletions environments/.env.stable
Original file line number Diff line number Diff line change
@@ -1,38 +1,28 @@
# Monitor config
MONITOR_EXTERNAL_PORT=3001
MONITOR_PORT=80
MONITOR_FETCH_TIMEOUT=300000

# UI config
UI_EXTERNAL_PORT=1235

# Server config
SERVER_EXTERNAL_PORT=5002
SERVER_PORT=80
SERVER_URL=https://sourcify.dev/server
SOLC_REPO=/home/data/solc-bin/linux-amd64
SOLJSON_REPO=/home/data/solc-bin/soljson
SESSION_SECRET=xxx

# Repository config
REPOSITORY_EXTERNAL_PORT=10001
REPOSITORY_PORT=80
REPOSITORY_URL=https://repo.sourcify.dev
IPFS_GATEWAY=http://ipfs-stable:8080/ipfs/
REPOSITORY_PATH=../../data/repository

# Repository web server config
REPOSITORY_SERVER_PORT=80
REPOSITORY_SERVER_URL=https://repo.sourcify.dev

# Monitor config
MONITOR_PORT=80
MONITOR_FETCH_TIMEOUT=300000

# S3 config
AWS_S3_ACCESS_KEY_ID=xxx
AWS_S3_SECRET_ACCESS_KEY=xxx
BUCKET_NAME=s3://sourcify-backup-s3

# IPFS config
IPFS_SECRET=xxx
IPFS_GW_EXTERNAL_PORT=5051
IPFS_LIBP2P_EXTERNAL_PORT=4003
IPFS_API_EXTERNAL_PORT=5003
# IPNS=k51qzi5uqu5dll0ocge71eudqnrgnogmbr37gsgl12uubsinphjoknl6bbi41p
IPNS=repo.sourcify.dev # Use DNSLink
IPFS_GATEWAY=http://ipfs-stable:8080/ipfs/
# Leave API blank if you don't run an ipfs node
# IPFS_API=http://ipfs-stable:5001
# IPs to announce with the ipfs id
Expand All @@ -42,23 +32,30 @@ LOCAL_IP=xxx
ESTUARY_PINNING_SECRET=xxx
WEB3_STORAGE_PINNING_SECRET=xxx

# Fetch config
FETCH_TIMEOUT=1500

# NPM config
NPM_TOKEN=xxx

# Docker config
## Where to mount the downloaded compilers directory on the host machine
SOLC_REPO_HOST=/home/sourcify/production/data/solc-bin/linux-amd64
SOLJSON_REPO_HOST=/home/sourcify/production/data/solc-bin/bin
## Ports to access containers from the host
SERVER_EXTERNAL_PORT=5002
UI_EXTERNAL_PORT=1235
REPOSITORY_SERVER_EXTERNAL_PORT=10001
MONITOR_EXTERNAL_PORT=3001
IPFS_GW_EXTERNAL_PORT=5051
IPFS_LIBP2P_EXTERNAL_PORT=4003
IPFS_API_EXTERNAL_PORT=5003
SERVER_URL=https://sourcify.dev/server

# Custom nodes
NODE_ADDRESS=http://10.10.42.102
NODE_PORT_MAINNET=8541
NODE_PORT_RINKEBY=8544
NODE_PORT_GOERLI=8545
NODE_PORT_SEPOLIA=8546

# Docker config
SOLC_REPO_HOST=/home/sourcify/production/data/solc-bin/linux-amd64
SOLJSON_REPO_HOST=/home/sourcify/production/data/solc-bin/bin

# Other config
TESTING=false
TAG=stable
Expand Down
4 changes: 2 additions & 2 deletions environments/build-ui.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ services:
build:
context: ../ui
dockerfile: Dockerfile
# Pass SERVER_URL and REPOSITORY_URL to be injected build time.
# Pass SERVER_URL and REPOSITORY_SERVER_URL to be injected build time.
# Will be set in .env (see scripts/build_and_publish_docker_images.sh)
args:
- SERVER_URL=$SERVER_URL
- REPOSITORY_URL=$REPOSITORY_URL
- REPOSITORY_SERVER_URL=$REPOSITORY_SERVER_URL
- IPNS=$IPNS
- TAG=$TAG
2 changes: 1 addition & 1 deletion environments/repository.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ services:
target: /data
read_only: true
ports:
- ${REPOSITORY_EXTERNAL_PORT}:${REPOSITORY_PORT}
- ${REPOSITORY_SERVER_EXTERNAL_PORT}:80
2 changes: 1 addition & 1 deletion h5ai-nginx
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"test:server": "TESTING=true DOTENV_CONFIG_PATH=./environments/.env mocha -r dotenv/config test/server.js --exit",
"test:chains": "TESTING=true mocha test/chains/chain-tests.js --reporter mochawesome --reporter-options reportDir=chain-tests-report,reportFilename=report --exit",
"lint": "eslint . --ext .ts",
"lint-tests": "eslint ./test --ext .js",
"lint-fix": "eslint . --fix --ext .ts",
"coverage": "node ./node_modules/nyc/bin/nyc.js --reporter=lcov --reporter=text-summary ./node_modules/tape/bin/tape ./test/index.js",
"coveralls": "npm run coverage && node ./node_modules/coveralls/bin/coveralls.js <coverage/lcov.info",
Expand Down Expand Up @@ -95,4 +96,4 @@
"typescript": "^4.0.5",
"typestrict": "^1.0.2"
}
}
}
2 changes: 1 addition & 1 deletion scripts/monitor_ci.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const artifact = require("../metacoin-source-verify/build/contracts/MetaCoin.jso
const address = artifact.networks[chainID].address;

async function main() {
const url = `${process.env.REPOSITORY_URL}/contracts/full_match/${chainID}/${address}/metadata.json`;
const url = `${process.env.REPOSITORY_SERVER_URL}/contracts/full_match/${chainID}/${address}/metadata.json`;

log();
log(`>>>>>>>>>>>>>>>>>>>>`);
Expand Down
2 changes: 1 addition & 1 deletion services/core/src/services/FileService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export class FileService implements IFileService {
const urls: Array<string> = [];
files.forEach((file) => {
const relativePath = file.path.split("/repository")[1].substr(1);
urls.push(`${process.env.REPOSITORY_URL}/${relativePath}`);
urls.push(`${process.env.REPOSITORY_SERVER_URL}/${relativePath}`);
});
return urls;
}
Expand Down
14 changes: 12 additions & 2 deletions services/core/src/sourcify-chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,17 @@ function buildAlchemyURL(
if (useOwn) {
const port = process.env[`NODE_PORT_${chainSubName.toUpperCase()}`];
const url = `${process.env.NODE_ADDRESS}:${port}`;
if (!port || !url) return undefined;
return url;
}

let id;
switch (chainName) {
case "opt":
id = process.env["ALCHEMY_ID_OPTIMISM"];
id = process.env["ALCHEMY_ID_OPTIMISM"] || process.env["ALCHEMY_ID"];
break;
case "arb":
id = process.env["ALCHEMY_ID_ARBITRUM"];
id = process.env["ALCHEMY_ID_ARBITRUM"] || process.env["ALCHEMY_ID"];
break;
default:
id = process.env["ALCHEMY_ID"];
Expand Down Expand Up @@ -503,4 +504,13 @@ export default {
contractFetchAddress: "https://evm.explorer.canto.io/" + BLOCKSCOUT_SUFFIX,
txRegex: getBlockscoutRegex(),
},
"99": {
// POA Network Core
supported: true,
monitored: false,
contractFetchAddress:
"https://blockscout.com/poa/core/" + BLOCKSCOUT_SUFFIX,
txRegex: getBlockscoutRegex("/poa/core"),
rpc: ["https://core.poa.network"],
},
};
Loading

0 comments on commit 6d40731

Please sign in to comment.