|
|
@ -100,10 +100,6 @@ var ( |
|
|
|
Name: "sync", |
|
|
|
Name: "sync", |
|
|
|
Usage: "Swarm Syncing enabled (default true)", |
|
|
|
Usage: "Swarm Syncing enabled (default true)", |
|
|
|
} |
|
|
|
} |
|
|
|
EthAPIFlag = cli.StringFlag{ |
|
|
|
|
|
|
|
Name: "ethapi", |
|
|
|
|
|
|
|
Usage: "DEPRECATED: please use --ens-api and --swap-api", |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
EnsAPIFlag = cli.StringFlag{ |
|
|
|
EnsAPIFlag = cli.StringFlag{ |
|
|
|
Name: "ens-api", |
|
|
|
Name: "ens-api", |
|
|
|
Usage: "URL of the Ethereum API provider to use for ENS record lookups", |
|
|
|
Usage: "URL of the Ethereum API provider to use for ENS record lookups", |
|
|
@ -142,6 +138,12 @@ var ( |
|
|
|
Name: "corsdomain", |
|
|
|
Name: "corsdomain", |
|
|
|
Usage: "Domain on which to send Access-Control-Allow-Origin header (multiple domains can be supplied separated by a ',')", |
|
|
|
Usage: "Domain on which to send Access-Control-Allow-Origin header (multiple domains can be supplied separated by a ',')", |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// the following flags are deprecated and should be removed in the future
|
|
|
|
|
|
|
|
DeprecatedEthAPIFlag = cli.StringFlag{ |
|
|
|
|
|
|
|
Name: "ethapi", |
|
|
|
|
|
|
|
Usage: "DEPRECATED: please use --ens-api and --swap-api", |
|
|
|
|
|
|
|
} |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
var defaultNodeConfig = node.DefaultConfig |
|
|
|
var defaultNodeConfig = node.DefaultConfig |
|
|
@ -266,7 +268,6 @@ Cleans database of corrupted entries. |
|
|
|
utils.PasswordFileFlag, |
|
|
|
utils.PasswordFileFlag, |
|
|
|
// bzzd-specific flags
|
|
|
|
// bzzd-specific flags
|
|
|
|
CorsStringFlag, |
|
|
|
CorsStringFlag, |
|
|
|
EthAPIFlag, |
|
|
|
|
|
|
|
EnsAPIFlag, |
|
|
|
EnsAPIFlag, |
|
|
|
EnsAddrFlag, |
|
|
|
EnsAddrFlag, |
|
|
|
SwarmConfigPathFlag, |
|
|
|
SwarmConfigPathFlag, |
|
|
@ -285,6 +286,8 @@ Cleans database of corrupted entries. |
|
|
|
SwarmUploadDefaultPath, |
|
|
|
SwarmUploadDefaultPath, |
|
|
|
SwarmUpFromStdinFlag, |
|
|
|
SwarmUpFromStdinFlag, |
|
|
|
SwarmUploadMimeType, |
|
|
|
SwarmUploadMimeType, |
|
|
|
|
|
|
|
//deprecated flags
|
|
|
|
|
|
|
|
DeprecatedEthAPIFlag, |
|
|
|
} |
|
|
|
} |
|
|
|
app.Flags = append(app.Flags, debug.Flags...) |
|
|
|
app.Flags = append(app.Flags, debug.Flags...) |
|
|
|
app.Before = func(ctx *cli.Context) error { |
|
|
|
app.Before = func(ctx *cli.Context) error { |
|
|
@ -319,6 +322,11 @@ func version(ctx *cli.Context) error { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func bzzd(ctx *cli.Context) error { |
|
|
|
func bzzd(ctx *cli.Context) error { |
|
|
|
|
|
|
|
// exit if the deprecated --ethapi flag is set
|
|
|
|
|
|
|
|
if ctx.GlobalString(DeprecatedEthAPIFlag.Name) != "" { |
|
|
|
|
|
|
|
utils.Fatalf("--ethapi is no longer a valid command line flag, please use --ens-api and/or --swap-api.") |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
cfg := defaultNodeConfig |
|
|
|
cfg := defaultNodeConfig |
|
|
|
utils.SetNodeConfig(ctx, &cfg) |
|
|
|
utils.SetNodeConfig(ctx, &cfg) |
|
|
|
stack, err := node.New(&cfg) |
|
|
|
stack, err := node.New(&cfg) |
|
|
@ -408,21 +416,12 @@ func registerBzzService(ctx *cli.Context, stack *node.Node) { |
|
|
|
swapEnabled := ctx.GlobalBool(SwarmSwapEnabledFlag.Name) |
|
|
|
swapEnabled := ctx.GlobalBool(SwarmSwapEnabledFlag.Name) |
|
|
|
syncEnabled := ctx.GlobalBoolT(SwarmSyncEnabledFlag.Name) |
|
|
|
syncEnabled := ctx.GlobalBoolT(SwarmSyncEnabledFlag.Name) |
|
|
|
|
|
|
|
|
|
|
|
ethapi := ctx.GlobalString(EthAPIFlag.Name) |
|
|
|
|
|
|
|
if ethapi != "" { |
|
|
|
|
|
|
|
log.Warn("DEPRECATED: --ethapi is deprecated and will be removed in a future version, please use --ens-api and --swap-api") |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
swapapi := ctx.GlobalString(SwarmSwapAPIFlag.Name) |
|
|
|
swapapi := ctx.GlobalString(SwarmSwapAPIFlag.Name) |
|
|
|
if swapEnabled && swapapi == "" { |
|
|
|
if swapEnabled && swapapi == "" { |
|
|
|
utils.Fatalf("SWAP is enabled but --swap-api is not set") |
|
|
|
utils.Fatalf("SWAP is enabled but --swap-api is not set") |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
ensapi := ctx.GlobalString(EnsAPIFlag.Name) |
|
|
|
ensapi := ctx.GlobalString(EnsAPIFlag.Name) |
|
|
|
// use the deprecated --ethapi if --ens-api is not set
|
|
|
|
|
|
|
|
if ensapi == "" { |
|
|
|
|
|
|
|
ensapi = ethapi |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
ensAddr := ctx.GlobalString(EnsAddrFlag.Name) |
|
|
|
ensAddr := ctx.GlobalString(EnsAddrFlag.Name) |
|
|
|
|
|
|
|
|
|
|
|
cors := ctx.GlobalString(CorsStringFlag.Name) |
|
|
|
cors := ctx.GlobalString(CorsStringFlag.Name) |
|
|
|