flags.go 5.1 KB

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