github.com/codingfuture/orig-energi3@v0.8.4/cmd/swarm/flags.go (about)

     1  // Copyright 2018 The Energi Core Authors
     2  // Copyright 2018 The go-ethereum Authors
     3  // This file is part of Energi Core.
     4  //
     5  // Energi Core is free software: you can redistribute it and/or modify
     6  // it under the terms of the GNU General Public License as published by
     7  // the Free Software Foundation, either version 3 of the License, or
     8  // (at your option) any later version.
     9  //
    10  // Energi Core is distributed in the hope that it will be useful,
    11  // but WITHOUT ANY WARRANTY; without even the implied warranty of
    12  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    13  // GNU General Public License for more details.
    14  //
    15  // You should have received a copy of the GNU General Public License
    16  // along with Energi Core. If not, see <http://www.gnu.org/licenses/>.
    17  
    18  // Command feed allows the user to create and update signed Swarm feeds
    19  package main
    20  
    21  import cli "gopkg.in/urfave/cli.v1"
    22  
    23  var (
    24  	ChequebookAddrFlag = cli.StringFlag{
    25  		Name:   "chequebook",
    26  		Usage:  "chequebook contract address",
    27  		EnvVar: SWARM_ENV_CHEQUEBOOK_ADDR,
    28  	}
    29  	SwarmAccountFlag = cli.StringFlag{
    30  		Name:   "bzzaccount",
    31  		Usage:  "Swarm account key file",
    32  		EnvVar: SWARM_ENV_ACCOUNT,
    33  	}
    34  	SwarmListenAddrFlag = cli.StringFlag{
    35  		Name:   "httpaddr",
    36  		Usage:  "Swarm HTTP API listening interface",
    37  		EnvVar: SWARM_ENV_LISTEN_ADDR,
    38  	}
    39  	SwarmPortFlag = cli.StringFlag{
    40  		Name:   "bzzport",
    41  		Usage:  "Swarm local http api port",
    42  		EnvVar: SWARM_ENV_PORT,
    43  	}
    44  	SwarmNetworkIdFlag = cli.IntFlag{
    45  		Name:   "bzznetworkid",
    46  		Usage:  "Network identifier (integer, default 3=swarm testnet)",
    47  		EnvVar: SWARM_ENV_NETWORK_ID,
    48  	}
    49  	SwarmSwapEnabledFlag = cli.BoolFlag{
    50  		Name:   "swap",
    51  		Usage:  "Swarm SWAP enabled (default false)",
    52  		EnvVar: SWARM_ENV_SWAP_ENABLE,
    53  	}
    54  	SwarmSwapAPIFlag = cli.StringFlag{
    55  		Name:   "swap-api",
    56  		Usage:  "URL of the Energi API provider to use to settle SWAP payments",
    57  		EnvVar: SWARM_ENV_SWAP_API,
    58  	}
    59  	SwarmSyncDisabledFlag = cli.BoolTFlag{
    60  		Name:   "nosync",
    61  		Usage:  "Disable swarm syncing",
    62  		EnvVar: SWARM_ENV_SYNC_DISABLE,
    63  	}
    64  	SwarmSyncUpdateDelay = cli.DurationFlag{
    65  		Name:   "sync-update-delay",
    66  		Usage:  "Duration for sync subscriptions update after no new peers are added (default 15s)",
    67  		EnvVar: SWARM_ENV_SYNC_UPDATE_DELAY,
    68  	}
    69  	SwarmMaxStreamPeerServersFlag = cli.IntFlag{
    70  		Name:   "max-stream-peer-servers",
    71  		Usage:  "Limit of Stream peer servers, 0 denotes unlimited",
    72  		EnvVar: SWARM_ENV_MAX_STREAM_PEER_SERVERS,
    73  		Value:  10000, // A very large default value is possible as stream servers have very small memory footprint
    74  	}
    75  	SwarmLightNodeEnabled = cli.BoolFlag{
    76  		Name:   "lightnode",
    77  		Usage:  "Enable Swarm LightNode (default false)",
    78  		EnvVar: SWARM_ENV_LIGHT_NODE_ENABLE,
    79  	}
    80  	SwarmDeliverySkipCheckFlag = cli.BoolFlag{
    81  		Name:   "delivery-skip-check",
    82  		Usage:  "Skip chunk delivery check (default false)",
    83  		EnvVar: SWARM_ENV_DELIVERY_SKIP_CHECK,
    84  	}
    85  	EnsAPIFlag = cli.StringSliceFlag{
    86  		Name:   "ens-api",
    87  		Usage:  "ENS API endpoint for a TLD and with contract address, can be repeated, format [tld:][contract-addr@]url",
    88  		EnvVar: SWARM_ENV_ENS_API,
    89  	}
    90  	SwarmApiFlag = cli.StringFlag{
    91  		Name:  "bzzapi",
    92  		Usage: "Specifies the Swarm HTTP endpoint to connect to",
    93  		Value: "http://127.0.0.1:8500",
    94  	}
    95  	SwarmRecursiveFlag = cli.BoolFlag{
    96  		Name:  "recursive",
    97  		Usage: "Upload directories recursively",
    98  	}
    99  	SwarmWantManifestFlag = cli.BoolTFlag{
   100  		Name:  "manifest",
   101  		Usage: "Automatic manifest upload (default true)",
   102  	}
   103  	SwarmUploadDefaultPath = cli.StringFlag{
   104  		Name:  "defaultpath",
   105  		Usage: "path to file served for empty url path (none)",
   106  	}
   107  	SwarmAccessGrantKeyFlag = cli.StringFlag{
   108  		Name:  "grant-key",
   109  		Usage: "grants a given public key access to an ACT",
   110  	}
   111  	SwarmAccessGrantKeysFlag = cli.StringFlag{
   112  		Name:  "grant-keys",
   113  		Usage: "grants a given list of public keys in the following file (separated by line breaks) access to an ACT",
   114  	}
   115  	SwarmUpFromStdinFlag = cli.BoolFlag{
   116  		Name:  "stdin",
   117  		Usage: "reads data to be uploaded from stdin",
   118  	}
   119  	SwarmUploadMimeType = cli.StringFlag{
   120  		Name:  "mime",
   121  		Usage: "Manually specify MIME type",
   122  	}
   123  	SwarmEncryptedFlag = cli.BoolFlag{
   124  		Name:  "encrypt",
   125  		Usage: "use encrypted upload",
   126  	}
   127  	SwarmAccessPasswordFlag = cli.StringFlag{
   128  		Name:   "password",
   129  		Usage:  "Password",
   130  		EnvVar: SWARM_ACCESS_PASSWORD,
   131  	}
   132  	SwarmDryRunFlag = cli.BoolFlag{
   133  		Name:  "dry-run",
   134  		Usage: "dry-run",
   135  	}
   136  	CorsStringFlag = cli.StringFlag{
   137  		Name:   "corsdomain",
   138  		Usage:  "Domain on which to send Access-Control-Allow-Origin header (multiple domains can be supplied separated by a ',')",
   139  		EnvVar: SWARM_ENV_CORS,
   140  	}
   141  	SwarmStorePath = cli.StringFlag{
   142  		Name:   "store.path",
   143  		Usage:  "Path to leveldb chunk DB (default <$GETH_ENV_DIR>/swarm/bzz-<$BZZ_KEY>/chunks)",
   144  		EnvVar: SWARM_ENV_STORE_PATH,
   145  	}
   146  	SwarmStoreCapacity = cli.Uint64Flag{
   147  		Name:   "store.size",
   148  		Usage:  "Number of chunks (5M is roughly 20-25GB) (default 5000000)",
   149  		EnvVar: SWARM_ENV_STORE_CAPACITY,
   150  	}
   151  	SwarmStoreCacheCapacity = cli.UintFlag{
   152  		Name:   "store.cache.size",
   153  		Usage:  "Number of recent chunks cached in memory (default 5000)",
   154  		EnvVar: SWARM_ENV_STORE_CACHE_CAPACITY,
   155  	}
   156  	SwarmCompressedFlag = cli.BoolFlag{
   157  		Name:  "compressed",
   158  		Usage: "Prints encryption keys in compressed form",
   159  	}
   160  	SwarmBootnodeModeFlag = cli.BoolFlag{
   161  		Name:  "bootnode-mode",
   162  		Usage: "Run Swarm in Bootnode mode",
   163  	}
   164  	SwarmFeedNameFlag = cli.StringFlag{
   165  		Name:  "name",
   166  		Usage: "User-defined name for the new feed, limited to 32 characters. If combined with topic, it will refer to a subtopic with this name",
   167  	}
   168  	SwarmFeedTopicFlag = cli.StringFlag{
   169  		Name:  "topic",
   170  		Usage: "User-defined topic this feed is tracking, hex encoded. Limited to 64 hexadecimal characters",
   171  	}
   172  	SwarmFeedManifestFlag = cli.StringFlag{
   173  		Name:  "manifest",
   174  		Usage: "Refers to the feed through a manifest",
   175  	}
   176  	SwarmFeedUserFlag = cli.StringFlag{
   177  		Name:  "user",
   178  		Usage: "Indicates the user who updates the feed",
   179  	}
   180  	SwarmGlobalStoreAPIFlag = cli.StringFlag{
   181  		Name:   "globalstore-api",
   182  		Usage:  "URL of the Global Store API provider (only for testing)",
   183  		EnvVar: SWARM_GLOBALSTORE_API,
   184  	}
   185  )