Use mounted volumes for data in geth nodes

This commit is contained in:
Prathamesh Musale 2023-04-13 18:09:37 +05:30
parent cf79f0de0a
commit 76bf5a3c5d
4 changed files with 12 additions and 4 deletions

View File

@ -8,6 +8,8 @@ services:
environment:
RUN_BOOTNODE: "true"
image: cerc/fixturenet-eth-geth:local
volumes:
- bootnode_geth_data:/root/ethdata
ports:
- "9898"
- "30303"
@ -26,6 +28,7 @@ services:
image: cerc/fixturenet-eth-geth:local
volumes:
- fixturenet_geth_accounts:/opt/testnet/build/el
- fixturenet_eth_geth_1_data:/root/ethdata
healthcheck:
test: ["CMD", "nc", "-v", "localhost", "8545"]
interval: 30s
@ -52,6 +55,8 @@ services:
image: cerc/fixturenet-eth-geth:local
depends_on:
- fixturenet-eth-bootnode-geth
volumes:
- fixturenet_eth_geth_2_data:/root/ethdata
fixturenet-eth-bootnode-lighthouse:
hostname: fixturenet-eth-bootnode-lighthouse
@ -106,3 +111,6 @@ services:
volumes:
fixturenet_geth_accounts:
bootnode_geth_data:
fixturenet_eth_geth_1_data:
fixturenet_eth_geth_2_data:

View File

@ -22,6 +22,6 @@ COPY run-el.sh /opt/testnet/run.sh
RUN cd /opt/testnet && make genesis-el
COPY --from=geth /usr/local/bin/geth /usr/local/bin/
RUN geth init /opt/testnet/build/el/geth.json && rm -f ~/.ethereum/geth/nodekey
RUN geth --datadir ~/ethdata init /opt/testnet/build/el/geth.json && rm -f ~/ethdata/geth/nodekey
ENTRYPOINT ["/opt/testnet/run.sh"]

View File

@ -12,6 +12,6 @@ for line in `cat ../build/el/accounts.csv`; do
echo ""
echo "$ADDRESS"
geth account import --password .pw.$$ .key.$$
geth account import --datadir=~/ethdata --password .pw.$$ .key.$$
rm -f .pw.$$ .key.$$
done

View File

@ -13,7 +13,7 @@ cd /opt/testnet/build/el
python3 -m http.server 9898 &
cd $HOME_DIR
START_CMD="geth"
START_CMD="geth --datadir=~/ethdata"
if [ "true" == "$CERC_REMOTE_DEBUG" ] && [ -x "/usr/local/bin/dlv" ]; then
START_CMD="/usr/local/bin/dlv --listen=:40000 --headless=true --api-version=2 --accept-multiclient exec /usr/local/bin/geth --continue --"
fi
@ -28,7 +28,7 @@ if [ "true" == "$RUN_BOOTNODE" ]; then
else
cd /opt/testnet/accounts
./import_keys.sh
echo -n "$JWT" > /opt/testnet/build/el/jwtsecret
if [ "$CERC_RUN_STATEDIFF" == "detect" ] && [ -n "$CERC_STATEDIFF_DB_HOST" ]; then