Skip to content

Commit

Permalink
Use docker volume and enviroment.
Browse files Browse the repository at this point in the history
  • Loading branch information
takesaki committed Sep 2, 2023
1 parent a6e3a44 commit faeb9a2
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 16 deletions.
File renamed without changes.
9 changes: 6 additions & 3 deletions node/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,19 @@

1. 以下のコマンドで起動します
```sh
$ docker compose up -d
$ docker compose --env-file mainnet.env up -d
```
1. 起動した後はエラーログがないか確認しておきましょう
```sh
$ docker compose logs -f
```

### mainnetで動かす場合は
- compose.ymlの編集(--goerliを--mainnetに)
### testnet(goerli)で動かす場合は
- `conf.d/eth2/beacon.yaml``checkpoint-sync-url`を変更
- 起動オプションを変更(mainnet.envをgoerli.envに)
```sh
docker compose --env-file goerli.env up -d
```

## TIPS  
- 4000番ポートにvalidatorはアクセスしてきますFWなどは開けておきましょう
Expand Down
28 changes: 16 additions & 12 deletions node/compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ services:
######################
geth:
# https://github.com/ethereum/go-ethereum/blob/master/Dockerfile
image: ethereum/client-go:v1.12.2
image: ethereum/client-go:${TAG_ETH1:-v1.12.2}
container_name: ethereum-node
command: >
--goerli --http --http.addr 0.0.0.0 --http.vhosts \* --metrics --metrics.addr 0.0.0.0 --authrpc.addr 0.0.0.0 --authrpc.port 8551 --authrpc.vhosts \* --authrpc.jwtsecret /run/secrets/jwtsecret
--${NETWORK:-mainnet} --http --http.addr 0.0.0.0 --http.vhosts \* --metrics --metrics.addr 0.0.0.0 --authrpc.addr 0.0.0.0 --authrpc.port 8551 --authrpc.vhosts \* --authrpc.jwtsecret /run/secrets/jwtsecret
ports:
- "6060:6060" # for metrics
- "8551:8551" # rpc with auth
- "30303:30303"
- "30303:30303/udp"
env_file:
- '.env'
- '.node.env'
volumes:
# Data persistency
- ./storage.d/eth1:/root
- eth1-storage:/root
restart: always
secrets:
- jwtsecret
Expand All @@ -34,25 +34,25 @@ services:
### eth2 #############
######################
beacon:
image: gcr.io/prysmaticlabs/prysm/beacon-chain:v4.0.8
image: gcr.io/prysmaticlabs/prysm/beacon-chain:${TAG_ETH2:-v4.0.8}
container_name: beacon-node
command: >
--goerli
--${NETWORK:-mainnet}
--config-file=/config/beacon.yaml
ports:
- "4000:4000" # for validators
- "8080:8080" # for metrics, change port.
- "12000:12000/udp"
- "13000:13000"
env_file:
- '.env'
- '.node.env'
restart: always
secrets:
- jwtsecret

volumes:
# Data persistency
- ./storage.d/eth2:/data
- eth2-storage:/data
- ./conf.d/eth2:/config:ro
#logging:
# driver: awslogs
Expand All @@ -66,17 +66,17 @@ services:
### MEV-boost ########
######################
mev:
image: flashbots/mev-boost:1.6
image: flashbots/mev-boost:${TAG_MEV_BOOST:-1.6}
container_name: mev-boost
command: >
-goerli
-${NETWORK:-mainnet}
-addr
0.0.0.0:18550
-relay-check
-relays
https://0xafa4c6985aa049fb79dd37010438cfebeb0f2bd42b115b89dd678dab0670c1de38da0c4e9138c9290a398ecd9a0b3110@builder-relay-goerli.flashbots.net
${URL_MEV_RELAY:-https://0xac6e77dfe25ecd6110b8e780608cce0dab71fdd5ebea22a16c0205200f2f8e2e3ad3b71d3499c54ad14d6c21b41a37ae@boost-relay.flashbots.net}
env_file:
- '.env'
- '.node.env'
restart: always

#logging:
Expand All @@ -86,6 +86,10 @@ services:
# awslogs-group: ethereum-node
# tag: "{{.Name}}/{{.ID}}"

volumes:
eth1-storage:
eth2-storage:

secrets:
jwtsecret:
file: ./jwtsecret
Expand Down
3 changes: 2 additions & 1 deletion node/conf.d/eth2/beacon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ http-mev-relay: http://mev:18550

block-batch-limit: 512

checkpoint-sync-url: https://goerli.checkpoint-sync.ethpandaops.io
#checkpoint-sync-url: https://goerli.beaconstate.ethstaker.cc/
checkpoint-sync-url: https://beaconstate.ethstaker.cc

#############################
suggested-fee-recipient: 0x26f13a2aDdbd41D750C49cAc0984B0ea379C234a
12 changes: 12 additions & 0 deletions node/goerli.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Container image tags.
TAG_ETH1=v1.12.2
TAG_ETH2=v4.0.8
TAG_MEV_BOOST=1.6

# Target network
NETWORK=goerli

# MEV Boost Relay URL
URL_MEV_RELAY=https://0xafa4c6985aa049fb79dd37010438cfebeb0f2bd42b115b89dd678dab0670c1de38da0c4e9138c9290a398ecd9a0b3110@builder-relay-goerli.flashbots.net


11 changes: 11 additions & 0 deletions node/mainnet.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Container image tags.
TAG_ETH1=v1.12.2
TAG_ETH2=v4.0.8
TAG_MEV_BOOST=1.6

# Target network
NETWORK=mainnet

# MEV Boost Relay URL
URL_MEV_RELAY=https://0xac6e77dfe25ecd6110b8e780608cce0dab71fdd5ebea22a16c0205200f2f8e2e3ad3b71d3499c54ad14d6c21b41a37ae@boost-relay.flashbots.net

Empty file removed node/storage.d/eth1/.gitkeep
Empty file.
Empty file removed node/storage.d/eth2/.gitkeep
Empty file.

0 comments on commit faeb9a2

Please sign in to comment.