Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cli): move anvilOptions to commandsConfig file #541

Merged
merged 1 commit into from
Oct 26, 2023
Merged
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
158 changes: 157 additions & 1 deletion packages/cli/src/commandsConfig.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,160 @@
import { anvilOptions } from './util/anvil';
const anvilOptions = [
{
flags: '-p --port <number>',
description: 'Port which the JSON-RPC server will be exposed.',
defaultValue: '8545',
},
{
flags: '-c --chain-id <number>',
description: 'The chain id to run against',
},
{
flags: '--compute-units-per-second [number]',
description: 'Sets the number of assumed available compute units per second for this fork provider.',
},
{
flags: '--fork-url [url]',
description: 'Fetch state over a remote endpoint instead of starting from an empty state.',
},
{
flags: '--fork-block-number [number]',
description: 'Fetch state from a specific block number over a remote endpoint.',
},
{
flags: '--fork-chain-id [number]',
description: 'Specify chain id to skip fetching it from remote endpoint.',
},
{
flags: '--fork-retry-backoff [number]',
description: 'Initial retry backoff on encountering errors.',
},
{
flags: '--no-rate-limit',
description: "Disables rate limiting for this node's provider.",
},
{
flags: '--no-storage-caching',
description: 'Explicitly disables the use of RPC caching. All storage slots are read entirely from the endpoint.',
},
{
flags: '--retries [number]',
description: 'Number of retry requests for spurious networks (timed out requests).',
},
{
flags: '--timeout [number]',
description: 'Timeout in ms for requests sent to remote JSON-RPC server in forking mode.',
},
{
flags: '--block-base-fee-per-gas [number]',
description: 'The base fee in a block.',
},
{
flags: '--code-size-limit [number]',
description: 'EIP-170: Contract code size limit in bytes. Useful to increase this because of tests.',
},
{
flags: '--disable-block-gas-limit',
description: 'Disable the call.gas_limit <= block.gas_limit constraint.',
},
{
flags: '--gas-limit [number]',
description: 'The block gas limit.',
},
{
flags: '--gas-price [number]',
description: 'The gas price.',
},
{
flags: '--accounts [number]',
description: 'Number of dev accounts to generate and configure.',
},
{
flags: '--balance [number]',
description: 'The balance of every dev account in Ether.',
},
{
flags: '--derivation-path [path]',
description: 'Sets the derivation path of the child key to be derived.',
},
{
flags: '--mnemonic [phrase]',
description: 'BIP39 mnemonic phrase used for generating accounts.',
},
{
flags: '--steps-tracing',
description: 'Enable steps tracing used for debug calls returning geth-style traces.',
},
{
flags: '--timestamp [number]',
description: 'The timestamp of the genesis block.',
},
{
flags: '--allow-origin [string]',
description: 'Set the Access-Control-Allow-Origin response header (CORS).',
},
{
flags: '--block-time [number]',
description: 'Block time in seconds for interval mining.',
},
{
flags: '--config-out [path]',
description: 'Writes output of anvil as json to user-specified file.',
},
{
flags: '--dump-state [path]',
description: 'Dump the state of chain on exit to the given file.',
},
{
flags: '--hardfork [type]',
description: 'The EVM hardfork to use.',
},
{
flags: '--host [string]',
description: 'The host the server will listen on.',
},
{
flags: '--init [path]',
description: 'Initialize the genesis block with the given genesis.json file.',
},
{
flags: '--ipc [path]',
description: 'Launch an ipc server at the given path or default path = /tmp/anvil.ipc.',
},
{
flags: '--load-state [path]',
description: 'Initialize the chain from a previously saved state snapshot.',
},
{
flags: '--no-cors',
description: 'Disable CORS.',
},
{
flags: '--no-mining',
description: 'Disable auto and interval mining, and mine on demand instead.',
},
{
flags: '--order [string]',
description: 'How transactions are sorted in the mempool.',
},
{
flags: '--prune-history [value]',
description:
"Don't keep full chain history. If a number argument is specified, at most this number of states is kept in memory.",
},
{
flags: '--state-interval [number]',
description: 'Interval in seconds at which the status is to be dumped to disk.',
},
{
flags: '--state [path]',
description:
"Alias for both loadState and dumpState. Initializes the chain with the state stored at the file, if it exists, and dumps the chain's state on exit.",
},
{
flags: '--transaction-block-keeper [number]',
description: 'Number of blocks with transactions to keep in memory.',
},
];

