Skip to content

Commit

Permalink
First version of op-node
Browse files Browse the repository at this point in the history
  • Loading branch information
dsimog01 committed Aug 23, 2023
1 parent 219c616 commit 39f3073
Show file tree
Hide file tree
Showing 12 changed files with 838 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/auto_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Bump upstream version

on:
schedule:
- cron: "00 */4 * * *"
push:
branches:
- "master"

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: npx @dappnode/dappnodesdk github-action bump-upstream
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PINATA_API_KEY: ${{ secrets.PINATA_API_KEY }}
PINATA_SECRET_API_KEY: ${{ secrets.PINATA_SECRET_API_KEY }}
31 changes: 31 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: "Main"
on:
pull_request:
push:
branches:
- "main"
- "master"
- "v[0-9]+.[0-9]+.[0-9]+"
paths-ignore:
- "README.md"

jobs:
build-test:
runs-on: ubuntu-latest
name: Build test
if: github.event_name != 'push'
steps:
- uses: actions/checkout@v3
- run: npx @dappnode/dappnodesdk build --skip_save

release:
name: Release
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v3
- name: Publish
run: npx @dappnode/dappnodesdk publish patch --dappnode_team_preset
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DEVELOPER_ADDRESS: "0xf35960302a07022aba880dffaec2fdd64d5bf1c1"
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
build_*
releases.json
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# DAppNodePackage-op-node

The Optimism rollup node is the component responsible for deriving the L2 chain from L1 blocks (and their associated receipts)
Binary file added avatar-optimism.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
43 changes: 43 additions & 0 deletions dappnode_package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"name": "op-node.dnp.dappnode.eth",
"version": "0.1.0",
"upstreamVersion": "v1.1.3",
"upstreamRepo": "ethereum-optimism/op-node",
"upstreamArg": "UPSTREAM_VERSION",
"shortDescription": "Optimism Rollup node",
"description": "The Optimism rollup node is the component responsible for deriving the L2 chain from L1 blocks (and their associated receipts)",
"author": "DAppNode Association <[email protected]> (https://github.com/dappnode)",
"categories": ["ETH2.0"],
"keywords": ["optimism", "rollup", "ethereum", "node"],
"type": "service",
"architectures": ["linux/amd64", "linux/arm64"],
"links": {
"homepage": "https://github.com/dappnode/DAppNodePackage-op-node#readme",
"api": "http://op-node.dappnode:9545"
},
"exposable": [
{
"name": "OP Node JSON-RPC (HTTP)",
"description": "HTTP-JSON-RPC endpoint for OP",
"serviceName": "op-node",
"port": 9545
}
],
"repository": {
"type": "git",
"url": "https://github.com/dappnode/DAppNodePackage-op-node.git"
},
"bugs": {
"url": "https://github.com/dappnode/DAppNodePackage-op-node/issues"
},
"license": "GPL-3.0",
"requirements": {
"minimumDappnodeVersion": "0.2.50"
},
"globalEnvs": [
{
"envs": ["EXECUTION_CLIENT_MAINNET"],
"services": ["op-node"]
}
]
}
12 changes: 12 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: "3.5"
services:
op-node:
build:
context: op-node
args:
UPSTREAM_VERSION: v1.1.3
environment:
L2_CLIENT: op-geth.dnp.dappnode.eth
USER_JWT: ""
restart: unless-stopped
image: "geth.op-node.dnp.dappnode.eth:0.1.0"
8 changes: 8 additions & 0 deletions op-node/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
ARG UPSTREAM_VERSION

FROM us-docker.pkg.dev/oplabs-tools-artifacts/images/op-node:${UPSTREAM_VERSION}

COPY /security /config/security
COPY entrypoint.sh /usr/local/bin/entrypoint.sh

ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
46 changes: 46 additions & 0 deletions op-node/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/sh

case $_DAPPNODE_GLOBAL_EXECUTION_CLIENT_MAINNET in
"geth.dnp.dappnode.eth")
L1_RPC="http://geth.dappnode:8545"
;;
"nethermind.public.dappnode.eth")
L1_RPC="http://nethermind.public.dappnode:8545"
;;
"erigon.dnp.dappnode.eth")
L1_RPC="http://erigon.dappnode:8545"
;;
"besu.public.dappnode.eth")
L1_RPC="http://besu.public.dappnode:8545"
;;
*)
echo "Unknown value for _DAPPNODE_GLOBAL_EXECUTION_CLIENT_MAINNET: $_DAPPNODE_GLOBAL_EXECUTION_CLIENT_MAINNET"
L1_RPC=$_DAPPNODE_GLOBAL_EXECUTION_CLIENT_MAINNET
;;
esac

case $L2_CLIENT in
"op-geth.dnp.dappnode.eth")
L2_RPC="http://op-geth.dnp.dappnode:8545"
JWT_PATH="/config/security/op-geth/jwtsecret.hex"
;;
"op-erigon.dnp.dappnode.eth")
L2_RPC="http://op-erigon.dnp.dappnode:8545"
JWT_PATH="/config/security/op-erigon/jwtsecret.hex"
;;
*)
echo "Unknown value for L2_CLIENT: $L2_CLIENT"
L2_RPC=$L2_CLIENT
mkdir -p /config/security/user
echo $USER_JWT >/config/security/user/jwtsecret.hex
JWT_PATH="/config/security/user/jwtsecret.hex"
;;
esac

op-node --l1=$L1_RPC \
--l2=$L2_RPC \
--network=beta-1 \
--rpc.addr=0.0.0.0 \
--rpc.port=9545 \
--l2.jwt-secret=$JWT_PATH \
${EXTRA_FLAGS}
1 change: 1 addition & 0 deletions op-node/security/op-erigon/jwtsecret.hex
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7ad9cfdec75eceb662f5e48f5765701c17f51a5233a60fbcfa5f9e495fa99d12
1 change: 1 addition & 0 deletions op-node/security/op-geth/jwtsecret.hex
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7ad9cfdec75eceb662f5e48f5765701c17f51a5233a60fbcfa5f9e495fa99d13

0 comments on commit 39f3073

Please sign in to comment.