From 8a6584078a5f118e75b18406984b3166d3151c76 Mon Sep 17 00:00:00 2001 From: Sergey Nazarov Date: Sat, 2 Nov 2024 17:01:14 +0300 Subject: [PATCH] wip --- docker/docker-compose.yml | 3 --- docker/geth-mainnet.toml | 10 ++++++++++ docker/init-geth.sh | 6 ------ docker/services/besu.yml | 5 ++++- docker/services/geth.yml | 16 ++++++++++++---- docker/services/waves-node.yml | 1 + docker/static-nodes-mainnet.json | 4 ++++ docker/static-nodes-testnet.json | 0 8 files changed, 31 insertions(+), 14 deletions(-) create mode 100644 docker/geth-mainnet.toml delete mode 100755 docker/init-geth.sh create mode 100644 docker/static-nodes-mainnet.json create mode 100644 docker/static-nodes-testnet.json diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 19f5ce9b..61e2af5b 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -2,7 +2,6 @@ services: besu: profiles: [besu] hostname: execution-client - restart: unless-stopped extends: file: ./services/besu.yml service: besu @@ -16,7 +15,6 @@ services: geth: profiles: [geth] hostname: execution-client - restart: unless-stopped extends: file: ./services/geth.yml service: geth @@ -25,7 +23,6 @@ services: condition: service_completed_successfully waves-node: - restart: unless-stopped extends: file: ./services/waves-node.yml service: waves-node diff --git a/docker/geth-mainnet.toml b/docker/geth-mainnet.toml new file mode 100644 index 00000000..b7f7c958 --- /dev/null +++ b/docker/geth-mainnet.toml @@ -0,0 +1,10 @@ +[Node.P2P] +BootstrapNodes = [ + "enode://b232ad7ca7bd6156e1adaa28ee0d064f3d973a67c0ad507a1b9dc32b3d64b307c754bc48c274aa96852f0041c2f85792681495e21f5baa62f06d3db8097af258@142.132.251.180:30303", + "enode://e8f7dbec4b146ef0ed1852cd05e3c0654f78a5784a7584f45bc0073bf6206d55764600b586148dfca42bd711c1c1bc02cb20abb2210320f830f003aacf074396@95.217.59.114:30303" +] +BootstrapNodesV5 = [] +StaticNodes = [ + "enode://b232ad7ca7bd6156e1adaa28ee0d064f3d973a67c0ad507a1b9dc32b3d64b307c754bc48c274aa96852f0041c2f85792681495e21f5baa62f06d3db8097af258@142.132.251.180:30303", + "enode://e8f7dbec4b146ef0ed1852cd05e3c0654f78a5784a7584f45bc0073bf6206d55764600b586148dfca42bd711c1c1bc02cb20abb2210320f830f003aacf074396@95.217.59.114:30303" +] diff --git a/docker/init-geth.sh b/docker/init-geth.sh deleted file mode 100755 index 39e25e74..00000000 --- a/docker/init-geth.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -if [ ! -d /root/.ethereum/geth ] ; then - geth init /tmp/genesis.json -else - echo geth already initialized -fi diff --git a/docker/services/besu.yml b/docker/services/besu.yml index 4762f639..5ddef47c 100644 --- a/docker/services/besu.yml +++ b/docker/services/besu.yml @@ -4,6 +4,7 @@ services: image: hyperledger/besu:latest pull_policy: always stop_grace_period: 5m + restart: unless-stopped command: - --logging=ALL - --host-allowlist=* @@ -19,9 +20,11 @@ services: - --data-path=/var/lib/besu - --genesis-file=/etc/besu/genesis.json - --data-storage-format=BONSAI + - --static-nodes-file=/etc/besu/static-nodes.json volumes: - - ../genesis-${NETWORK}.json:/etc/besu/genesis.json - ../data/secrets:/etc/secrets:ro + - ../genesis-${NETWORK}.json:/etc/besu/genesis.json + - ../static-nodes-${NETWORK}.json:/etc/besu/static-nodes.json - ../log4j2.xml:/etc/besu/log4j2.xml - ../data/besu:/var/lib/besu - ../logs/besu:/opt/besu/logs diff --git a/docker/services/geth.yml b/docker/services/geth.yml index 993f49d0..a86449d2 100644 --- a/docker/services/geth.yml +++ b/docker/services/geth.yml @@ -2,17 +2,25 @@ services: geth-init: container_name: geth-init image: ethereum/client-go:stable - entrypoint: /tmp/init-geth.sh + entrypoint: /bin/sh -c + command: + - | + if [ ! -d /root/.ethereum/geth ] ; then + geth init /tmp/genesis.json + else + echo geth already initialized + fi volumes: - ../genesis-${NETWORK}.json:/tmp/genesis.json - ../data/geth:/root/.ethereum - - ../init-geth.sh:/tmp/init-geth.sh geth: container_name: geth image: ethereum/client-go:stable pull_policy: always stop_grace_period: 5m + restart: unless-stopped command: + - --config=/etc/config.toml - --syncmode=full - --verbosity=4 - --http @@ -32,7 +40,6 @@ services: environment: - GETH_MINER_GASLIMIT=${GAS_LIMIT} - GETH_NETWORKID=${NETWORK_ID} - - GETH_BOOTNODES=${BOOTNODES} logging: driver: local options: @@ -41,11 +48,12 @@ services: volumes: - ../data/secrets:/etc/secrets:ro - ../data/geth:/root/.ethereum + - ../geth-${NETWORK}:/etc/config.toml ports: - '30303:30303/tcp' - '30303:30303/udp' healthcheck: test: 'wget -qO /dev/null --header "content-type: application/json" --post-data {\"jsonrpc\":\"2.0\",\"method\":\"eth_blockNumber\",\"params\":[],\"id\":1} http://127.0.0.1:8545' - interval: 5s + interval: 10s timeout: 1s retries: 10 diff --git a/docker/services/waves-node.yml b/docker/services/waves-node.yml index c6de841e..377bbe2a 100644 --- a/docker/services/waves-node.yml +++ b/docker/services/waves-node.yml @@ -3,6 +3,7 @@ services: container_name: waves-node image: ghcr.io/unitsnetwork/consensus-client:testnet stop_grace_period: 5m + restart: unless-stopped ports: - 127.0.0.1:6869:6869 - 6868:6868 diff --git a/docker/static-nodes-mainnet.json b/docker/static-nodes-mainnet.json new file mode 100644 index 00000000..a419fafa --- /dev/null +++ b/docker/static-nodes-mainnet.json @@ -0,0 +1,4 @@ +[ + "enode://b232ad7ca7bd6156e1adaa28ee0d064f3d973a67c0ad507a1b9dc32b3d64b307c754bc48c274aa96852f0041c2f85792681495e21f5baa62f06d3db8097af258@142.132.251.180:30303", + "enode://e8f7dbec4b146ef0ed1852cd05e3c0654f78a5784a7584f45bc0073bf6206d55764600b586148dfca42bd711c1c1bc02cb20abb2210320f830f003aacf074396@95.217.59.114:30303" +] diff --git a/docker/static-nodes-testnet.json b/docker/static-nodes-testnet.json new file mode 100644 index 00000000..e69de29b