Skip to content

Commit

Permalink
Showing 2 changed files with 44 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/protocol/scripts/DeployL1Locally.s.sol
Original file line number Diff line number Diff line change
@@ -38,7 +38,7 @@ import { P256Verifier } from "p256-verifier/src/P256Verifier.sol";
/// @title DeployOnL1
/// @notice This script deploys the core Taiko protocol smart contract on L1,
/// initializing the rollup.
contract DeployL1OnAnvil is DeployCapability {
contract DeployL1Locally is DeployCapability {
// uint256 public NUM_MIN_MAJORITY_GUARDIANS = vm.envUint("NUM_MIN_MAJORITY_GUARDIANS");
// uint256 public NUM_MIN_MINORITY_GUARDIANS = vm.envUint("NUM_MIN_MINORITY_GUARDIANS");

45 changes: 43 additions & 2 deletions packages/protocol/scripts/setup_deps.sh
Original file line number Diff line number Diff line change
@@ -82,8 +82,49 @@ else
exit 1
fi

# Run the Kurtosis command
# Run the Kurtosis command and capture its output
echo "Running Kurtosis command..."
kurtosis run github.com/ethpandaops/ethereum-package --args-file ./scripts/confs/network_params.yaml
KURTOSIS_OUTPUT=$(kurtosis run github.com/ethpandaops/ethereum-package --args-file ./scripts/confs/network_params.yaml)

# Print the entire Kurtosis output for debugging
# echo "Kurtosis Output:"
# echo "$KURTOSIS_OUTPUT"

# Extract the "User Services" section
USER_SERVICES_SECTION=$(echo "$KURTOSIS_OUTPUT" | awk '/^========================================== User Services ==========================================/{flag=1;next}/^$/{flag=0}flag')

# Print the "User Services" section for debugging
echo "User Services Section:"
echo "$USER_SERVICES_SECTION"

# Extract the dynamic port assigned to the rpc service for "el-1-reth-lighthouse"
RPC_PORT=$(echo "$USER_SERVICES_SECTION" | grep -A 5 "el-1-reth-lighthouse" | grep "rpc: 8545/tcp" | sed -E 's/.* -> 127.0.0.1:([0-9]+).*/\1/')

if [ -z "$RPC_PORT" ]; then
echo "Failed to extract RPC port from User Services section."
exit 1
else
echo "Extracted RPC port: $RPC_PORT"
fi

# 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/DeployL1Locally.s.sol -vvvv --broadcast --private-key $PRIVATE_KEY --legacy"

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

echo "Script execution completed."

0 comments on commit f9a69a6

Please sign in to comment.