2018-10-12 07:51:38 -05:00
|
|
|
// Copyright 2018 The go-ethereum Authors
|
|
|
|
// This file is part of go-ethereum.
|
|
|
|
//
|
|
|
|
// go-ethereum is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// go-ethereum is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
// Command feed allows the user to create and update signed Swarm feeds
|
|
|
|
package main
|
|
|
|
|
|
|
|
import cli "gopkg.in/urfave/cli.v1"
|
|
|
|
|
|
|
|
var (
|
|
|
|
ChequebookAddrFlag = cli.StringFlag{
|
|
|
|
Name: "chequebook",
|
|
|
|
Usage: "chequebook contract address",
|
2019-02-24 05:39:23 -06:00
|
|
|
EnvVar: SwarmEnvChequebookAddr,
|
2018-10-12 07:51:38 -05:00
|
|
|
}
|
|
|
|
SwarmAccountFlag = cli.StringFlag{
|
|
|
|
Name: "bzzaccount",
|
|
|
|
Usage: "Swarm account key file",
|
2019-02-24 05:39:23 -06:00
|
|
|
EnvVar: SwarmEnvAccount,
|
2018-10-12 07:51:38 -05:00
|
|
|
}
|
|
|
|
SwarmListenAddrFlag = cli.StringFlag{
|
|
|
|
Name: "httpaddr",
|
|
|
|
Usage: "Swarm HTTP API listening interface",
|
2019-02-24 05:39:23 -06:00
|
|
|
EnvVar: SwarmEnvListenAddr,
|
2018-10-12 07:51:38 -05:00
|
|
|
}
|
|
|
|
SwarmPortFlag = cli.StringFlag{
|
|
|
|
Name: "bzzport",
|
|
|
|
Usage: "Swarm local http api port",
|
2019-02-24 05:39:23 -06:00
|
|
|
EnvVar: SwarmEnvPort,
|
2018-10-12 07:51:38 -05:00
|
|
|
}
|
|
|
|
SwarmNetworkIdFlag = cli.IntFlag{
|
|
|
|
Name: "bzznetworkid",
|
|
|
|
Usage: "Network identifier (integer, default 3=swarm testnet)",
|
2019-02-24 05:39:23 -06:00
|
|
|
EnvVar: SwarmEnvNetworkID,
|
2018-10-12 07:51:38 -05:00
|
|
|
}
|
|
|
|
SwarmSwapEnabledFlag = cli.BoolFlag{
|
|
|
|
Name: "swap",
|
|
|
|
Usage: "Swarm SWAP enabled (default false)",
|
2019-02-24 05:39:23 -06:00
|
|
|
EnvVar: SwarmEnvSwapEnable,
|
2018-10-12 07:51:38 -05:00
|
|
|
}
|
|
|
|
SwarmSwapAPIFlag = cli.StringFlag{
|
|
|
|
Name: "swap-api",
|
|
|
|
Usage: "URL of the Ethereum API provider to use to settle SWAP payments",
|
2019-02-24 05:39:23 -06:00
|
|
|
EnvVar: SwarmEnvSwapAPI,
|
2018-10-12 07:51:38 -05:00
|
|
|
}
|
|
|
|
SwarmSyncDisabledFlag = cli.BoolTFlag{
|
|
|
|
Name: "nosync",
|
|
|
|
Usage: "Disable swarm syncing",
|
2019-02-24 05:39:23 -06:00
|
|
|
EnvVar: SwarmEnvSyncDisable,
|
2018-10-12 07:51:38 -05:00
|
|
|
}
|
|
|
|
SwarmSyncUpdateDelay = cli.DurationFlag{
|
|
|
|
Name: "sync-update-delay",
|
|
|
|
Usage: "Duration for sync subscriptions update after no new peers are added (default 15s)",
|
2019-02-24 05:39:23 -06:00
|
|
|
EnvVar: SwarmEnvSyncUpdateDelay,
|
2018-10-12 07:51:38 -05:00
|
|
|
}
|
|
|
|
SwarmMaxStreamPeerServersFlag = cli.IntFlag{
|
|
|
|
Name: "max-stream-peer-servers",
|
|
|
|
Usage: "Limit of Stream peer servers, 0 denotes unlimited",
|
2019-02-24 05:39:23 -06:00
|
|
|
EnvVar: SwarmEnvMaxStreamPeerServers,
|
2018-10-12 07:51:38 -05:00
|
|
|
Value: 10000, // A very large default value is possible as stream servers have very small memory footprint
|
|
|
|
}
|
|
|
|
SwarmLightNodeEnabled = cli.BoolFlag{
|
|
|
|
Name: "lightnode",
|
|
|
|
Usage: "Enable Swarm LightNode (default false)",
|
2019-02-24 05:39:23 -06:00
|
|
|
EnvVar: SwarmEnvLightNodeEnable,
|
2018-10-12 07:51:38 -05:00
|
|
|
}
|
|
|
|
SwarmDeliverySkipCheckFlag = cli.BoolFlag{
|
|
|
|
Name: "delivery-skip-check",
|
|
|
|
Usage: "Skip chunk delivery check (default false)",
|
2019-02-24 05:39:23 -06:00
|
|
|
EnvVar: SwarmEnvDeliverySkipCheck,
|
2018-10-12 07:51:38 -05:00
|
|
|
}
|
|
|
|
EnsAPIFlag = cli.StringSliceFlag{
|
|
|
|
Name: "ens-api",
|
|
|
|
Usage: "ENS API endpoint for a TLD and with contract address, can be repeated, format [tld:][contract-addr@]url",
|
2019-02-24 05:39:23 -06:00
|
|
|
EnvVar: SwarmEnvENSAPI,
|
2018-10-12 07:51:38 -05:00
|
|
|
}
|
|
|
|
SwarmApiFlag = cli.StringFlag{
|
|
|
|
Name: "bzzapi",
|
2018-11-12 06:04:13 -06:00
|
|
|
Usage: "Specifies the Swarm HTTP endpoint to connect to",
|
2018-10-12 07:51:38 -05:00
|
|
|
Value: "http://127.0.0.1:8500",
|
|
|
|
}
|
|
|
|
SwarmRecursiveFlag = cli.BoolFlag{
|
|
|
|
Name: "recursive",
|
|
|
|
Usage: "Upload directories recursively",
|
|
|
|
}
|
|
|
|
SwarmWantManifestFlag = cli.BoolTFlag{
|
|
|
|
Name: "manifest",
|
|
|
|
Usage: "Automatic manifest upload (default true)",
|
|
|
|
}
|
|
|
|
SwarmUploadDefaultPath = cli.StringFlag{
|
|
|
|
Name: "defaultpath",
|
|
|
|
Usage: "path to file served for empty url path (none)",
|
|
|
|
}
|
|
|
|
SwarmAccessGrantKeyFlag = cli.StringFlag{
|
|
|
|
Name: "grant-key",
|
|
|
|
Usage: "grants a given public key access to an ACT",
|
|
|
|
}
|
|
|
|
SwarmAccessGrantKeysFlag = cli.StringFlag{
|
|
|
|
Name: "grant-keys",
|
|
|
|
Usage: "grants a given list of public keys in the following file (separated by line breaks) access to an ACT",
|
|
|
|
}
|
|
|
|
SwarmUpFromStdinFlag = cli.BoolFlag{
|
|
|
|
Name: "stdin",
|
|
|
|
Usage: "reads data to be uploaded from stdin",
|
|
|
|
}
|
|
|
|
SwarmUploadMimeType = cli.StringFlag{
|
|
|
|
Name: "mime",
|
|
|
|
Usage: "Manually specify MIME type",
|
|
|
|
}
|
|
|
|
SwarmEncryptedFlag = cli.BoolFlag{
|
|
|
|
Name: "encrypt",
|
|
|
|
Usage: "use encrypted upload",
|
|
|
|
}
|
|
|
|
SwarmAccessPasswordFlag = cli.StringFlag{
|
|
|
|
Name: "password",
|
|
|
|
Usage: "Password",
|
2019-02-24 05:39:23 -06:00
|
|
|
EnvVar: SwarmAccessPassword,
|
2018-10-12 07:51:38 -05:00
|
|
|
}
|
|
|
|
SwarmDryRunFlag = cli.BoolFlag{
|
|
|
|
Name: "dry-run",
|
|
|
|
Usage: "dry-run",
|
|
|
|
}
|
|
|
|
CorsStringFlag = cli.StringFlag{
|
|
|
|
Name: "corsdomain",
|
|
|
|
Usage: "Domain on which to send Access-Control-Allow-Origin header (multiple domains can be supplied separated by a ',')",
|
2019-02-24 05:39:23 -06:00
|
|
|
EnvVar: SwarmEnvCORS,
|
2018-10-12 07:51:38 -05:00
|
|
|
}
|
|
|
|
SwarmStorePath = cli.StringFlag{
|
|
|
|
Name: "store.path",
|
|
|
|
Usage: "Path to leveldb chunk DB (default <$GETH_ENV_DIR>/swarm/bzz-<$BZZ_KEY>/chunks)",
|
2019-02-24 05:39:23 -06:00
|
|
|
EnvVar: SwarmEnvStorePath,
|
2018-10-12 07:51:38 -05:00
|
|
|
}
|
|
|
|
SwarmStoreCapacity = cli.Uint64Flag{
|
|
|
|
Name: "store.size",
|
|
|
|
Usage: "Number of chunks (5M is roughly 20-25GB) (default 5000000)",
|
2019-02-24 05:39:23 -06:00
|
|
|
EnvVar: SwarmEnvStoreCapacity,
|
2018-10-12 07:51:38 -05:00
|
|
|
}
|
|
|
|
SwarmStoreCacheCapacity = cli.UintFlag{
|
|
|
|
Name: "store.cache.size",
|
|
|
|
Usage: "Number of recent chunks cached in memory (default 5000)",
|
2019-02-24 05:39:23 -06:00
|
|
|
EnvVar: SwarmEnvStoreCacheCapacity,
|
2018-10-12 07:51:38 -05:00
|
|
|
}
|
|
|
|
SwarmCompressedFlag = cli.BoolFlag{
|
|
|
|
Name: "compressed",
|
|
|
|
Usage: "Prints encryption keys in compressed form",
|
|
|
|
}
|
2019-01-24 05:02:18 -06:00
|
|
|
SwarmBootnodeModeFlag = cli.BoolFlag{
|
|
|
|
Name: "bootnode-mode",
|
|
|
|
Usage: "Run Swarm in Bootnode mode",
|
|
|
|
}
|
2018-10-12 07:51:38 -05:00
|
|
|
SwarmFeedNameFlag = cli.StringFlag{
|
|
|
|
Name: "name",
|
|
|
|
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",
|
|
|
|
}
|
|
|
|
SwarmFeedTopicFlag = cli.StringFlag{
|
|
|
|
Name: "topic",
|
|
|
|
Usage: "User-defined topic this feed is tracking, hex encoded. Limited to 64 hexadecimal characters",
|
|
|
|
}
|
|
|
|
SwarmFeedManifestFlag = cli.StringFlag{
|
|
|
|
Name: "manifest",
|
|
|
|
Usage: "Refers to the feed through a manifest",
|
|
|
|
}
|
|
|
|
SwarmFeedUserFlag = cli.StringFlag{
|
|
|
|
Name: "user",
|
|
|
|
Usage: "Indicates the user who updates the feed",
|
|
|
|
}
|
2019-02-07 08:46:58 -06:00
|
|
|
SwarmGlobalStoreAPIFlag = cli.StringFlag{
|
|
|
|
Name: "globalstore-api",
|
|
|
|
Usage: "URL of the Global Store API provider (only for testing)",
|
2019-02-24 05:39:23 -06:00
|
|
|
EnvVar: SwarmGlobalstoreAPI,
|
2019-02-07 08:46:58 -06:00
|
|
|
}
|
2018-10-12 07:51:38 -05:00
|
|
|
)
|