Skip to content

Commit 39f3073

Browse files
committed
First version of op-node
1 parent 219c616 commit 39f3073

File tree

12 files changed

+838
-0
lines changed

12 files changed

+838
-0
lines changed

.github/workflows/auto_check.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Bump upstream version
2+
3+
on:
4+
schedule:
5+
- cron: "00 */4 * * *"
6+
push:
7+
branches:
8+
- "master"
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v3
15+
- run: npx @dappnode/dappnodesdk github-action bump-upstream
16+
env:
17+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18+
PINATA_API_KEY: ${{ secrets.PINATA_API_KEY }}
19+
PINATA_SECRET_API_KEY: ${{ secrets.PINATA_SECRET_API_KEY }}

.github/workflows/main.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: "Main"
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- "main"
7+
- "master"
8+
- "v[0-9]+.[0-9]+.[0-9]+"
9+
paths-ignore:
10+
- "README.md"
11+
12+
jobs:
13+
build-test:
14+
runs-on: ubuntu-latest
15+
name: Build test
16+
if: github.event_name != 'push'
17+
steps:
18+
- uses: actions/checkout@v3
19+
- run: npx @dappnode/dappnodesdk build --skip_save
20+
21+
release:
22+
name: Release
23+
runs-on: ubuntu-latest
24+
if: github.event_name == 'push'
25+
steps:
26+
- uses: actions/checkout@v3
27+
- name: Publish
28+
run: npx @dappnode/dappnodesdk publish patch --dappnode_team_preset
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
DEVELOPER_ADDRESS: "0xf35960302a07022aba880dffaec2fdd64d5bf1c1"

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
build_*
2+
releases.json

LICENSE

Lines changed: 674 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# DAppNodePackage-op-node
2+
23
The Optimism rollup node is the component responsible for deriving the L2 chain from L1 blocks (and their associated receipts)

avatar-optimism.png

22.3 KB
Loading

dappnode_package.json

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"name": "op-node.dnp.dappnode.eth",
3+
"version": "0.1.0",
4+
"upstreamVersion": "v1.1.3",
5+
"upstreamRepo": "ethereum-optimism/op-node",
6+
"upstreamArg": "UPSTREAM_VERSION",
7+
"shortDescription": "Optimism Rollup node",
8+
"description": "The Optimism rollup node is the component responsible for deriving the L2 chain from L1 blocks (and their associated receipts)",
9+
"author": "DAppNode Association <[email protected]> (https://github.com/dappnode)",
10+
"categories": ["ETH2.0"],
11+
"keywords": ["optimism", "rollup", "ethereum", "node"],
12+
"type": "service",
13+
"architectures": ["linux/amd64", "linux/arm64"],
14+
"links": {
15+
"homepage": "https://github.com/dappnode/DAppNodePackage-op-node#readme",
16+
"api": "http://op-node.dappnode:9545"
17+
},
18+
"exposable": [
19+
{
20+
"name": "OP Node JSON-RPC (HTTP)",
21+
"description": "HTTP-JSON-RPC endpoint for OP",
22+
"serviceName": "op-node",
23+
"port": 9545
24+
}
25+
],
26+
"repository": {
27+
"type": "git",
28+
"url": "https://github.com/dappnode/DAppNodePackage-op-node.git"
29+
},
30+
"bugs": {
31+
"url": "https://github.com/dappnode/DAppNodePackage-op-node/issues"
32+
},
33+
"license": "GPL-3.0",
34+
"requirements": {
35+
"minimumDappnodeVersion": "0.2.50"
36+
},
37+
"globalEnvs": [
38+
{
39+
"envs": ["EXECUTION_CLIENT_MAINNET"],
40+
"services": ["op-node"]
41+
}
42+
]
43+
}

docker-compose.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: "3.5"
2+
services:
3+
op-node:
4+
build:
5+
context: op-node
6+
args:
7+
UPSTREAM_VERSION: v1.1.3
8+
environment:
9+
L2_CLIENT: op-geth.dnp.dappnode.eth
10+
USER_JWT: ""
11+
restart: unless-stopped
12+
image: "geth.op-node.dnp.dappnode.eth:0.1.0"

op-node/Dockerfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
ARG UPSTREAM_VERSION
2+
3+
FROM us-docker.pkg.dev/oplabs-tools-artifacts/images/op-node:${UPSTREAM_VERSION}
4+
5+
COPY /security /config/security
6+
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
7+
8+
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]

op-node/entrypoint.sh

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/bin/sh
2+
3+
case $_DAPPNODE_GLOBAL_EXECUTION_CLIENT_MAINNET in
4+
"geth.dnp.dappnode.eth")
5+
L1_RPC="http://geth.dappnode:8545"
6+
;;
7+
"nethermind.public.dappnode.eth")
8+
L1_RPC="http://nethermind.public.dappnode:8545"
9+
;;
10+
"erigon.dnp.dappnode.eth")
11+
L1_RPC="http://erigon.dappnode:8545"
12+
;;
13+
"besu.public.dappnode.eth")
14+
L1_RPC="http://besu.public.dappnode:8545"
15+
;;
16+
*)
17+
echo "Unknown value for _DAPPNODE_GLOBAL_EXECUTION_CLIENT_MAINNET: $_DAPPNODE_GLOBAL_EXECUTION_CLIENT_MAINNET"
18+
L1_RPC=$_DAPPNODE_GLOBAL_EXECUTION_CLIENT_MAINNET
19+
;;
20+
esac
21+
22+
case $L2_CLIENT in
23+
"op-geth.dnp.dappnode.eth")
24+
L2_RPC="http://op-geth.dnp.dappnode:8545"
25+
JWT_PATH="/config/security/op-geth/jwtsecret.hex"
26+
;;
27+
"op-erigon.dnp.dappnode.eth")
28+
L2_RPC="http://op-erigon.dnp.dappnode:8545"
29+
JWT_PATH="/config/security/op-erigon/jwtsecret.hex"
30+
;;
31+
*)
32+
echo "Unknown value for L2_CLIENT: $L2_CLIENT"
33+
L2_RPC=$L2_CLIENT
34+
mkdir -p /config/security/user
35+
echo $USER_JWT >/config/security/user/jwtsecret.hex
36+
JWT_PATH="/config/security/user/jwtsecret.hex"
37+
;;
38+
esac
39+
40+
op-node --l1=$L1_RPC \
41+
--l2=$L2_RPC \
42+
--network=beta-1 \
43+
--rpc.addr=0.0.0.0 \
44+
--rpc.port=9545 \
45+
--l2.jwt-secret=$JWT_PATH \
46+
${EXTRA_FLAGS}

0 commit comments

Comments
 (0)