flags.go 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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. OutputAllocFlag = cli.StringFlag{
  42. Name: "output.alloc",
  43. Usage: "Determines where to put the `alloc` of the post-state.\n" +
  44. "\t`stdout` - into the stdout output\n" +
  45. "\t`stderr` - into the stderr output\n" +
  46. "\t<file> - into the file <file> ",
  47. Value: "alloc.json",
  48. }
  49. OutputResultFlag = cli.StringFlag{
  50. Name: "output.result",
  51. Usage: "Determines where to put the `result` (stateroot, txroot etc) of the post-state.\n" +
  52. "\t`stdout` - into the stdout output\n" +
  53. "\t`stderr` - into the stderr output\n" +
  54. "\t<file> - into the file <file> ",
  55. Value: "result.json",
  56. }
  57. InputAllocFlag = cli.StringFlag{
  58. Name: "input.alloc",
  59. Usage: "`stdin` or file name of where to find the prestate alloc to use.",
  60. Value: "alloc.json",
  61. }
  62. InputEnvFlag = cli.StringFlag{
  63. Name: "input.env",
  64. Usage: "`stdin` or file name of where to find the prestate env to use.",
  65. Value: "env.json",
  66. }
  67. InputTxsFlag = cli.StringFlag{
  68. Name: "input.txs",
  69. Usage: "`stdin` or file name of where to find the transactions to apply.",
  70. Value: "txs.json",
  71. }
  72. RewardFlag = cli.Int64Flag{
  73. Name: "state.reward",
  74. Usage: "Mining reward. Set to -1 to disable",
  75. Value: 0,
  76. }
  77. ChainIDFlag = cli.Int64Flag{
  78. Name: "state.chainid",
  79. Usage: "ChainID to use",
  80. Value: 1,
  81. }
  82. ForknameFlag = cli.StringFlag{
  83. Name: "state.fork",
  84. Usage: fmt.Sprintf("Name of ruleset to use."+
  85. "\n\tAvailable forknames:"+
  86. "\n\t %v"+
  87. "\n\tAvailable extra eips:"+
  88. "\n\t %v"+
  89. "\n\tSyntax <forkname>(+ExtraEip)",
  90. strings.Join(tests.AvailableForks(), "\n\t "),
  91. strings.Join(vm.ActivateableEips(), ", ")),
  92. Value: "Istanbul",
  93. }
  94. VerbosityFlag = cli.IntFlag{
  95. Name: "verbosity",
  96. Usage: "sets the verbosity level",
  97. Value: 3,
  98. }
  99. )