flags.go 6.1 KB

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