flags.go 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. // Copyright 2020 The go-ethereum Authors
  2. // This file is part of the go-ethereum library.
  3. //
  4. // The go-ethereum library is free software: you can redistribute it and/or modify
  5. // it under the terms of the GNU Lesser 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. // The go-ethereum library 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 Lesser General Public License for more details.
  13. //
  14. // You should have received a copy of the GNU Lesser General Public License
  15. // along with the go-ethereum library. 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. "gopkg.in/urfave/cli.v1"
  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. Usage: "Disable full memory dump in traces",
  32. }
  33. TraceDisableStackFlag = cli.BoolFlag{
  34. Name: "trace.nostack",
  35. Usage: "Disable stack output in traces",
  36. }
  37. TraceDisableReturnDataFlag = cli.BoolFlag{
  38. Name: "trace.noreturndata",
  39. Usage: "Disable return data output in traces",
  40. }
  41. OutputBasedir = cli.StringFlag{
  42. Name: "output.basedir",
  43. Usage: "Specifies where output files are placed. Will be created if it does not exist.",
  44. Value: "",
  45. }
  46. OutputBodyFlag = cli.StringFlag{
  47. Name: "output.body",
  48. Usage: "If set, the RLP of the transactions (block body) will be written to this file.",
  49. Value: "",
  50. }
  51. OutputAllocFlag = cli.StringFlag{
  52. Name: "output.alloc",
  53. Usage: "Determines where to put the `alloc` of the post-state.\n" +
  54. "\t`stdout` - into the stdout output\n" +
  55. "\t`stderr` - into the stderr output\n" +
  56. "\t<file> - into the file <file> ",
  57. Value: "alloc.json",
  58. }
  59. OutputResultFlag = cli.StringFlag{
  60. Name: "output.result",
  61. Usage: "Determines where to put the `result` (stateroot, txroot etc) of the post-state.\n" +
  62. "\t`stdout` - into the stdout output\n" +
  63. "\t`stderr` - into the stderr output\n" +
  64. "\t<file> - into the file <file> ",
  65. Value: "result.json",
  66. }
  67. InputAllocFlag = cli.StringFlag{
  68. Name: "input.alloc",
  69. Usage: "`stdin` or file name of where to find the prestate alloc to use.",
  70. Value: "alloc.json",
  71. }
  72. InputEnvFlag = cli.StringFlag{
  73. Name: "input.env",
  74. Usage: "`stdin` or file name of where to find the prestate env to use.",
  75. Value: "env.json",
  76. }
  77. InputTxsFlag = cli.StringFlag{
  78. Name: "input.txs",
  79. Usage: "`stdin` or file name of where to find the transactions to apply.",
  80. Value: "txs.json",
  81. }
  82. RewardFlag = cli.Int64Flag{
  83. Name: "state.reward",
  84. Usage: "Mining reward. Set to -1 to disable",
  85. Value: 0,
  86. }
  87. ChainIDFlag = cli.Int64Flag{
  88. Name: "state.chainid",
  89. Usage: "ChainID to use",
  90. Value: 1,
  91. }
  92. ForknameFlag = cli.StringFlag{
  93. Name: "state.fork",
  94. Usage: fmt.Sprintf("Name of ruleset to use."+
  95. "\n\tAvailable forknames:"+
  96. "\n\t %v"+
  97. "\n\tAvailable extra eips:"+
  98. "\n\t %v"+
  99. "\n\tSyntax <forkname>(+ExtraEip)",
  100. strings.Join(tests.AvailableForks(), "\n\t "),
  101. strings.Join(vm.ActivateableEips(), ", ")),
  102. Value: "Istanbul",
  103. }
  104. VerbosityFlag = cli.IntFlag{
  105. Name: "verbosity",
  106. Usage: "sets the verbosity level",
  107. Value: 3,
  108. }
  109. )