Skip to content

Commit

Permalink
Merge pull request #1 from Eshanchik/master
Browse files Browse the repository at this point in the history
Update sourcify
  • Loading branch information
november-pain authored Nov 13, 2023
2 parents d1a80bb + 110bb2e commit 9b15768
Show file tree
Hide file tree
Showing 485 changed files with 186,278 additions and 102,615 deletions.
10 changes: 5 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ workflows:
services/ipfs/.* run-build-ipfs true
services/s3sync/.* run-build-s3 true
h5ai-nginx run-build-repository true
src/monitor/.* run-build-monitor true
src/server/.* run-build-server true
services/core/.* run-build-core true
services/verification/.* run-build-verification true
services/validation/.* run-build-validation true
src/.* run-build-server true
packages/.* run-build-server true
environments/.* run-build-server true
scripts/.* run-build-server true
package.json run-build-server true
ui/.* run-build-ui true
# Compare against the last build of the branch not the default "main" branch
base-revision: << pipeline.git.base_revision >>
Expand Down
100 changes: 32 additions & 68 deletions .circleci/continue_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,12 @@ parameters:
run-build-repository:
type: boolean
default: false
run-build-monitor:
type: boolean
default: false
run-build-ui:
type: boolean
default: false
run-build-server:
type: boolean
default: false
run-build-core:
type: boolean
default: false
run-build-verification:
type: boolean
default: false
run-build-validation:
type: boolean
default: false

################
### ALIASES ####
Expand All @@ -43,26 +31,9 @@ aliases:
run-build:
type: boolean
default: false
# Workaround: Since we can't set run-build parameter with a logic or: [run-build-server, run-build-core, run-build-verification, run-build-validation] under workflows.jobs, add three more parameters only for the server build, and OR them here. If any of one-two-three (core-verification-validation respectively) change, a server build is triggered. Other builds uneffected since default is false.
run-build-one:
type: boolean
default: false
run-build-two:
type: boolean
default: false
run-build-three:
type: boolean
default: false
steps:
- when:
condition:
or:
[
<< parameters.run-build >>,
<< parameters.run-build-one >>,
<< parameters.run-build-two >>,
<< parameters.run-build-three >>,
]
condition: << parameters.run-build >>
steps:
- checkout
- run:
Expand Down Expand Up @@ -124,29 +95,31 @@ workflows:
- or:
[
<< pipeline.parameters.run-build-ipfs >>,
<< pipeline.parameters.run-build-monitor >>,
<< pipeline.parameters.run-build-repository >>,
<< pipeline.parameters.run-build-s3 >>,
<< pipeline.parameters.run-build-server >>,
<< pipeline.parameters.run-build-core >>,
<< pipeline.parameters.run-build-verification >>,
<< pipeline.parameters.run-build-validation >>,
<< pipeline.parameters.run-build-ui >>,
]
jobs:
- tests-node-v16
- npm-publish:
filters:
branches:
only:
- master
requires:
- tests-node-v16
- build-push-ipfs:
run-build: << pipeline.parameters.run-build-ipfs >>
# Always build monitor if there's a change in the server
- build-push-monitor:
run-build: << pipeline.parameters.run-build-monitor >>
run-build: << pipeline.parameters.run-build-server >>
- build-push-repository:
run-build: << pipeline.parameters.run-build-repository >>
- build-push-s3:
run-build: << pipeline.parameters.run-build-s3 >>
- build-push-server:
run-build: << pipeline.parameters.run-build-server >>
run-build-one: << pipeline.parameters.run-build-core >>
run-build-two: << pipeline.parameters.run-build-verification >>
run-build-three: << pipeline.parameters.run-build-validation >>
- build-push-ui:
run-build: << pipeline.parameters.run-build-ui >>
- deploy:
Expand All @@ -157,35 +130,30 @@ workflows:
- build-push-s3
- build-push-server
- build-push-ui
- monitor-e2e-rinkeby:
requires:
- deploy
- monitor-e2e-goerli:
requires:
- deploy
- monitor-e2e-sepolia:
requires:
- deploy
- verification-e2e-rinkeby:
requires:
- deploy
- verification-e2e-goerli:
requires:
- deploy
- verification-e2e-sepolia:
requires:
- deploy
# Always run
node-build:

