-
Notifications
You must be signed in to change notification settings - Fork 151
[M1] Add Otterscan & Sourcify integration to playground #4000
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
[M1] Add Otterscan & Sourcify integration to playground #4000
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
|
I have read the CLA Document and I hereby sign the CLA |
MartinquaXD
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for you contribution! 🚀
Other than the small modification I had to apply, this worked like a charm on my first simple test. Will play a bit more with it over the holidays and do a full review.
| case "${SOURCIFY_MODE:-cloud}" in | ||
| local) | ||
| echo "Using LOCAL Sourcify as primary source" | ||
| cat > "$CONFIG_FILE" << 'EOF' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to remove the ' to enable variable expansion. With 'EOF' this command literally wrote ${ERIGON_URL} into the file instead of http://127.0.0.1:8545.
| cat > "$CONFIG_FILE" << 'EOF' | |
| cat > "$CONFIG_FILE" << EOF |
| ;; | ||
| cloud|*) | ||
| echo "Using CLOUD Sourcify as primary source" | ||
| cat > "$CONFIG_FILE" << 'EOF' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
| cat > "$CONFIG_FILE" << 'EOF' | |
| cat > "$CONFIG_FILE" << EOF |
|
This pull request has been marked as stale because it has been inactive a while. Please update this pull request or it will be automatically closed. |
jmg-duarte
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ran docker compose -f docker-compose.non-interactive.yml up -d and it failed "upping" the sourcify service with a series of errors related to (seemingly) the database migrations
sourcify-1 | === Sourcify Server Starting ===
sourcify-1 | Waiting for database...
sourcify-1 | Database is ready!
sourcify-1 | Running database migrations...
sourcify-1 | runtime: lfstack.push invalid packing: node=0xffffb431d800 cnt=0x1 packed=0xffffb431d8000001 -> node=0xffffffffb431d800
sourcify-1 | fatal error: lfstack.push
I'm running Podman Compose on an M4 Pro, MacOS Sequoia 15.6
| @@ -0,0 +1,31 @@ | |||
| FROM node:22-bookworm-slim | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New LTS is 24, is it a requirement to use 22?
| apt-get clean && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| # Clone Sourcify with submodules | ||
| RUN git clone --depth 1 --recurse-submodules https://github.com/ethereum/sourcify.git /sourcify |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like the new repo is at https://github.com/argotorg/sourcify and the default branch is staging, should we use another branch?
|
|
||
| # Sourcify - Contract verification service | ||
| sourcify-db: | ||
| image: postgres:15-alpine |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're using postgres-16, I wonder if we can use the same image here to avoid downloading two postgres images
Summary
This PR delivers Milestone 1: Otterscan Integration of the CoW Grants Program RFP: CoW Protocol Playground Block Explorer Integration proposal by CoBuilders.
Integrates Otterscan block explorer with Sourcify contract verification into the CoW Protocol Playground, enabling developers to browse transactions and view verified contract source code locally.
Milestone 1 Deliverables
Otterscan Integration
Contract Verification Setup
SOURCIFY_MODEenv var)Success Criteria
http://localhost:8003http://localhost:5555Commits
872d4dbd6e322b3c11ff26e8acb68519ffa98fa7ecff75c1ff7e8ff50660cb8f92810aChanges
New Files
Dockerfile.sourcifyDockerfile.otterscansourcify-entrypoint.shotterscan-entrypoint.shSOURCIFY_MODEsourcify-chains.jsonModified Files
docker-compose.fork.ymldocker-compose.non-interactive.yml.env.exampleSOURCIFY_MODEconfiguration variableREADME.mdDockerfileArchitecture
Configuration Options
Sourcify Mode
The
SOURCIFY_MODEenvironment variable controls which Sourcify source Otterscan uses:cloud(default)localAfter changing, recreate the Otterscan container:
Contract Verification
Using Foundry:
Using Sourcify API:
Testing
Start the playground:
Verify services are healthy:
Test cloud mode (default): View any well-known contract in Otterscan - source code should be visible
Test local mode:
SOURCIFY_MODE=localin.envNext Milestones
Submitted by CoBuilders as part of the CoW Grants Program