flags.go 3.0 KB

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