# Tests workflow for not staging or master
tests:
when:
and:
- not:
equal: [ master, << pipeline.git.branch >> ]
- not:
equal: [ staging, << pipeline.git.branch >> ]
jobs:
- node-v16
- npm-publish:
filters:
branches:
only:
- master
requires:
- node-v16
- tests-node-v16

# Has to run always. Can't regex filter on add-chain-{chainId} branch names see: https://stackoverflow.com/questions/55839004/circleci-regex-filtering-match-within-string
test-new-chain:
jobs:
Expand Down Expand Up @@ -235,7 +203,7 @@ jobs:
no_output_timeout: 30m
command: |
./scripts/deploy.sh
node-v16:
tests-node-v16:
docker:
- image: cimg/node:16.15
working_directory: ~/source-verify
Expand All @@ -250,13 +218,19 @@ jobs:
- checkout
- run:
name: install dependencies
command: npx lerna bootstrap
command: npm install && npx lerna bootstrap
- run:
name: install puppeteer dependencies
command: sudo apt-get update && sudo apt-get -y install xvfb gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgbm1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget
- run:
name: lint
command: npm run lint
- run:
name: tsc and test
command: npx lerna run build && npx lerna run test --stream
- run:
name: coverage
command: npm run cov:send
test-new-chain:
docker:
- image: cimg/node:16.15
Expand All @@ -265,18 +239,13 @@ jobs:
- checkout
- run:
name: install dependencies
command: npx lerna bootstrap
command: npm install && npx lerna bootstrap
- run:
name: build
command: npx lerna run build
- run:
name: test new chain PR
command: ./scripts/test_new_chain_support.sh
monitor-e2e-rinkeby:
<<: *monitor-e2e-base
environment:
CHAIN_ID: 4
CHAIN_NAME: rinkeby
monitor-e2e-goerli:
<<: *monitor-e2e-base
environment:
Expand All @@ -287,11 +256,6 @@ jobs:
environment:
CHAIN_ID: '11155111'
CHAIN_NAME: sepolia
verification-e2e-rinkeby:
<<: *verification-e2e-base
environment:
CHAIN_ID: 4
CHAIN_NAME: rinkeby
verification-e2e-goerli:
<<: *verification-e2e-base
environment:
Expand All @@ -310,7 +274,7 @@ jobs:
- checkout
- run:
name: install dependencies
command: npx lerna bootstrap
command: npm install && npx lerna bootstrap
- run:
name: build everything
command: npx lerna run build
Expand Down
13 changes: 10 additions & 3 deletions .circleci/new_branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,20 @@ jobs:
- checkout
- run:
name: install dependencies
command: npx lerna bootstrap
command: npm install && npx lerna bootstrap
- run:
name: install puppeteer dependencies
command: sudo apt-get update && sudo apt-get -y install xvfb gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgbm1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget

- run:
name: lint
command: npm run lint
- run:
name: tsc and test
command: npx lerna run build && npx lerna run test --stream
- run:
name: coverage
command: npx lerna run cov:send
test-new-chain:
docker:
- image: cimg/node:16.15
Expand All @@ -41,10 +48,10 @@ jobs:
- checkout
- run:
name: install dependencies
command: npx lerna bootstrap
command: npm install && npx lerna bootstrap
- run:
name: build
command: npx lerna run build
- run:
name: test new chain PR
command: ./scripts/test_new_chain_support.sh
command: ./scripts/test_new_chain_support.sh
32 changes: 20 additions & 12 deletions .circleci/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,18 @@ aliases:
workflows:
e2e-tests:
jobs:
- monitor-e2e-rinkeby
- monitor-e2e-goerli
- monitor-e2e-sepolia
- verification-e2e-rinkeby
- verification-e2e-goerli
- verification-e2e-sepolia
s3-backup-check:
jobs:
- check-s3-backup
etherscan-instances:
jobs:
- check-etherscan-instances