const commandsConfig = {
run: {
Expand Down
158 changes: 0 additions & 158 deletions packages/cli/src/util/anvil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,161 +254,3 @@ const anvilOptionKeys = [
export function pickAnvilOptions(obj: object) {
return _.pick(obj, anvilOptionKeys) as AnvilOptions;
}

export const anvilOptions = [
{
flags: '-p --port <number>',
description: 'Port which the JSON-RPC server will be exposed.',
defaultValue: '8545',
},
{
flags: '-c --chain-id <number>',
description: 'The chain id to run against',
},
{
flags: '--compute-units-per-second [number]',
description: 'Sets the number of assumed available compute units per second for this fork provider.',
},
{
flags: '--fork-url [url]',
description: 'Fetch state over a remote endpoint instead of starting from an empty state.',
},
{
flags: '--fork-block-number [number]',
description: 'Fetch state from a specific block number over a remote endpoint.',
},
{
flags: '--fork-chain-id [number]',
description: 'Specify chain id to skip fetching it from remote endpoint.',
},
{
flags: '--fork-retry-backoff [number]',
description: 'Initial retry backoff on encountering errors.',
},
{
flags: '--no-rate-limit',
description: "Disables rate limiting for this node's provider.",
},
{
flags: '--no-storage-caching',
description: 'Explicitly disables the use of RPC caching. All storage slots are read entirely from the endpoint.',
},
{
flags: '--retries [number]',
description: 'Number of retry requests for spurious networks (timed out requests).',
},
{
flags: '--timeout [number]',
description: 'Timeout in ms for requests sent to remote JSON-RPC server in forking mode.',
},
{
flags: '--block-base-fee-per-gas [number]',
description: 'The base fee in a block.',
},
{
flags: '--code-size-limit [number]',
description: 'EIP-170: Contract code size limit in bytes. Useful to increase this because of tests.',
},
{
flags: '--disable-block-gas-limit',
description: 'Disable the call.gas_limit <= block.gas_limit constraint.',
},
{
flags: '--gas-limit [number]',
description: 'The block gas limit.',
},
{
flags: '--gas-price [number]',
description: 'The gas price.',
},
{
flags: '--accounts [number]',
description: 'Number of dev accounts to generate and configure.',
},
{
flags: '--balance [number]',
description: 'The balance of every dev account in Ether.',
},
{
flags: '--derivation-path [path]',
description: 'Sets the derivation path of the child key to be derived.',
},
{
flags: '--mnemonic [phrase]',
description: 'BIP39 mnemonic phrase used for generating accounts.',
},
{
flags: '--steps-tracing',
description: 'Enable steps tracing used for debug calls returning geth-style traces.',
},
{
flags: '--timestamp [number]',
description: 'The timestamp of the genesis block.',
},
{
flags: '--allow-origin [string]',
description: 'Set the Access-Control-Allow-Origin response header (CORS).',
},
{
flags: '--block-time [number]',
description: 'Block time in seconds for interval mining.',
},
{
flags: '--config-out [path]',
description: 'Writes output of anvil as json to user-specified file.',
},
{
flags: '--dump-state [path]',
description: 'Dump the state of chain on exit to the given file.',
},
{
flags: '--hardfork [type]',
description: 'The EVM hardfork to use.',
},
{
flags: '--host [string]',
description: 'The host the server will listen on.',
},
{
flags: '--init [path]',
description: 'Initialize the genesis block with the given genesis.json file.',
},
{
flags: '--ipc [path]',
description: 'Launch an ipc server at the given path or default path = /tmp/anvil.ipc.',
},
{
flags: '--load-state [path]',
description: 'Initialize the chain from a previously saved state snapshot.',
},
{
flags: '--no-cors',
description: 'Disable CORS.',
},
{
flags: '--no-mining',
description: 'Disable auto and interval mining, and mine on demand instead.',
},
{
flags: '--order [string]',
description: 'How transactions are sorted in the mempool.',
},
{
flags: '--prune-history [value]',
description:
"Don't keep full chain history. If a number argument is specified, at most this number of states is kept in memory.",
},
{
flags: '--state-interval [number]',
description: 'Interval in seconds at which the status is to be dumped to disk.',
},
{
flags: '--state [path]',
description:
"Alias for both loadState and dumpState. Initializes the chain with the state stored at the file, if it exists, and dumps the chain's state on exit.",
},
{
flags: '--transaction-block-keeper [number]',
description: 'Number of blocks with transactions to keep in memory.',
},
];