github.com/jimmyx0x/go-ethereum@v1.10.28/cmd/evm/internal/t8ntool/flags.go (about)

     1  // Copyright 2020 The go-ethereum Authors
     2  // This file is part of go-ethereum.
     3  //
     4  // go-ethereum is free software: you can redistribute it and/or modify
     5  // it under the terms of the GNU General Public License as published by
     6  // the Free Software Foundation, either version 3 of the License, or
     7  // (at your option) any later version.
     8  //
     9  // go-ethereum is distributed in the hope that it will be useful,
    10  // but WITHOUT ANY WARRANTY; without even the implied warranty of
    11  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    12  // GNU General Public License for more details.
    13  //
    14  // You should have received a copy of the GNU General Public License
    15  // along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
    16  
    17  package t8ntool
    18  
    19  import (
    20  	"fmt"
    21  	"strings"
    22  
    23  	"github.com/ethereum/go-ethereum/core/vm"
    24  	"github.com/ethereum/go-ethereum/tests"
    25  	"github.com/urfave/cli/v2"
    26  )
    27  
    28  var (
    29  	TraceFlag = &cli.BoolFlag{
    30  		Name:  "trace",
    31  		Usage: "Output full trace logs to files <txhash>.jsonl",
    32  	}
    33  	TraceDisableMemoryFlag = &cli.BoolFlag{
    34  		Name:  "trace.nomemory",
    35  		Value: true,
    36  		Usage: "Disable full memory dump in traces (deprecated)",
    37  	}
    38  	TraceEnableMemoryFlag = &cli.BoolFlag{
    39  		Name:  "trace.memory",
    40  		Usage: "Enable full memory dump in traces",
    41  	}
    42  	TraceDisableStackFlag = &cli.BoolFlag{
    43  		Name:  "trace.nostack",
    44  		Usage: "Disable stack output in traces",
    45  	}
    46  	TraceDisableReturnDataFlag = &cli.BoolFlag{
    47  		Name:  "trace.noreturndata",
    48  		Value: true,
    49  		Usage: "Disable return data output in traces (deprecated)",
    50  	}
    51  	TraceEnableReturnDataFlag = &cli.BoolFlag{
    52  		Name:  "trace.returndata",
    53  		Usage: "Enable return data output in traces",
    54  	}
    55  	OutputBasedir = &cli.StringFlag{
    56  		Name:  "output.basedir",
    57  		Usage: "Specifies where output files are placed. Will be created if it does not exist.",
    58  		Value: "",
    59  	}
    60  	OutputBodyFlag = &cli.StringFlag{
    61  		Name:  "output.body",
    62  		Usage: "If set, the RLP of the transactions (block body) will be written to this file.",
    63  		Value: "",
    64  	}
    65  	OutputAllocFlag = &cli.StringFlag{
    66  		Name: "output.alloc",
    67  		Usage: "Determines where to put the `alloc` of the post-state.\n" +
    68  			"\t`stdout` - into the stdout output\n" +
    69  			"\t`stderr` - into the stderr output\n" +
    70  			"\t<file> - into the file <file> ",
    71  		Value: "alloc.json",
    72  	}
    73  	OutputResultFlag = &cli.StringFlag{
    74  		Name: "output.result",
    75  		Usage: "Determines where to put the `result` (stateroot, txroot etc) of the post-state.\n" +
    76  			"\t`stdout` - into the stdout output\n" +
    77  			"\t`stderr` - into the stderr output\n" +
    78  			"\t<file> - into the file <file> ",
    79  		Value: "result.json",
    80  	}
    81  	OutputBlockFlag = &cli.StringFlag{
    82  		Name: "output.block",
    83  		Usage: "Determines where to put the `block` after building.\n" +
    84  			"\t`stdout` - into the stdout output\n" +
    85  			"\t`stderr` - into the stderr output\n" +
    86  			"\t<file> - into the file <file> ",
    87  		Value: "block.json",
    88  	}
    89  	InputAllocFlag = &cli.StringFlag{
    90  		Name:  "input.alloc",
    91  		Usage: "`stdin` or file name of where to find the prestate alloc to use.",
    92  		Value: "alloc.json",
    93  	}
    94  	InputEnvFlag = &cli.StringFlag{
    95  		Name:  "input.env",
    96  		Usage: "`stdin` or file name of where to find the prestate env to use.",
    97  		Value: "env.json",
    98  	}
    99  	InputTxsFlag = &cli.StringFlag{
   100  		Name: "input.txs",
   101  		Usage: "`stdin` or file name of where to find the transactions to apply. " +
   102  			"If the file extension is '.rlp', then the data is interpreted as an RLP list of signed transactions." +
   103  			"The '.rlp' format is identical to the output.body format.",
   104  		Value: "txs.json",
   105  	}
   106  	InputHeaderFlag = &cli.StringFlag{
   107  		Name:  "input.header",
   108  		Usage: "`stdin` or file name of where to find the block header to use.",
   109  		Value: "header.json",
   110  	}
   111  	InputOmmersFlag = &cli.StringFlag{
   112  		Name:  "input.ommers",
   113  		Usage: "`stdin` or file name of where to find the list of ommer header RLPs to use.",
   114  	}
   115  	InputTxsRlpFlag = &cli.StringFlag{
   116  		Name:  "input.txs",
   117  		Usage: "`stdin` or file name of where to find the transactions list in RLP form.",
   118  		Value: "txs.rlp",
   119  	}
   120  	SealCliqueFlag = &cli.StringFlag{
   121  		Name:  "seal.clique",
   122  		Usage: "Seal block with Clique. `stdin` or file name of where to find the Clique sealing data.",
   123  	}
   124  	SealEthashFlag = &cli.BoolFlag{
   125  		Name:  "seal.ethash",
   126  		Usage: "Seal block with ethash.",
   127  	}
   128  	SealEthashDirFlag = &cli.StringFlag{
   129  		Name:  "seal.ethash.dir",
   130  		Usage: "Path to ethash DAG. If none exists, a new DAG will be generated.",
   131  	}
   132  	SealEthashModeFlag = &cli.StringFlag{
   133  		Name:  "seal.ethash.mode",
   134  		Usage: "Defines the type and amount of PoW verification an ethash engine makes.",
   135  		Value: "normal",
   136  	}
   137  	RewardFlag = &cli.Int64Flag{
   138  		Name:  "state.reward",
   139  		Usage: "Mining reward. Set to -1 to disable",
   140  		Value: 0,
   141  	}
   142  	ChainIDFlag = &cli.Int64Flag{
   143  		Name:  "state.chainid",
   144  		Usage: "ChainID to use",
   145  		Value: 1,
   146  	}
   147  	ForknameFlag = &cli.StringFlag{
   148  		Name: "state.fork",
   149  		Usage: fmt.Sprintf("Name of ruleset to use."+
   150  			"\n\tAvailable forknames:"+
   151  			"\n\t    %v"+
   152  			"\n\tAvailable extra eips:"+
   153  			"\n\t    %v"+
   154  			"\n\tSyntax <forkname>(+ExtraEip)",
   155  			strings.Join(tests.AvailableForks(), "\n\t    "),
   156  			strings.Join(vm.ActivateableEips(), ", ")),
   157  		Value: "GrayGlacier",
   158  	}
   159  	VerbosityFlag = &cli.IntFlag{
   160  		Name:  "verbosity",
   161  		Usage: "sets the verbosity level",
   162  		Value: 3,
   163  	}
   164  )