pub struct Cli {Show 56 fields
pub command: Option<Command>,
pub offline: bool,
pub health_check_endpoint: bool,
pub config_out: Option<String>,
pub port: Option<u16>,
pub host: Vec<IpAddr>,
pub chain_id: Option<u32>,
pub debug_mode: bool,
pub show_node_config: Option<bool>,
pub show_tx_summary: Option<bool>,
pub disable_console_log: Option<bool>,
pub show_event_logs: Option<bool>,
pub show_calls: Option<ShowCalls>,
pub show_outputs: Option<bool>,
pub show_storage_logs: Option<ShowStorageLogs>,
pub show_vm_details: Option<ShowVMDetails>,
pub show_gas_details: Option<ShowGasDetails>,
pub resolve_hashes: Option<bool>,
pub verbosity: u8,
pub l1_gas_price: Option<u64>,
pub l2_gas_price: Option<u64>,
pub l1_pubdata_price: Option<u64>,
pub price_scale_factor: Option<f64>,
pub limit_scale_factor: Option<f32>,
pub override_bytecodes_dir: Option<String>,
pub enforce_bytecode_compression: Option<bool>,
pub dev_system_contracts: Option<SystemContractsOptions>,
pub protocol_version: Option<ProtocolVersionId>,
pub emulate_evm: bool,
pub log: Option<LogLevel>,
pub log_file_path: Option<String>,
pub silent: Option<bool>,
pub cache: Option<CacheType>,
pub reset_cache: Option<bool>,
pub cache_dir: Option<String>,
pub accounts: u64,
pub balance: u64,
pub timestamp: Option<u64>,
pub init: Option<Genesis>,
pub state: Option<PathBuf>,
pub state_interval: Option<u64>,
pub dump_state: Option<PathBuf>,
pub preserve_historical_states: bool,
pub load_state: Option<PathBuf>,
pub mnemonic: Option<String>,
pub mnemonic_random: Option<usize>,
pub mnemonic_seed: Option<u64>,
pub derivation_path: Option<String>,
pub auto_impersonate: bool,
pub block_time: Option<Duration>,
pub no_mining: bool,
pub allow_origin: String,
pub no_cors: bool,
pub order: TransactionOrder,
pub spawn_l1: Option<u16>,
pub external_l1: Option<String>,
}
Fields§
§command: Option<Command>
§offline: bool
Run in offline mode (disables all network requests).
health_check_endpoint: bool
Enable health check endpoint. It will be available for GET requests at /health. The endpoint will return 200 OK if the node is healthy.
config_out: Option<String>
Writes output of anvil-zksync
as json to user-specified file.
port: Option<u16>
Port to listen on (default: 8011).
host: Vec<IpAddr>
The hosts the server will listen on.
chain_id: Option<u32>
Specify chain ID (default: 260).
debug_mode: bool
Enable default settings for debugging contracts.
show_node_config: Option<bool>
If true, prints node config on startup.
show_tx_summary: Option<bool>
If true, prints transactions and calls summary.
disable_console_log: Option<bool>
Disables printing of console.log
invocations to stdout if true.
show_event_logs: Option<bool>
If true, logs events.
show_calls: Option<ShowCalls>
Show call debug information.
show_outputs: Option<bool>
Show call output information.
show_storage_logs: Option<ShowStorageLogs>
Show storage log information.
show_vm_details: Option<ShowVMDetails>
Show VM details information.
show_gas_details: Option<ShowGasDetails>
Show gas details information.
resolve_hashes: Option<bool>
If true, the tool will try to resolve ABI and topic names for better readability. May decrease performance.
verbosity: u8
Increments verbosity each time it is used. (-vv, -vvv)
Example usage:
-vv
=> verbosity level 2 (includes user calls, user L1-L2 logs, and event calls)-vvv
=> level 3 (includes system calls, system L1-L2 logs, and system event calls)-vvvv
=> level 4 (includes system calls, system event calls, and precompiles)-vvvvv
=> level 5 (includes everything)
l1_gas_price: Option<u64>
Custom L1 gas price (in wei).
l2_gas_price: Option<u64>
Custom L2 gas price (in wei).
l1_pubdata_price: Option<u64>
Custom L1 pubdata price (in wei).
price_scale_factor: Option<f64>
Gas price estimation scale factor.
limit_scale_factor: Option<f32>
Gas limit estimation scale factor.
override_bytecodes_dir: Option<String>
Directory to override bytecodes.
enforce_bytecode_compression: Option<bool>
Enforces bytecode compression (default: false).
dev_system_contracts: Option<SystemContractsOptions>
Option for system contracts (default: built-in).
protocol_version: Option<ProtocolVersionId>
Protocol version to use for new blocks (default: 26). Also affects revision of built-in contracts that will get deployed (if applicable).
emulate_evm: bool
Enables EVM emulation. Requires local system contracts.
log: Option<LogLevel>
Log level (default: info).
log_file_path: Option<String>
Log file path (default: anvil-zksync.log).
silent: Option<bool>
If true, the tool will not print anything on startup.
cache: Option<CacheType>
Cache type (none, memory, or disk). Default: “disk”.
reset_cache: Option<bool>
Reset the local disk cache.
cache_dir: Option<String>
Cache directory location for disk cache (default: .cache).
accounts: u64
Number of dev accounts to generate and configure.
balance: u64
The balance of every dev account in Ether.
timestamp: Option<u64>
The timestamp of the genesis block.
init: Option<Genesis>
Initialize the genesis block with the given genesis.json
file.
state: Option<PathBuf>
This is an alias for both –load-state and –dump-state.
It initializes the chain with the state and block environment stored at the file, if it exists, and dumps the chain’s state on exit.
state_interval: Option<u64>
Interval in seconds at which the state and block environment is to be dumped to disk.
See –state and –dump-state
dump_state: Option<PathBuf>
Dump the state and block environment of chain on exit to the given file.
If the value is a directory, the state will be written to <VALUE>/state.json
.
preserve_historical_states: bool
Preserve historical state snapshots when dumping the state.
This will save the in-memory states of the chain at particular block hashes.
These historical states will be loaded into the memory when --load-state
/ --state
, and
aids in RPC calls beyond the block at which state was dumped.
load_state: Option<PathBuf>
Initialize the chain from a previously saved state snapshot.
mnemonic: Option<String>
BIP39 mnemonic phrase used for generating accounts.
Cannot be used if mnemonic_random
or mnemonic_seed
are used.
mnemonic_random: Option<usize>
Automatically generates a BIP39 mnemonic phrase and derives accounts from it.
Cannot be used with other mnemonic
options.
You can specify the number of words you want in the mnemonic.
[default: 12]
mnemonic_seed: Option<u64>
Generates a BIP39 mnemonic phrase from a given seed.
Cannot be used with other mnemonic
options.
CAREFUL: This is NOT SAFE and should only be used for testing.
Never use the private keys generated in production.
derivation_path: Option<String>
Sets the derivation path of the child key to be derived. [default: m/44’/60’/0’/0/]
auto_impersonate: bool
Enables automatic impersonation on startup. This allows any transaction sender to be simulated as different accounts, which is useful for testing contract behavior.
block_time: Option<Duration>
Block time in seconds for interval sealing. If unset, node seals a new block as soon as there is at least one transaction.
no_mining: bool
Disable auto and interval mining, and mine on demand instead.
allow_origin: String
The cors allow_origin
header
no_cors: bool
Disable CORS.
order: TransactionOrder
Transaction ordering in the mempool.
spawn_l1: Option<u16>
Enable L1 support and spawn L1 anvil node on the provided port (defaults to 8012).
external_l1: Option<String>
Enable L1 support and use provided address as L1 JSON-RPC endpoint.
Implementations§
Source§impl Cli
impl Cli
Sourcepub fn deprecated_config_option()
pub fn deprecated_config_option()
Checks for deprecated options and warns users.
Sourcepub fn into_test_node_config(
self,
) -> Result<TestNodeConfig, AnvilEnvironmentError>
pub fn into_test_node_config( self, ) -> Result<TestNodeConfig, AnvilEnvironmentError>
Converts the CLI arguments to a TestNodeConfig
.
Sourcepub fn into_telemetry_props(self) -> TelemetryProps
pub fn into_telemetry_props(self) -> TelemetryProps
Converts the CLI arguments to a TelemetryProps
to be used as event props.
fn account_generator(&self) -> AccountGenerator
Trait Implementations§
Source§impl Args for Cli
impl Args for Cli
Source§fn group_id() -> Option<Id>
fn group_id() -> Option<Id>
ArgGroup::id
][crate::ArgGroup::id] for this set of argumentsSource§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
Source§fn augment_args_for_update<'b>(__clap_app: Command) -> Command
fn augment_args_for_update<'b>(__clap_app: Command) -> Command
Command
] so it can instantiate self
via
[FromArgMatches::update_from_arg_matches_mut
] Read moreSource§impl FromArgMatches for Cli
impl FromArgMatches for Cli
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches
to self
.Source§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches
to self
.Source§impl Parser for Cli
impl Parser for Cli
§fn parse_from<I, T>(itr: I) -> Self
fn parse_from<I, T>(itr: I) -> Self
§fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
§fn update_from<I, T>(&mut self, itr: I)
fn update_from<I, T>(&mut self, itr: I)
§fn try_update_from<I, T>(&mut self, itr: I) -> Result<(), Error>
fn try_update_from<I, T>(&mut self, itr: I) -> Result<(), Error>
Auto Trait Implementations§
impl Freeze for Cli
impl RefUnwindSafe for Cli
impl Send for Cli
impl Sync for Cli
impl Unpin for Cli
impl UnwindSafe for Cli
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Conv for T
impl<T> Conv for T
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self
to use its Binary
implementation when Debug
-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self
to use its Display
implementation when
Debug
-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self
to use its LowerExp
implementation when
Debug
-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self
to use its LowerHex
implementation when
Debug
-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self
to use its Octal
implementation when Debug
-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self
to use its Pointer
implementation when
Debug
-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self
to use its UpperExp
implementation when
Debug
-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self
to use its UpperHex
implementation when
Debug
-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the foreground set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red()
and
green()
, which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg()
:
use yansi::{Paint, Color};
painted.fg(Color::White);
Set foreground color to white using white()
.
use yansi::Paint;
painted.white();
§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the background set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red()
and
on_green()
, which have the same functionality but
are pithier.
§Example
Set background color to red using fg()
:
use yansi::{Paint, Color};
painted.bg(Color::Red);
Set background color to red using on_red()
.
use yansi::Paint;
painted.on_red();
§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling [Attribute
] value
.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold()
and
underline()
, which have the same functionality
but are pithier.
§Example
Make text bold using attr()
:
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);
Make text bold using using bold()
.
use yansi::Paint;
painted.bold();
§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi
[Quirk
] value
.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask()
and
wrap()
, which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk()
:
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);
Enable wrapping using wrap()
.
use yansi::Paint;
painted.wrap();
§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.
fn clear(&self) -> Painted<&T>
resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the [Condition
] value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted
only when both stdout
and stderr
are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);
§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self
, then passes self.as_ref()
into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self
, then passes self.as_mut()
into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self
, then passes self.deref()
into the pipe function.§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B>
of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B>
of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R>
view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R>
view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target
of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target
of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap()
only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut()
only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow()
only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref()
only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut()
only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref()
only in debug builds, and is erased in release
builds.