Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 26 additions & 2 deletions localnode/NODE_RUNNING.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ Run the following to start each of the required daemons as Docker containers:

```sh
cd localnode
docker compose -f docker-compose.yml up --build
docker compose -f docker-compose.yml --profile full up --build
```

## Accessing the nodes
Expand All @@ -145,9 +145,33 @@ Hemi network will be necessary. This is coming soon.

Run the file:
```sh
docker compose -f docker-compose_mainnet.yml up --build
docker compose -f docker-compose_mainnet.yml --profile full up --build
```

## Bring your own L1s

Several of the containers (the Bitcoin and Ethereum L1 containers) here can be replaced with nodes or API endpoints of your own.

To run just the L1 containers, start with this command:
```sh
docker compose -f localnode/docker-compose_mainnet.yml --profile L1 up --build
```

To run only the Hemi containers, add your endpoints to `.env`:
```sh
OPSYNCMODE=concensus-layer
BITCOINENDPOINT=
BITCOINCREDS=
GETHL1ENDPOINT=
PRYSMENDPOINT=
```
and run:
```sh
docker compose -f localnode/docker-compose_mainnet.yml --profile hemi up --build
```

and similarly for testnet.

## Monitoring

A simple bash script setup to monitor all the running daemons is
Expand Down
30 changes: 16 additions & 14 deletions localnode/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ services:
build:
dockerfile: "./docker/bfgd/Dockerfile"
context: "./.."
profiles: ["hemi", "full"]
depends_on:
bfgd-postgres:
condition: "service_started"
Expand Down Expand Up @@ -41,6 +42,7 @@ services:
build:
dockerfile: "./localnode/postgres.Dockerfile"
context: "./.."
profiles: ["hemi", "full"]
volumes:
- psql_data:/var
environment:
Expand Down Expand Up @@ -80,6 +82,7 @@ services:
build:
dockerfile: "./docker/bssd/Dockerfile"
context: "./.."
profiles: ["hemi", "full"]
depends_on:
- "bfgd"
environment:
Expand All @@ -96,8 +99,7 @@ services:
build:
context: ./..
dockerfile: ./localnode/electrs.Dockerfile
depends_on:
- "bitcoind"
profiles: ["hemi", "full"]
volumes:
- ./cookie:/tmp/.cookie
- electrs_data:/data/electrs
Expand All @@ -111,13 +113,13 @@ services:
- "--electrum-rpc-addr"
- "0.0.0.0:50001"
- "--daemon-rpc-addr"
- "bitcoind:18332"
- "${BITCOINENDPOINT:-bitcoind:18332}"
- "--network"
- "testnet"
# NOTE: If you expose electrs ports,
# you may want to ensure that this is changed!
- "--cookie"
- "user:password"
- "${BITCOINCREDS:-user:password}"
- "-vvv"
- "--timestamp"
- "--utxos-limit"
Expand All @@ -134,6 +136,7 @@ services:
geth-l1:
# yamllint disable-line rule:line-length
image: "ethereum/client-go@sha256:343cff592e1a9daf99a89261d3263941ff9c3350b62b3ebc0f7c30d35721d905"
profiles: ["L1", "full"]
volumes:
- geth_data:/tmp/geth
# change this token value if you expose this service's ports for
Expand Down Expand Up @@ -165,9 +168,8 @@ services:
image: "ghcr.io/hemilabs/op-geth:e525f27@sha256:f48c03532810ec4d9d08be8afa19822c9adcdd2d8dd559467a0d2b34965d5a6d"
platform: linux/amd64
# XXX does geth need to be fully synced
profiles: ["hemi", "full"]
depends_on:
geth-l1:
condition: "service_started"
op-geth-l2-init:
condition: "service_completed_successfully"
op-geth-l2-init-tbc:
Expand All @@ -188,7 +190,7 @@ services:
- ./l2-config.toml:/tmp/l2-config.toml
- tbc_data:/tbcdata
environment:
OP_GETH_L1_RPC: "http://geth-l1:8545"
OP_GETH_L1_RPC: "${GETHL1ENDPOINT:-http://geth-l1:8545}"
OP_GETH_L2_READINESS_RPC: "http://localhost:18546"
ports:
- '18546:18546'
Expand All @@ -209,6 +211,7 @@ services:
op-geth-l2-init:
# yamllint disable-line rule:line-length
image: "alpine@sha256:beefdbd8a1da6d2915566fde36db9db0b524eb737fc57cd1367effd16dc0d06d"
profiles: ["hemi", "full"]
volumes:
- op-geth_data:/tmp/datadir
command:
Expand All @@ -221,6 +224,7 @@ services:
op-geth-l2-init-tbc:
# yamllint disable-line rule:line-length
image: "alpine@sha256:beefdbd8a1da6d2915566fde36db9db0b524eb737fc57cd1367effd16dc0d06d"
profiles: ["hemi", "full"]
volumes:
- tbc_data:/tbcdata
command:
Expand All @@ -234,13 +238,10 @@ services:
# yamllint disable-line rule:line-length
image: "ghcr.io/hemilabs/op-node:ee580dd@sha256:c3c2bcabb0da02e6aca462a2756ef78d8a40e569281de1f4dac9a9eb8fa80359"
platform: linux/amd64
profiles: ["hemi", "full"]
depends_on:
geth-l1:
condition: "service_started"
op-geth-l2:
condition: "service_healthy"
prysm:
condition: "service_started"
volumes:
# change this token value if you expose this service's ports for
# connection from other machines
Expand All @@ -255,9 +256,9 @@ services:
- "localnode"
command:
- "op-node"
- "--l1=http://geth-l1:8545"
- "--l1=${BITCOINENDPOINT:-http://geth-l1:8545}"
- "--l1.rpckind=any"
- "--l1.beacon=http://prysm:3500"
- "--l1.beacon=${PRYSMENDPOINT:-http://prysm:3500}"
- "--l2=ws://op-geth-l2:8551"
- "--l2.jwt-secret=/tmp/jwt/jwt.hex"
- "--sequencer.enabled=false"
Expand All @@ -282,6 +283,7 @@ services:
prysm:
# yamllint disable-line rule:line-length
image: "gcr.io/prysmaticlabs/prysm/beacon-chain@sha256:ea7d64346cd51cb0a6979779bdfd284a13aedb5642a795637935daacdfe1675d"
profiles: ["L1", "full"]
volumes:
- prysm_data:/data
# change this token value if you expose this service's ports for
Expand All @@ -292,7 +294,7 @@ services:
networks:
- "localnode"
command:
- "--execution-endpoint=http://geth-l1:8551"
- "--execution-endpoint=${GETHL1ENDPOINT:-http://geth-l1:8551}"
- "--sepolia"
- "--jwt-secret=/tmp/jwt/jwt.hex"
- "--checkpoint-sync-url=https://sepolia.beaconstate.info"
Expand Down
33 changes: 18 additions & 15 deletions localnode/docker-compose_mainnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ services:
build:
dockerfile: "./docker/bfgd/Dockerfile"
context: "./.."
profiles: ["hemi", "full"]
depends_on:
bfgd-postgres:
condition: "service_started"
Expand Down Expand Up @@ -41,6 +42,7 @@ services:
build:
dockerfile: "./localnode/postgres.Dockerfile"
context: "./.."
profiles: ["hemi", "full"]
volumes:
- psql_data:/var/lib/postgresql/data
environment:
Expand All @@ -59,6 +61,7 @@ services:
bitcoind:
# yamllint disable-line rule:line-length
image: "kylemanna/bitcoind@sha256:5d97bbe3c74856818f0b3a1e718eb3968981ab03ce08aaf1c7d528f99aaf30b7"
profiles: ["L1", "full"]
volumes:
- bitcoin_data:/bitcoin/.bitcoin
ports:
Expand All @@ -79,6 +82,7 @@ services:
build:
dockerfile: "./docker/bssd/Dockerfile"
context: "./.."
profiles: ["hemi", "full"]
depends_on:
- "bfgd"
environment:
Expand All @@ -95,8 +99,7 @@ services:
build:
context: ./..
dockerfile: ./localnode/electrs.Dockerfile
depends_on:
- "bitcoind"
profiles: ["hemi", "full"]
volumes:
- ./cookie:/tmp/.cookie
- electrs_data:/data/electrs
Expand All @@ -110,11 +113,11 @@ services:
- "--electrum-rpc-addr"
- "0.0.0.0:50001"
- "--daemon-rpc-addr"
- "bitcoind:8332"
- "${BITCOINENDPOINT:-bitcoind:8332}"
- "--cookie"
# NOTE: If you expose electrs ports,
# you may want to ensure that this is changed!
- "--cookie"
- "user:password"
- "${BITCOINCREDS:-user:password}"
- "-vvv"
- "--timestamp"
- "--utxos-limit"
Expand All @@ -131,6 +134,7 @@ services:
geth-l1:
# yamllint disable-line rule:line-length
image: "ethereum/client-go@sha256:343cff592e1a9daf99a89261d3263941ff9c3350b62b3ebc0f7c30d35721d905"
profiles: ["L1", "full"]
volumes:
- geth_data:/tmp/geth
# change this token value if you expose this service's ports for
Expand Down Expand Up @@ -162,9 +166,8 @@ services:
image: "ghcr.io/hemilabs/op-geth:e525f27@sha256:f48c03532810ec4d9d08be8afa19822c9adcdd2d8dd559467a0d2b34965d5a6d"
platform: linux/amd64
# XXX does geth need to be fully synced
profiles: ["hemi", "full"]
depends_on:
geth-l1:
condition: "service_started"
op-geth-l2-init:
condition: "service_completed_successfully"
op-geth-l2-init-tbc:
Expand All @@ -186,7 +189,7 @@ services:
- ./mainnet-l2-config.toml:/tmp/l2-config.toml
- tbc_data:/tbcdata
environment:
OP_GETH_L1_RPC: "http://geth-l1:8545"
OP_GETH_L1_RPC: "${GETHL1ENDPOINT:-http://geth-l1:8545}"
OP_GETH_L2_READINESS_RPC: "http://localhost:18546"
ports:
- '18546:18546'
Expand All @@ -207,6 +210,7 @@ services:
op-geth-l2-init:
# yamllint disable-line rule:line-length
image: "alpine@sha256:beefdbd8a1da6d2915566fde36db9db0b524eb737fc57cd1367effd16dc0d06d"
profiles: ["hemi", "full"]
volumes:
- op-geth_data:/tmp/datadir
command:
Expand All @@ -219,6 +223,7 @@ services:
op-geth-l2-init-tbc:
# yamllint disable-line rule:line-length
image: "alpine@sha256:beefdbd8a1da6d2915566fde36db9db0b524eb737fc57cd1367effd16dc0d06d"
profiles: ["hemi", "full"]
volumes:
- tbc_data:/tbcdata
command:
Expand All @@ -232,13 +237,10 @@ services:
# yamllint disable-line rule:line-length
image: "ghcr.io/hemilabs/op-node:84b895e@sha256:df29c59680c33cdda616f67662c9e75bdeea60f79d91937ee0b60bf0d0f48243"
platform: linux/amd64
profiles: ["hemi", "full"]
depends_on:
geth-l1:
condition: "service_started"
op-geth-l2:
condition: "service_healthy"
prysm:
condition: "service_started"
volumes:
# change this token value if you expose this service's ports for
# connection from other machines
Expand All @@ -253,9 +255,9 @@ services:
- "localnode"
command:
- "op-node"
- "--l1=http://geth-l1:8545"
- "--l1=${BITCOINENDPOINT:-http://geth-l1:8545}"
- "--l1.rpckind=any"
- "--l1.beacon=http://prysm:3500"
- "--l1.beacon=${PRYSMENDPOINT:-http://prysm:3500}"
- "--l2=ws://op-geth-l2:8551"
- "--l2.jwt-secret=/tmp/jwt/jwt.hex"
- "--sequencer.enabled=false"
Expand All @@ -276,6 +278,7 @@ services:
prysm:
# yamllint disable-line rule:line-length
image: "gcr.io/prysmaticlabs/prysm/beacon-chain@sha256:ea7d64346cd51cb0a6979779bdfd284a13aedb5642a795637935daacdfe1675d"
profiles: ["L1", "full"]
volumes:
- prysm_data:/data
# change this token value if you expose this service's ports for
Expand All @@ -286,7 +289,7 @@ services:
networks:
- "localnode"
command:
- "--execution-endpoint=http://geth-l1:8551"
- "--execution-endpoint=${GETHL1ENDPOINT:-http://geth-l1:8551}"
- "--jwt-secret=/tmp/jwt/jwt.hex"
- "--checkpoint-sync-url=https://beaconstate.info"
- "--genesis-beacon-api-url=https://beaconstate.info"
Expand Down