jobs:
monitor-e2e-rinkeby:
<<: *monitor-e2e-base
environment:
CHAIN_ID: 4
CHAIN_NAME: rinkeby
monitor-e2e-goerli:
<<: *monitor-e2e-base
environment:
Expand All @@ -62,11 +60,6 @@ jobs:
environment:
CHAIN_ID: '11155111'
CHAIN_NAME: sepolia
verification-e2e-rinkeby:
<<: *verification-e2e-base
environment:
CHAIN_ID: 4
CHAIN_NAME: rinkeby
verification-e2e-goerli:
<<: *verification-e2e-base
environment:
Expand All @@ -89,3 +82,18 @@ jobs:
command: node --experimental-fetch ./scripts/check-s3-backup.mjs
docker:
- image: cimg/node:16.15
check-etherscan-instances:
working_directory: ~/source-verify
steps:
- checkout
- run:
name: install dependencies
command: npm install && npx lerna bootstrap
- run:
name: build
command: npx lerna run build
- run:
name: test
command: npx mocha test/etherscan/etherscanInstances.js --exit
docker:
- image: cimg/node:16.15
2 changes: 1 addition & 1 deletion .circleci/test-chains-regularly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- checkout
- run:
name: install dependencies
command: npx lerna bootstrap
command: npm install && npx lerna bootstrap
- run:
name: build and test
command: npx lerna run build && npx lerna run test:chains
Expand Down
25 changes: 25 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Release <version>

## Changes

<!-- Add newly supported chains with their chainId, if any-->

- New supported chains:
- X Chain (43)
- Chainname (chainId)

<!-- Please describe the changes the new commits bring in few sentences -->

- Fix: ...
- <Feature>
...

## Checklist

<!-- Please check all items below by putting an x in the box -->

- [ ] I have bumped the versions of the packages under `packages/`, if necessary
- [ ] `lib-sourcify`
- [ ] `bytecode-utils`
- [ ] `contract-call-decoder`
- [ ] All tests are passing
20 changes: 20 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!-- If you are opening a chain support request PR please follow the template below. Otherwise you can write your own PR description -->

# Add New Chain <chainId>

Thanks for your pull request to add a new support in Sourcify.

If you haven't done so, please follow the instructions on [how to request chain support](https://docs.sourcify.dev/docs/chain-support/) in docs.

Please check the following items before submitting your pull request.

## Checklist

- [ ] The branch is named as `add-chain-<chainId>`.
- [ ] I haven't modified the [chains.json](../../src/chains.json) file directly.
- [ ] In [sourcify-chains.ts](../../src/sourcify-chains.ts) file
- [ ] I've set `supported: true`.
- [ ] I've set `monitored: false`.
- [ ] I haven't added an `rpc` field but the one in [chains.json](../../src/chains.json) is used (if not, please explain why).
- [ ] I've added a test in [chain-tests.js](../../test/chains/chains-test.js) file.
- [ ] `test-new-chain` test in Circle CI is passing.
3 changes: 2 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Publish a docker image

on:
workflow_dispatch:
push:
branches:
- master
Expand Down Expand Up @@ -28,7 +29,7 @@ jobs:
- uses: docker/metadata-action@v3
id: meta_sourcify
with:
images: ghcr.io/ambrosus/sourcify
images: ghcr.io/Eshanchik/sourcify

- uses: docker/build-push-action@v2
with:
Expand Down
Loading

0 comments on commit 9b15768

Please sign in to comment.