From 958c7e61c9a61d36e64f845c18b6d725c7e02707 Mon Sep 17 00:00:00 2001 From: _den <_den@outlook.com> Date: Sat, 12 Mar 2022 16:23:27 +1000 Subject: [PATCH] added files to run without a proxy --- README.md | 2 +- bor/bor.md | 4 +- bor/docker-compose.no-proxy.yml | 156 +++++++++++++++++++++++++ bor/example.env | 2 +- bsc/bsc.md | 4 +- bsc/docker-compose.no-proxy.yml | 66 +++++++++++ bsc/example.env | 2 +- geth/docker-compose.no-proxy.yml | 69 +++++++++++ geth/example.env | 2 +- geth/geth.md | 2 +- nethermind/docker-compose.no-proxy.yml | 48 ++++++++ nethermind/example.env | 2 +- nethermind/nethermind.md | 2 +- 13 files changed, 350 insertions(+), 11 deletions(-) create mode 100644 bor/docker-compose.no-proxy.yml create mode 100644 bsc/docker-compose.no-proxy.yml create mode 100644 geth/docker-compose.no-proxy.yml create mode 100644 nethermind/docker-compose.no-proxy.yml diff --git a/README.md b/README.md index ee278e8..ea04f3c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # rpc-nodes -## 1. Start proxy (traefik) +## 1. Start traefik proxy (you can skip this step if you are not going to use traefik) Create a shared network for running containers: ```bash docker network create rpc-shared-network diff --git a/bor/bor.md b/bor/bor.md index 28b20b8..26d8a15 100644 --- a/bor/bor.md +++ b/bor/bor.md @@ -14,14 +14,14 @@ You can also set a list of allowed IP addresses there and addresses to treat as mv example.env .env ``` -Start node: +Start node (If you do not use traefik, specify the compose file with the `-f docker-compose.no-proxy.yml`): ```bash docker-compose build docker-compose up -d rabbitmq heimdalld heimdallr bor ``` ## Upgrade -Periodically check for new versions. if there is a release, then you need to update the tag in the environment file. +Periodically check for new versions. if there is a release, then you need to update the tag (`BOR_TAG`) in the environment file. ```bash docker-compose build docker-compose pull diff --git a/bor/docker-compose.no-proxy.yml b/bor/docker-compose.no-proxy.yml new file mode 100644 index 0000000..a5a7203 --- /dev/null +++ b/bor/docker-compose.no-proxy.yml @@ -0,0 +1,156 @@ +version: "3.7" + +services: + rabbitmq: + image: rabbitmq:3-alpine + restart: unless-stopped + volumes: + - /etc/localtime:/etc/localtime:ro + expose: + - "5672/tcp" + + heimdalld: + build: + context: . + dockerfile: Dockerfile.heimdall + args: + - DOCKER_TAG=${HEIMDALL_TAG} + image: heimdall:local + user: root + environment: + - HEIMDALL_CHAIN_ID=${HEIMDALL_CHAIN_ID} + - HEIMDALL_SNAPSHOT_FILE=${HEIMDALL_SNAPSHOT_FILE} + - HEIMDALL_GENESIS_URL=${HEIMDALL_GENESIS_URL} + - HEIMDALL_SEEDS=${HEIMDALL_SEEDS} + - HEIMDALL_BOR_RPC_URL=${HEIMDALL_BOR_RPC_URL} + - HEIMDALL_ETH_RPC_URL=${HEIMDALL_ETH_RPC_URL} + restart: unless-stopped + stop_grace_period: 2m + depends_on: + - rabbitmq + entrypoint: + - docker-entrypoint.sh + - heimdalld + - --home + - /var/lib/heimdall + - start + volumes: + - ./heimdall-data:/var/lib/heimdall + - /etc/localtime:/etc/localtime:ro + expose: + - "26657/tcp" + ports: + - "26656:26656" + + heimdallr: + image: heimdall:local + restart: unless-stopped + stop_grace_period: 2m + depends_on: + - heimdalld + volumes: + - ./heimdall-data:/var/lib/heimdall + - /etc/localtime:/etc/localtime:ro + expose: + - "1317/tcp" + user: root + entrypoint: + - heimdalld + - --home + - /var/lib/heimdall + - rest-server + - --chain-id=137 + - --laddr=tcp://0.0.0.0:1317 + - --node=tcp://heimdalld:26657 + + prune-bor: + image: bor:local + restart: "no" + stop_grace_period: 3m + user: root + volumes: + - ./bor-data:/var/lib/bor + - /etc/localtime:/etc/localtime:ro + entrypoint: + - bor + - --datadir + - /var/lib/bor/data + - snapshot + - prune-state + + bor: + image: bor:local + build: + context: . + dockerfile: ${BOR_DOCKER_FILE} + args: + - BUILD_TARGET=${BOR_SRC_TAG} + - DOCKER_TAG=${BOR_TAG} + restart: unless-stopped + stop_grace_period: 7m + user: root + environment: + - BOR_DIR=/var/lib/bor + - BOR_SETUP=${BOR_SETUP} + - BOR_GENESIS=${BOR_GENESIS} + - BOR_ARCHIVE_NODE_SNAPSHOT_FILE=${BOR_ARCHIVE_NODE_SNAPSHOT_FILE} + - BOR_FULL_NODE_SNAPSHOT_FILE=${BOR_FULL_NODE_SNAPSHOT_FILE} + - BOR_MODE=${BOR_MODE} + entrypoint: + - docker-entrypoint.sh + - bor + - --datadir + - /var/lib/bor/data + - --cache + - ${BOR_CACHE} + - --snapshot=false + - --gcmode + - ${BOR_MODE} + - --ws + - --ws.port + - ${BOR_WS_PORT} + - --ws.addr + - 0.0.0.0 + - --ws.origins=* + - --port + - ${BOR_P2P_PORT} + - --txpool.locals + - ${TX_LOCAL_ADDR} + - --txpool.globalslots + - "100000" + - --rpc.txfeecap + - "0" + - --txpool.accountslots + - "256" + - --bor.heimdall + - http://heimdallr:1317 + - --bootnodes + - "${BOR_BOOTNODES}" + - --syncmode + - "full" + - --txpool.accountqueue + - "64" + - --txpool.globalqueue + - "131072" + - --maxpeers + - "150" + - --http + - --http.addr + - 0.0.0.0 + - --http.vhosts=* + - --http.api + - eth,net,web3,txpool,bor + - --http.port + - ${BOR_RPC_PORT} + - --networkid + - ${BOR_CHAIN_ID} + - --ethstats + - ${BOR_NODE_ID}:mainnet@bor-mainnet.vitwit.com:3000 + volumes: + - ./bor-data:/var/lib/bor + - /etc/localtime:/etc/localtime:ro + ports: + - ${BOR_RPC_PORT}:${BOR_RPC_PORT}/tcp + - ${BOR_WS_PORT}:${BOR_WS_PORT}/tcp + - ${BOR_P2P_PORT}:${BOR_P2P_PORT}/tcp + - ${BOR_P2P_PORT}:${BOR_P2P_PORT}/udp \ No newline at end of file diff --git a/bor/example.env b/bor/example.env index 275559f..0b5e1d5 100644 --- a/bor/example.env +++ b/bor/example.env @@ -1,4 +1,4 @@ -# Traefik +# Traefik (if you use proxy) DOMAIN=domain.org # Comma-separated list of IP/mask addresses to allow access. Replace 0.0.0.0/0 with your address ALLOW_FROM=0.0.0.0/0 diff --git a/bsc/bsc.md b/bsc/bsc.md index 55219c5..a17ce1c 100644 --- a/bsc/bsc.md +++ b/bsc/bsc.md @@ -14,14 +14,14 @@ You can also set a list of allowed IP addresses there and addresses to treat as mv example.env .env ``` -Start node: +Start node (If you do not use traefik, specify the compose file with the `-f docker-compose.no-proxy.yml`): ```bash docker-compose build docker-compose up -d bsc ``` ## Upgrade -Periodically check for new versions. if there is a release, then you need to update the tag in the environment file. +Periodically check for new versions. If there is a release, then you need to update the tag (`BSC_TAG`) in the environment file. ```bash docker-compose build docker-compose up -d bsc diff --git a/bsc/docker-compose.no-proxy.yml b/bsc/docker-compose.no-proxy.yml new file mode 100644 index 0000000..c0cb503 --- /dev/null +++ b/bsc/docker-compose.no-proxy.yml @@ -0,0 +1,66 @@ +version: "3.7" + +services: + bsc-pruning: + image: bsc:local + container_name: bsc-pruning + entrypoint: + - bsc + - snapshot + - prune-state + restart: "no" + volumes: + - ./bsc-data:/root/.ethereum + - ./config.toml:/root/.ethereum/config.toml + + bsc: + image: bsc:local + build: + context: . + args: + - BSC_TAG=${BSC_TAG} + container_name: bsc + env_file: .env + entrypoint: + - docker-entrypoint.sh + - bsc + - --config + - "/root/.ethereum/config.toml" + - --port + - "${P2P_PORT}" + - --rpc.allow-unprotected-txs + - --http + - --http.addr + - "0.0.0.0" + - --http.port + - "${HTTP_PORT}" + - --http.corsdomain=* + - --http.vhosts=* + - --http.api + - "eth,net,web3,parlia,txpool" + - --ws + - --ws.addr + - "0.0.0.0" + - --ws.port + - "${WS_PORT}" + - --ws.origins=* + - --ws.api + - "eth,net,web3,txpool" + - --txpool.pricelimit + - "1" + - --txpool.reannouncetime + - "1m" + - --txpool.locals + - "${TX_LOCAL_ADDR}" + - --cache + - "20480" + restart: always + stop_grace_period: 4m + stop_signal: SIGINT + ports: + - ${HTTP_PORT}:${HTTP_PORT} + - ${WS_PORT}:${WS_PORT} + - ${P2P_PORT}:${P2P_PORT} + volumes: + - ./bsc-data:/root/.ethereum + - ./config.toml:/root/.ethereum/config.toml diff --git a/bsc/example.env b/bsc/example.env index 86be48c..f0e2bc5 100644 --- a/bsc/example.env +++ b/bsc/example.env @@ -1,4 +1,4 @@ -# Traefik +# Traefik (if you use proxy) DOMAIN=domain.org # Comma-separated list of IP/mask addresses to allow access. Replace 0.0.0.0/0 with your address ALLOW_FROM=0.0.0.0/0 diff --git a/geth/docker-compose.no-proxy.yml b/geth/docker-compose.no-proxy.yml new file mode 100644 index 0000000..68c3804 --- /dev/null +++ b/geth/docker-compose.no-proxy.yml @@ -0,0 +1,69 @@ +version: "3.7" + +services: + geth-pruning: + image: ethereum/client-go:stable + container_name: geth-pruning + restart: "no" + env_file: .env + command: "snapshot prune-state" + volumes: + - ./geth-data:/root/.ethereum + geth: + image: ethereum/client-go:stable + container_name: geth + restart: always + env_file: .env + command: + - --maxpeers + - "50" + - --cache + - "10629" + - --port + - "${P2P_PORT}" + - --nat + - "any" + - --http + - --http.addr + - "0.0.0.0" + - --http.port + - "${HTTP_PORT}" + - --http.corsdomain=* + - --http.vhosts=* + - --http.api + - "eth,net,web3,txpool" + - --ws + - --ws.addr + - "0.0.0.0" + - --ws.port + - "${WS_PORT}" + - --ws.origins=* + - --ws.api + - "eth,net,web3,txpool" + - --txpool.locals + - "${TX_LOCAL_ADDR}" + - --txpool.accountslots + - "32" + - --txpool.globalslots + - "8192" + - --txpool.accountqueue + - "128" + - --txpool.globalqueue + - "2048" + - --rpc.gascap + - "0" + - --rpc.txfeecap + - "0" + ports: + - ${HTTP_PORT}:${HTTP_PORT} + - ${WS_PORT}:${WS_PORT} + - ${P2P_PORT}:${P2P_PORT} + volumes: + - ./geth-data:/root/.ethereum + stop_grace_period: 3m30s + stop_signal: SIGINT + healthcheck: + test: wget -nv -t1 --spider 'http://127.0.0.1:${HTTP_PORT}/' || exit 1 + interval: 5s + timeout: 10s + retries: 3 diff --git a/geth/example.env b/geth/example.env index a407ba4..d43aa6d 100644 --- a/geth/example.env +++ b/geth/example.env @@ -1,4 +1,4 @@ -# Traefik +# Traefik (if you use proxy) DOMAIN=domain.org # Comma-separated list of IP/mask addresses to allow access. Replace 0.0.0.0/0 with your address ALLOW_FROM=0.0.0.0/0 diff --git a/geth/geth.md b/geth/geth.md index 1bd4978..036e0c8 100644 --- a/geth/geth.md +++ b/geth/geth.md @@ -10,7 +10,7 @@ Set the domain name to be used in the `.env` file. You can also set a list of al mv example.env .env ``` -Start node: +Start node (If you do not use traefik, specify the compose file with the `-f docker-compose.no-proxy.yml`): ```bash docker-compose up -d geth ``` diff --git a/nethermind/docker-compose.no-proxy.yml b/nethermind/docker-compose.no-proxy.yml new file mode 100644 index 0000000..333c5ca --- /dev/null +++ b/nethermind/docker-compose.no-proxy.yml @@ -0,0 +1,48 @@ +version: "3.7" +services: + nethermind: + image: nethermind/nethermind:latest + container_name: nethermind + restart: always + env_file: .env + stop_grace_period: 2m + ports: + - ${HTTP_PORT}:${HTTP_PORT} + - ${WS_PORT}:${WS_PORT} + - ${P2P_PORT}:${P2P_PORT}/tcp + - ${P2P_PORT}:${P2P_PORT}/udp + command: + - --datadir + - /var/lib/nethermind + - --Init.WebSocketsEnabled + - "true" + - --Network.DiscoveryPort + - "${P2P_PORT}" + - --Network.P2PPort + - "${P2P_PORT}" + - --JsonRpc.Enabled + - "true" + - --JsonRpc.EnabledModules + - "Web3,Eth,Subscribe,Net,Parity" + - --JsonRpc.Host + - "0.0.0.0" + - --JsonRpc.Port + - "${HTTP_PORT}" + - --JsonRpc.WebSocketsPort + - "${WS_PORT}" + - --Sync.FastSync + - "true" + - --config + - xdai + - --Pruning.Enabled + - "true" + - --Pruning.CacheMb + - "4096" + - --TxPool.Size + - "4096" + - --Sync.AncientBodiesBarrier + - "1" + - --Sync.AncientReceiptsBarrier + - "1" + volumes: + - ./nethermind-data:/var/lib/nethermind \ No newline at end of file diff --git a/nethermind/example.env b/nethermind/example.env index a299026..445a431 100644 --- a/nethermind/example.env +++ b/nethermind/example.env @@ -1,4 +1,4 @@ -# Traefik +# Traefik (if you use proxy) DOMAIN=domain.org # Comma-separated list of IP/mask addresses to allow access. Replace 0.0.0.0/0 with your address ALLOW_FROM=0.0.0.0/0 diff --git a/nethermind/nethermind.md b/nethermind/nethermind.md index 6f75276..5098dfb 100644 --- a/nethermind/nethermind.md +++ b/nethermind/nethermind.md @@ -10,7 +10,7 @@ Set the domain name to be used in the `.env` file. You can also set a list of al mv example.env .env ``` -Start node: +Start node (If you do not use traefik, specify the compose file with the `-f docker-compose.no-proxy.yml`): ```bash docker-compose up -d ```