Skip to content

Commit

Permalink
add proposeblock make command
Browse files Browse the repository at this point in the history
  • Loading branch information
Keszey Dániel authored and Keszey Dániel committed Jul 23, 2024
1 parent d6079da commit 33a509e
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/protocol/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@

install:
./scripts/setup_deps.sh

propose:
./scripts/propose_block.sh
29 changes: 29 additions & 0 deletions packages/protocol/scripts/propose_block.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash

# Run the setup_deps.sh script to ensure dependencies are set up
./scripts/setup_deps.sh

# Read the RPC port from temporary file
RPC_PORT=$(cat /tmp/kurtosis_rpc_port)

# Load the .env file and extract the PRIVATE_KEY
if [ -f .env ]; then
export $(grep -v '^#' .env | xargs)
PRIVATE_KEY=${PRIVATE_KEY}
else
echo ".env file not found. Please create a .env file with your PRIVATE_KEY."
exit 1
fi

if [ -z "$PRIVATE_KEY" ]; then
echo "PRIVATE_KEY not found in the .env file."
exit 1
fi

# Run the forge foundry script using the extracted RPC port and PRIVATE_KEY
FORGE_COMMAND="forge script --rpc-url http://127.0.0.1:$RPC_PORT scripts/L2_txn_simulation/ProposeBlock.s.sol -vvvv --broadcast --private-key $PRIVATE_KEY --legacy"

echo "Running forge foundry script..."
eval $FORGE_COMMAND

echo "Forge script execution completed."
1 change: 1 addition & 0 deletions packages/protocol/scripts/setup_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ if [ -z "$RPC_PORT" ]; then
exit 1
else
echo "Extracted RPC port: $RPC_PORT"
echo "$RPC_PORT" > /tmp/kurtosis_rpc_port
fi

# Load the .env file and extract the PRIVATE_KEY
Expand Down

0 comments on commit 33a509e

Please sign in to comment.