From bdfd6253ea3b310471ab4b95724cbf70a35e56e6 Mon Sep 17 00:00:00 2001 From: i-norden Date: Tue, 28 Dec 2021 10:35:38 -0600 Subject: [PATCH] let statediff writing mode be configured by env variable --- docker/startup_script.sh | 2 +- src/dapp/libexec/dapp/dapp---testnet-launch | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docker/startup_script.sh b/docker/startup_script.sh index abb7d5c66..2b05e6a5d 100644 --- a/docker/startup_script.sh +++ b/docker/startup_script.sh @@ -8,7 +8,7 @@ trap "exit 1" SIGINT SIGTERM TMPDIR=$(mktemp -d) dapp testnet --rpc-addr 0.0.0.0 --chain-id 4 --db-user $DB_USER --db-password $DB_PASSWORD --db-name $DB_NAME \ - --db-host $DB_HOST --db-port $DB_PORT --dir "$TMPDIR" --address=$ADDRESS & + --db-host $DB_HOST --db-port $DB_PORT --db-write $DB_WRITE --dir "$TMPDIR" --address=$ADDRESS & echo "sleeping 90 sec" # give it a few secs to start up sleep 90 diff --git a/src/dapp/libexec/dapp/dapp---testnet-launch b/src/dapp/libexec/dapp/dapp---testnet-launch index d746aef45..6c2e08abf 100755 --- a/src/dapp/libexec/dapp/dapp---testnet-launch +++ b/src/dapp/libexec/dapp/dapp---testnet-launch @@ -9,6 +9,7 @@ db-password=password database password db-name=name database name db-host=address database host db-port=port database port +db-write=bool turn on database write mode rpc-port=port change RPC port (default: 8545) rpc-addr=address change RPC address (default: 127.0.0.1) chain-id=number change chain ID (default: 99) @@ -45,6 +46,7 @@ while [[ $1 ]]; do --db-name) shift; DB_NAME=$1;; --db-host) shift; DB_HOST=$1;; --db-port) shift; DB_PORT=$1;; + --db-write) shift; DB_WRITE=$1;; --rpc-port) shift; RPC_PORT=$1;; --rpc-addr) shift; RPC_ADDRESS=$1;; --chain-id) shift; CHAINID=$1;; @@ -132,7 +134,7 @@ geth \ --http --http.api "web3,eth,net,debug,personal,statediff" --http.corsdomain '*' --http.vhosts '*' --nodiscover \ --http.addr="$RPC_ADDRESS" --http.port="$RPC_PORT" --syncmode=full --gcmode=archive \ --statediff --statediff.db="host=$DB_HOST port=$DB_PORT user=$DB_USER password=$DB_PASSWORD dbname=$DB_NAME sslmode=disable" \ - --statediff.dbnodeid 1 --statediff.dbclientname test1 --statediff.writing=true \ + --statediff.dbnodeid 1 --statediff.dbclientname test1 --statediff.writing="$DB_WRITE" \ --ws --ws.addr="0.0.0.0" --unlock="$(IFS=,; echo "${address[*]}")" --password=<(exit) & gethpid=$!