Skip to content

Commit

Permalink
Merge pull request #126 from Chomtana/main
Browse files Browse the repository at this point in the history
Add beacon endpoint, fix fastnode.io snapshot, bump version to v1.5.1
  • Loading branch information
Chomtana authored Feb 14, 2024
2 parents f20e8b6 + 4ec3567 commit d51bb3e
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ BEDROCK_SOURCE=download
# L1 node that the op-node (Bedrock) will get chain data from
OP_NODE__RPC_ENDPOINT=

# L1 beacon endpoint, you can setup your own or use Quicknode
OP_NODE__L1_BEACON=

# Type of RPC that op-node is connected to, see README
OP_NODE__RPC_TYPE=basic

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ Open `.env` with your editor of choice
* `full` (Full node) - A Full node contains a few recent blocks without historical states.
* `archive` (Archive node) - An Archive node stores the complete history of the blockchain, including historical states.
* **OP_NODE__RPC_ENDPOINT** - Specify the endpoint for the RPC of Layer 1 (e.g., Ethereum mainnet). For instance, you can use the free plan of Alchemy for the Ethereum mainnet.
* **OP_NODE__L1_BEACON** - Specify the beacon endpoint of Layer 1. You can use [QuickNode for the beacon endpoint](https://www.quicknode.com/docs/ethereum/eth-v1-beacon-genesis).
* **OP_NODE__RPC_TYPE** - Specify the service provider for the RPC endpoint you've chosen in the previous step. The available options are:
* `alchemy` - Alchemy
* `quicknode` - Quicknode (ETH only)
Expand Down
8 changes: 6 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ services:
- ${PORT__HEALTHCHECK_METRICS:-7300}:7300

op-geth:
image: us-docker.pkg.dev/oplabs-tools-artifacts/images/op-geth:v1.101305.3
image: us-docker.pkg.dev/oplabs-tools-artifacts/images/op-geth:v1.101308.0
restart: unless-stopped
stop_grace_period: 5m
entrypoint: /scripts/start-op-geth.sh
Expand All @@ -43,9 +43,11 @@ services:
ports:
- ${PORT__OP_GETH_HTTP:-9993}:8545
- ${PORT__OP_GETH_WS:-9994}:8546
extra_hosts:
- "host.docker.internal:host-gateway"

op-node:
image: us-docker.pkg.dev/oplabs-tools-artifacts/images/op-node:v1.5.0
image: us-docker.pkg.dev/oplabs-tools-artifacts/images/op-node:v1.5.1
restart: unless-stopped
stop_grace_period: 5m
entrypoint: /scripts/start-op-node.sh
Expand All @@ -59,6 +61,8 @@ services:
ports:
- ${PORT__OP_NODE_P2P:-9003}:9003/udp
- ${PORT__OP_NODE_P2P:-9003}:9003/tcp
extra_hosts:
- "host.docker.internal:host-gateway"

bedrock-init:
build:
Expand Down
21 changes: 21 additions & 0 deletions prysm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: "3.7"

services:
beacon:
container_name: beacon-chain
image: gcr.io/prysmaticlabs/prysm/beacon-chain:${PRYSM_DOCKER_TAG:-stable}
restart: always
hostname: beacon-chain
command: --config-file=/config/beacon.yaml
ports:
- 127.0.0.1:4000:4000
- 13000:13000/tcp
- 12000:12000/udp
volumes:
- ./scripts/beacon.yaml:/config/beacon.yaml:ro
- beacon_data:/data
extra_hosts:
- "host.docker.internal:host-gateway"

volumes:
beacon_data:
33 changes: 33 additions & 0 deletions scripts/beacon.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
############################################################
##
## Read up on parameters on
## https://docs.prylabs.network/docs/prysm-usage/parameters/
##
############################################################

accept-terms-of-use: true

datadir: /data

#######################
# Connectivity settings
p2p-host-ip: ""
p2p-host-dns: ""

rpc-host: 0.0.0.0
monitoring-host: 0.0.0.0

# disable scan of local network
p2p-denylist: ["10.0.0.0/8","172.16.0.0/12","192.168.0.0/16","100.64.0.0/10","169.254.0.0/16"]

# changing this also needs to be changed in docker-compose.yaml!
p2p-tcp-port: 13000

# enable db backup endpoint
enable-db-backup-webhook: true

##############################
# Connection to geth container
http-web3provider: http://host.docker.internal:8545

blst: true
2 changes: 1 addition & 1 deletion scripts/init-bedrock.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ echo "Initializing via download..."
# Fix OP link with hardcoded official OP snapshot
echo "Fetching download link..."
if [ "$NETWORK_NAME" = "op-mainnet" ]; then
BEDROCK_TAR_DOWNLOAD="https://r2-snapshots.fastnode.io/op/$(curl -s https://r2-snapshots.fastnode.io/op/latest-mainnet).tar.lz4"
BEDROCK_TAR_DOWNLOAD="https://r2-snapshots.fastnode.io/op/$(curl -s https://r2-snapshots.fastnode.io/op/latest-mainnet)"
elif [ "$NETWORK_NAME" = "op-goerli" ]; then
BEDROCK_TAR_DOWNLOAD="https://datadirs.optimism.io/goerli-bedrock.tar.zst"
fi
Expand Down
1 change: 1 addition & 0 deletions scripts/start-op-node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ exec op-node \
--l2.jwt-secret=/shared/jwt.txt \
--l1.trustrpc \
--l1.rpckind=$OP_NODE__RPC_TYPE \
--l1.beacon=$OP_NODE__L1_BEACON \
--metrics.enabled \
--metrics.addr=0.0.0.0 \
--metrics.port=7300 \
Expand Down

0 comments on commit d51bb3e

Please sign in to comment.