github.com/DxChainNetwork/dxc@v0.8.1-0.20220824085222-1162e304b6e7/cmd/evm/internal/t8ntool/flags.go (about)

     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  
    17  package t8ntool
    18  
    19  import (
    20  	"fmt"
    21  	"strings"
    22  
    23  	"github.com/DxChainNetwork/dxc/core/vm"
    24  	"github.com/DxChainNetwork/dxc/tests"
    25  	"gopkg.in/urfave/cli.v1"
    26  )
    27  
    28  var (
    29  	TraceFlag = cli.BoolFlag{
    30  		Name:  "trace",
    31  		Usage: "Output full trace logs to files <txhash>.jsonl",
    32  	}
    33  	TraceDisableMemoryFlag = cli.BoolFlag{
    34  		Name:  "trace.nomemory",
    35  		Usage: "Disable full memory dump in traces",
    36  	}
    37  	TraceDisableStackFlag = cli.BoolFlag{
    38  		Name:  "trace.nostack",
    39  		Usage: "Disable stack output in traces",
    40  	}
    41  	TraceDisableReturnDataFlag = cli.BoolFlag{
    42  		Name:  "trace.noreturndata",
    43  		Usage: "Disable return data output in traces",
    44  	}
    45  	OutputBasedir = cli.StringFlag{
    46  		Name:  "output.basedir",
    47  		Usage: "Specifies where output files are placed. Will be created if it does not exist.",
    48  		Value: "",
    49  	}
    50  	OutputBodyFlag = cli.StringFlag{
    51  		Name:  "output.body",
    52  		Usage: "If set, the RLP of the transactions (block body) will be written to this file.",
    53  		Value: "",
    54  	}
    55  	OutputAllocFlag = cli.StringFlag{
    56  		Name: "output.alloc",
    57  		Usage: "Determines where to put the `alloc` of the post-state.\n" +
    58  			"\t`stdout` - into the stdout output\n" +
    59  			"\t`stderr` - into the stderr output\n" +
    60  			"\t<file> - into the file <file> ",
    61  		Value: "alloc.json",
    62  	}
    63  	OutputResultFlag = cli.StringFlag{
    64  		Name: "output.result",
    65  		Usage: "Determines where to put the `result` (stateroot, txroot etc) of the post-state.\n" +
    66  			"\t`stdout` - into the stdout output\n" +
    67  			"\t`stderr` - into the stderr output\n" +
    68  			"\t<file> - into the file <file> ",
    69  		Value: "result.json",
    70  	}
    71  	InputAllocFlag = cli.StringFlag{
    72  		Name:  "input.alloc",
    73  		Usage: "`stdin` or file name of where to find the prestate alloc to use.",
    74  		Value: "alloc.json",
    75  	}
    76  	InputEnvFlag = cli.StringFlag{
    77  		Name:  "input.env",
    78  		Usage: "`stdin` or file name of where to find the prestate env to use.",
    79  		Value: "env.json",
    80  	}
    81  	InputTxsFlag = cli.StringFlag{
    82  		Name: "input.txs",
    83  		Usage: "`stdin` or file name of where to find the transactions to apply. " +
    84  			"If the file prefix is '.rlp', then the data is interpreted as an RLP list of signed transactions." +
    85  			"The '.rlp' format is identical to the output.body format.",
    86  		Value: "txs.json",
    87  	}
    88  	RewardFlag = cli.Int64Flag{
    89  		Name:  "state.reward",
    90  		Usage: "Mining reward. Set to -1 to disable",
    91  		Value: 0,
    92  	}
    93  	ChainIDFlag = cli.Int64Flag{
    94  		Name:  "state.chainid",
    95  		Usage: "ChainID to use",
    96  		Value: 1,
    97  	}
    98  	ForknameFlag = cli.StringFlag{
    99  		Name: "state.fork",
   100  		Usage: fmt.Sprintf("Name of ruleset to use."+
   101  			"\n\tAvailable forknames:"+
   102  			"\n\t    %v"+
   103  			"\n\tAvailable extra eips:"+
   104  			"\n\t    %v"+
   105  			"\n\tSyntax <forkname>(+ExtraEip)",
   106  			strings.Join(tests.AvailableForks(), "\n\t    "),
   107  			strings.Join(vm.ActivateableEips(), ", ")),
   108  		Value: "Istanbul",
   109  	}
   110  	VerbosityFlag = cli.IntFlag{
   111  		Name:  "verbosity",
   112  		Usage: "sets the verbosity level",
   113  		Value: 3,
   114  	}
   115  )