github.1485827954.workers.dev/ethereum/go-ethereum@v1.14.3/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: "Configures the use of the JSON opcode tracer. This tracer emits traces to files as trace-<txIndex>-<txHash>.jsonl", 32 } 33 TraceTracerFlag = &cli.StringFlag{ 34 Name: "trace.tracer", 35 Usage: "Configures the use of a custom tracer, e.g native or js tracers. Examples are callTracer and 4byteTracer. These tracers emit results into files as trace-<txIndex>-<txHash>.json", 36 } 37 TraceTracerConfigFlag = &cli.StringFlag{ 38 Name: "trace.jsonconfig", 39 Usage: "The configurations for the custom tracer specified by --trace.tracer. If provided, must be in JSON format", 40 } 41 TraceEnableMemoryFlag = &cli.BoolFlag{ 42 Name: "trace.memory", 43 Usage: "Enable full memory dump in traces", 44 } 45 TraceDisableStackFlag = &cli.BoolFlag{ 46 Name: "trace.nostack", 47 Usage: "Disable stack output in traces", 48 } 49 TraceEnableReturnDataFlag = &cli.BoolFlag{ 50 Name: "trace.returndata", 51 Usage: "Enable return data output in traces", 52 } 53 TraceEnableCallFramesFlag = &cli.BoolFlag{ 54 Name: "trace.callframes", 55 Usage: "Enable call frames output in traces", 56 } 57 OutputBasedir = &cli.StringFlag{ 58 Name: "output.basedir", 59 Usage: "Specifies where output files are placed. Will be created if it does not exist.", 60 Value: "", 61 } 62 OutputBodyFlag = &cli.StringFlag{ 63 Name: "output.body", 64 Usage: "If set, the RLP of the transactions (block body) will be written to this file.", 65 Value: "", 66 } 67 OutputAllocFlag = &cli.StringFlag{ 68 Name: "output.alloc", 69 Usage: "Determines where to put the `alloc` of the post-state.\n" + 70 "\t`stdout` - into the stdout output\n" + 71 "\t`stderr` - into the stderr output\n" + 72 "\t<file> - into the file <file> ", 73 Value: "alloc.json", 74 } 75 OutputResultFlag = &cli.StringFlag{ 76 Name: "output.result", 77 Usage: "Determines where to put the `result` (stateroot, txroot etc) of the post-state.\n" + 78 "\t`stdout` - into the stdout output\n" + 79 "\t`stderr` - into the stderr output\n" + 80 "\t<file> - into the file <file> ", 81 Value: "result.json", 82 } 83 OutputBlockFlag = &cli.StringFlag{ 84 Name: "output.block", 85 Usage: "Determines where to put the `block` after building.\n" + 86 "\t`stdout` - into the stdout output\n" + 87 "\t`stderr` - into the stderr output\n" + 88 "\t<file> - into the file <file> ", 89 Value: "block.json", 90 } 91 InputAllocFlag = &cli.StringFlag{ 92 Name: "input.alloc", 93 Usage: "`stdin` or file name of where to find the prestate alloc to use.", 94 Value: "alloc.json", 95 } 96 InputEnvFlag = &cli.StringFlag{ 97 Name: "input.env", 98 Usage: "`stdin` or file name of where to find the prestate env to use.", 99 Value: "env.json", 100 } 101 InputTxsFlag = &cli.StringFlag{ 102 Name: "input.txs", 103 Usage: "`stdin` or file name of where to find the transactions to apply. " + 104 "If the file extension is '.rlp', then the data is interpreted as an RLP list of signed transactions." + 105 "The '.rlp' format is identical to the output.body format.", 106 Value: "txs.json", 107 } 108 InputHeaderFlag = &cli.StringFlag{ 109 Name: "input.header", 110 Usage: "`stdin` or file name of where to find the block header to use.", 111 Value: "header.json", 112 } 113 InputOmmersFlag = &cli.StringFlag{ 114 Name: "input.ommers", 115 Usage: "`stdin` or file name of where to find the list of ommer header RLPs to use.", 116 } 117 InputWithdrawalsFlag = &cli.StringFlag{ 118 Name: "input.withdrawals", 119 Usage: "`stdin` or file name of where to find the list of withdrawals to use.", 120 } 121 InputTxsRlpFlag = &cli.StringFlag{ 122 Name: "input.txs", 123 Usage: "`stdin` or file name of where to find the transactions list in RLP form.", 124 Value: "txs.rlp", 125 } 126 SealCliqueFlag = &cli.StringFlag{ 127 Name: "seal.clique", 128 Usage: "Seal block with Clique. `stdin` or file name of where to find the Clique sealing data.", 129 } 130 RewardFlag = &cli.Int64Flag{ 131 Name: "state.reward", 132 Usage: "Mining reward. Set to -1 to disable", 133 Value: 0, 134 } 135 ChainIDFlag = &cli.Int64Flag{ 136 Name: "state.chainid", 137 Usage: "ChainID to use", 138 Value: 1, 139 } 140 ForknameFlag = &cli.StringFlag{ 141 Name: "state.fork", 142 Usage: fmt.Sprintf("Name of ruleset to use."+ 143 "\n\tAvailable forknames:"+ 144 "\n\t %v"+ 145 "\n\tAvailable extra eips:"+ 146 "\n\t %v"+ 147 "\n\tSyntax <forkname>(+ExtraEip)", 148 strings.Join(tests.AvailableForks(), "\n\t "), 149 strings.Join(vm.ActivateableEips(), ", ")), 150 Value: "GrayGlacier", 151 } 152 VerbosityFlag = &cli.IntFlag{ 153 Name: "verbosity", 154 Usage: "sets the verbosity level", 155 Value: 3, 156 } 157 )