You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Once the #131 sets up the programatic entrypoint for the host binary, a clap application can be setup with cli arguments that match the reference implementation.
The host Cargo.toml will need to be updated with clap, tokio, and alloy-primitives as dependencies.
e.g.
[dependencies]
tokio = { version = "1.28.0", features = ["full"] }
clap = { version = "3.2.18", features = ["derive", "env"] }
The host binary main.rs should look something like this.
use std::path::PathBuf;use std::vec::Vec;use std::{env::current_dir, process};use clap::Parser;use alloy_primitives::B256;#[tokio::main]asyncfnmain() -> Result<()>{let _cli = Cli::parse();Ok(())}/// Available networks.#[derive(Debug)]pubenumNetwork{/// Optimism MainnetOptimism,}/// The host binary CLI application arguments.#[derive(Parser,Serialize)]pubstructCli{/// The rollup chain parameters#[clap(long)]pubrollup_config:PathBuf,/// Predefined network selection.#[clap(long)]pubnetwork:Network,/// The Data Directory for preimage data storage. Default uses in-memory storage.#[clap(long)]pubdata_dir:Option<PathBuf>,/// Address of L2 JSON-RPC endpoint to use (eth and debug namespace required).#[clap(long)]publ2_node_address:String,/// Hash of the L1 head block. Derivation stops after this block is processed.#[clap(long)]publ1_head:B256,/// Hash of the L2 block at the L2 Output Root.#[clap(long)]publ2_head:B256,/// Agreed L2 Output Root to start derivation from.#[clap(long)]publ2_output_root:B256,/// Claimed L2 output root to validate#[clap(long)]publ2_claim:B256,/// Number of the L2 block that the claim is from.#[clap(long)]publ2_block_number:u64,//// Path to the genesis file.#[clap(long)]publ2_genesis_path:PathBuf,/// Address of L1 JSON-RPC endpoint to use (eth namespace required)#[clap(long)]publ1_node_address:String,/// Address of the L1 Beacon API endpoint to use.#[clap(long)]publ1_beacon_address:String,/// Trust the L1 RPC, sync faster at risk of malicious/buggy RPC providing bad or inconsistent L1 data#[clap(long)]publ1_trust_rpc:bool,/// The kind of RPC provider, used to inform optimal transactions receipts fetching, and thus reduce costs.#[clap(long)]publ1_rpc_provider_kind:Vec<RpcKind>,/// Run the specified client program as a separate process detached from the host. Default is to run the client program in the host process.#[clap(long)]pubexec:String,/// Run in pre-image server mode without executing any client program.#[clap(long)]pubserver:bool}
The text was updated successfully, but these errors were encountered:
Description
Once the #131 sets up the programatic entrypoint for the host binary, a clap application can be setup with cli arguments that match the reference implementation.
See the
op-program
'sflags.go
.Output
The host
Cargo.toml
will need to be updated withclap
,tokio
, andalloy-primitives
as dependencies.e.g.
The
host
binarymain.rs
should look something like this.The text was updated successfully, but these errors were encountered: