Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions config/l2_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ def __init__(self):

# === P2P Options ===

self.l2_node_p2p_static_peers = ""
"""
Comma-separated list of bootnodes to connect to.
"""

self.l2_node_p2p_enabled = False
"""
Whether to enable P2P (peer discovery + block gossip — False by default).
Expand Down
2 changes: 1 addition & 1 deletion l2_deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def _generate_l2_genesis(config: Config):
print("Generating L2 genesis and rollup configs")
try:
log_file = f"{config.logs_dir}/generate_l2_genesis.log"
l2_allocs_path = os.path.join(config.artifacts_dir, 'allocs-l2.json')
l2_allocs_path = os.path.join(config.artifacts_dir, 'allocs-l2-granite.json')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add two config variables here:

  • target hard fork (with default value "granite")
  • allocs file name (with default value derived from the target hard fork)

lib.run_roll_log("generate l2 genesis and rollup configs", [
'go', 'run', 'cmd/main.go', 'genesis', 'l2',
'--l1-rpc', 'http://localhost:8545',
Expand Down
1 change: 1 addition & 0 deletions l2_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def start(config: Config, sequencer: bool = True):
# https://github.com/ethereum-optimism/optimism/blob/develop/op-node/flags/p2p_flags.go

*(["--p2p.disable"] if not config.l2_node_p2p_enabled else [
f"--p2p.static={config.l2_node_p2p_static_peers}",
f"--p2p.listen.ip={config.l2_node_p2p_listen_addr}",
f"--p2p.listen.tcp={config.l2_node_p2p_tcp_listen_port}",
f"--p2p.listen.udp={config.l2_node_p2p_udp_listen_port}",
Expand Down
11 changes: 11 additions & 0 deletions roll.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@
"l2-sequencer",
help="starts a local L2 node (op-node) in sequencer mode")

p.command(
"l2-node",
help="starts a local L2 node (op-node) in non-sequencer mode")

p.command(
"l2-batcher",
help="starts a local L2 transaction batcher")
Expand Down Expand Up @@ -393,6 +397,13 @@ def main():
l2_node.start(config, sequencer=True)
wait(config)

elif state.args.command == "l2-node":
if state.args.clean_first:
l2_node.clean(config)

l2_node.start(config, sequencer=False)
wait(config)

elif state.args.command == "l2-batcher":
# nothing to clean
l2_batcher.start(config)
Expand Down