Skip to content

Commit f39ee35

Browse files
committed
small adjustments to scripts
1 parent 88408b8 commit f39ee35

File tree

2 files changed

+29
-4
lines changed

2 files changed

+29
-4
lines changed

scripts/rosetta/test-block-race-with-data.sh

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ LEDGER_ARCHIVE="ledger.tar"
3636
DB_DIR="db"
3737
LEDGER_DIR="ledger"
3838

39+
CURRENT_USER=$(whoami)
40+
POSTGRES_USER="$CURRENT_USER"
41+
POSTGRES_PASSWORD=""
42+
POSTGRES_DB="archive"
43+
POSTGRES_HOST="localhost"
44+
3945
# Function to display usage
4046
usage() {
4147
cat << EOF
@@ -48,6 +54,10 @@ Required parameters:
4854
4955
Optional parameters:
5056
--postgres-port PORT PostgreSQL server port (default: $POSTGRES_PORT)
57+
--postgres-user USER PostgreSQL user (default: $POSTGRES_USER)
58+
--postgres-password PASS PostgreSQL password (default: empty)
59+
--postgres-db DB PostgreSQL database name (default: $POSTGRES_DB)
60+
--postgres-host HOST PostgreSQL host (default: $POSTGRES_HOST)
5161
--port-base PORT Base port number for services (default: $PORT_BASE)
5262
--num-blocks N Number of blocks to generate (default: $NUM_BLOCKS)
5363
--num-zkapp-txs N Number of zkApp transactions (default: $NUM_ZKAPP_TXS)
@@ -71,6 +81,22 @@ while [[ $# -gt 0 ]]; do
7181
POSTGRES_PORT="$2"
7282
shift 2
7383
;;
84+
--postgres-user)
85+
POSTGRES_USER="$2"
86+
shift 2
87+
;;
88+
--postgres-password)
89+
POSTGRES_PASSWORD="$2"
90+
shift 2
91+
;;
92+
--postgres-db)
93+
POSTGRES_DB="$2"
94+
shift 2
95+
;;
96+
--postgres-host)
97+
POSTGRES_HOST="$2"
98+
shift 2
99+
;;
74100
--port-base)
75101
PORT_BASE="$2"
76102
shift 2
@@ -182,8 +208,7 @@ if [[ ! -x "$ROSETTA_EXE" ]]; then
182208
fi
183209

184210
# Get current username for postgres URI
185-
CURRENT_USER=$(whoami)
186-
POSTGRES_URI="postgres://$CURRENT_USER@localhost:$POSTGRES_PORT/archive"
211+
POSTGRES_URI="postgres://$POSTGRES_USER:$POSTGRES_PASSWORD@$POSTGRES_HOST:$POSTGRES_PORT/$POSTGRES_DB"
187212

188213
# PID for postgres cleanup
189214
POSTGRES_PID=""

scripts/rosetta/test-block-race.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ cp -R "$LEDGER_DIR/ledgers/" genesis
289289
mkdir -p tmp
290290

291291
echo "Running warmup mina advanced test submit-to-archive (1 block, 1 payment, 0 zkapp)..."
292-
TMP=tmp MINA_PRIVKEY_PASS="$MINA_EXE" advanced test submit-to-archive \
292+
TMP=tmp MINA_PRIVKEY_PASS="" "$MINA_EXE" advanced test submit-to-archive \
293293
--archive-node-port "$ARCHIVE_PORT" \
294294
--config-file "$LEDGER_DIR/runtime_config.json" \
295295
--privkey-path "$LEDGER_DIR/plain1" \
@@ -320,7 +320,7 @@ echo ""
320320
# Run main submit-to-archive test
321321
echo "[Main Test] Submitting blocks to archive..."
322322
echo "Running mina advanced test submit-to-archive..."
323-
TMP=tmp MINA_PRIVKEY_PASS="$MINA_EXE" advanced test submit-to-archive \
323+
TMP=tmp MINA_PRIVKEY_PASS="" "$MINA_EXE" advanced test submit-to-archive \
324324
--archive-node-port "$ARCHIVE_PORT" \
325325
--config-file "$LEDGER_DIR/runtime_config.json" \
326326
--privkey-path "$LEDGER_DIR/plain1" \

0 commit comments

Comments
 (0)