Skip to content

Commit

Permalink
feat(node): set locals in node (#92)
Browse files Browse the repository at this point in the history
* set locals in node

* feat: update scripts

* feat: update scripts

* feat: update scripts

---------

Co-authored-by: David <[email protected]>
  • Loading branch information
cyberhorsey and davidtaikocha authored Jul 25, 2023
1 parent 8ba42aa commit 08a5b0d
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 28 deletions.
9 changes: 6 additions & 3 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ L1_PROVER_PRIVATE_KEY=
# contract (be a "mining L2 node"), you need to change `ENABLE_PROPOSER` to true, then fill `L1_PROPOSER_PRIVATE_KEY`
# and `L2_SUGGESTED_FEE_RECIPIENT`
ENABLE_PROPOSER=false
L1_PROPOSER_PRIVATE_KEY= # A L1 account (with balance) private key who will send TaikoL1.proposeBlock transactions
L2_SUGGESTED_FEE_RECIPIENT= # A L2 account address who will be the tx fee beneficiary of the L2 blocks that you proposed
TXPOOL_LOCALS_ONLY=false # Only propose local transactions, useful to set your proposer to only propose blocks with your prover's transactions
# A L1 account (with balance) private key who will send TaikoL1.proposeBlock transactions
L1_PROPOSER_PRIVATE_KEY=
# A L2 account address who will be the tx fee beneficiary of the L2 blocks that you proposed
L2_SUGGESTED_FEE_RECIPIENT=
# comma-delinated local tx pool addresses you want to prioritize, useful to set your proposer to only propose blocks with your prover's transactions
TXPOOL_LOCALS=
9 changes: 6 additions & 3 deletions .env.sample.l3
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ L2_PROVER_PRIVATE_KEY=
# contract (be a "mining L3 node"), you need to change `ENABLE_PROPOSER` to true, then fill `L2_PROPOSER_PRIVATE_KEY`
# and `L3_SUGGESTED_FEE_RECIPIENT`
ENABLE_PROPOSER=false
L2_PROPOSER_PRIVATE_KEY= # A L2 account (with balance) private key who will send TaikoL1.proposeBlock L2 transactions
L3_SUGGESTED_FEE_RECIPIENT= # A L3 account address who will be the tx fee beneficiary of the L2 blocks that you proposed
TXPOOL_LOCALS_ONLY=false # Only propose local transactions, useful to set your proposer to only propose blocks with your prover's transactions
# A L2 account (with balance) private key who will send TaikoL1.proposeBlock L2 transactions
L2_PROPOSER_PRIVATE_KEY=
# A L3 account address who will be the tx fee beneficiary of the L2 blocks that you proposed
L3_SUGGESTED_FEE_RECIPIENT=
# comma-delinated local tx pool addresses you want to prioritize, useful to set your proposer to only propose blocks with your prover's transactions
TXPOOL_LOCALS=
3 changes: 1 addition & 2 deletions docker-compose.l3.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
version: "3.4"
x-logging:
&logging
x-logging: &logging
logging:
options:
max-size: 10m
Expand Down
3 changes: 1 addition & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
version: "3.4"
x-logging:
&logging
x-logging: &logging
logging:
options:
max-size: 10m
Expand Down
30 changes: 21 additions & 9 deletions script/l2/start-proposer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,27 @@
set -eou pipefail

if [ "$ENABLE_PROPOSER" == "true" ]; then
taiko-client proposer \
--l1.ws ${L1_ENDPOINT_WS} \
--l2.http http://l2_execution_engine:8545 \
--taikoL1 ${TAIKO_L1_ADDRESS} \
--taikoL2 ${TAIKO_L2_ADDRESS} \
--l1.proposerPrivKey ${L1_PROPOSER_PRIVATE_KEY} \
--l2.suggestedFeeRecipient ${L2_SUGGESTED_FEE_RECIPIENT} \
--txpool.localsOnly ${TXPOOL_LOCALS_ONLY} \
--minimalBlockGasLimit "5000000"
if [ -z "${TXPOOL_LOCALS}" ]; then
taiko-client proposer \
--l1.ws ${L1_ENDPOINT_WS} \
--l2.http http://l2_execution_engine:8545 \
--taikoL1 ${TAIKO_L1_ADDRESS} \
--taikoL2 ${TAIKO_L2_ADDRESS} \
--l1.proposerPrivKey ${L1_PROPOSER_PRIVATE_KEY} \
--l2.suggestedFeeRecipient ${L2_SUGGESTED_FEE_RECIPIENT} \
--minimalBlockGasLimit "5000000"
else
taiko-client proposer \
--l1.ws ${L1_ENDPOINT_WS} \
--l2.http http://l2_execution_engine:8545 \
--taikoL1 ${TAIKO_L1_ADDRESS} \
--taikoL2 ${TAIKO_L2_ADDRESS} \
--l1.proposerPrivKey ${L1_PROPOSER_PRIVATE_KEY} \
--l2.suggestedFeeRecipient ${L2_SUGGESTED_FEE_RECIPIENT} \
--txpool.locals ${TXPOOL_LOCALS} \
--txpool.localsOnly \
--minimalBlockGasLimit "5000000"
fi
else
sleep infinity
fi
30 changes: 21 additions & 9 deletions script/l3/start-proposer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,27 @@
set -eou pipefail

if [ "$ENABLE_PROPOSER" == "true" ]; then
taiko-client proposer \
--l1.ws ${L2_ENDPOINT_WS} \
--l2.http http://l3_execution_engine:8545 \
--taikoL1 ${TAIKO_L1_ADDRESS} \
--taikoL2 ${TAIKO_L2_ADDRESS} \
--l1.proposerPrivKey ${L2_PROPOSER_PRIVATE_KEY} \
--l2.suggestedFeeRecipient ${L3_SUGGESTED_FEE_RECIPIENT} \
--txpool.localsOnly ${TXPOOL_LOCALS_ONLY} \
--minimalBlockGasLimit "5000000"
if [ -z "${TXPOOL_LOCALS}" ]; then
taiko-client proposer \
--l1.ws ${L2_ENDPOINT_WS} \
--l2.http http://l3_execution_engine:8545 \
--taikoL1 ${TAIKO_L1_ADDRESS} \
--taikoL2 ${TAIKO_L2_ADDRESS} \
--l1.proposerPrivKey ${L2_PROPOSER_PRIVATE_KEY} \
--l2.suggestedFeeRecipient ${L3_SUGGESTED_FEE_RECIPIENT} \
--minimalBlockGasLimit "5000000"
else
taiko-client proposer \
--l1.ws ${L2_ENDPOINT_WS} \
--l2.http http://l3_execution_engine:8545 \
--taikoL1 ${TAIKO_L1_ADDRESS} \
--taikoL2 ${TAIKO_L2_ADDRESS} \
--l1.proposerPrivKey ${L2_PROPOSER_PRIVATE_KEY} \
--l2.suggestedFeeRecipient ${L3_SUGGESTED_FEE_RECIPIENT} \
--txpool.locals ${TXPOOL_LOCALS} \
--txpool.localsOnly \
--minimalBlockGasLimit "5000000"
fi
else
sleep infinity
fi

0 comments on commit 08a5b0d

Please sign in to comment.