aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authornolash <dev@holbrook.no>2017-01-27 03:33:39 +0800
committernolash <dev@holbrook.no>2017-01-27 15:18:13 +0800
commit7669c5b5ec5b18e96a0714d667468247a3da3d68 (patch)
tree21d05653609b54e22dea26c946215726ce86a93d /cmd
parent82aa5b1de69331a43f5050717d593aa97eda1ef5 (diff)
downloadgo-tangerine-7669c5b5ec5b18e96a0714d667468247a3da3d68.tar
go-tangerine-7669c5b5ec5b18e96a0714d667468247a3da3d68.tar.gz
go-tangerine-7669c5b5ec5b18e96a0714d667468247a3da3d68.tar.bz2
go-tangerine-7669c5b5ec5b18e96a0714d667468247a3da3d68.tar.lz
go-tangerine-7669c5b5ec5b18e96a0714d667468247a3da3d68.tar.xz
go-tangerine-7669c5b5ec5b18e96a0714d667468247a3da3d68.tar.zst
go-tangerine-7669c5b5ec5b18e96a0714d667468247a3da3d68.zip
cmd/swarm, swarm/api: bzzr improve + networkid prio
fixes #3444 fixes #3494 networkid override Added comments to explain why test against 0 appears twice * Command line overrides saved config, saved config overrides system default --- fixes #3476 bzzr get with path Finally a hopefully clean commit for this PR Added check for empty path to avoid SIGSEGV in path parser and resolver Added requested tests for empty path and non-existing manifest. However signature for StartHTTPServer had changed. Now it's hacked as so: StartHttpServer(api.API, &Server{Addr: "127.0.0.1:8504", CorsString: ""}) * Parse url before resolve when path and ENS is supplied, example * swarm/api/http proxy server test for retrieval of subpath through get * Removed nil entry assignment on subtrie leaf in recursive key retrieval * Cleaned up path-or-no-path condition in proxy server get handler * swarm: processed with gofmt refers to lash/go-ethereum@90daa7a * swarm: Added public access method Parse alias to parse * swarm: processed with gofmt References nolash/go-ethereum@2ec3fd7 * Rename parse to Parse, removed alias
Diffstat (limited to 'cmd')
-rw-r--r--cmd/swarm/main.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/cmd/swarm/main.go b/cmd/swarm/main.go
index 87e21fb7f..34b3f71c4 100644
--- a/cmd/swarm/main.go
+++ b/cmd/swarm/main.go
@@ -39,7 +39,6 @@ import (
"github.com/ethereum/go-ethereum/p2p/discover"
"github.com/ethereum/go-ethereum/swarm"
bzzapi "github.com/ethereum/go-ethereum/swarm/api"
- "github.com/ethereum/go-ethereum/swarm/network"
"gopkg.in/urfave/cli.v1"
)
@@ -76,7 +75,6 @@ var (
SwarmNetworkIdFlag = cli.IntFlag{
Name: "bzznetworkid",
Usage: "Network identifier (integer, default 3=swarm testnet)",
- Value: network.NetworkId,
}
SwarmConfigPathFlag = cli.StringFlag{
Name: "bzzconfig",
@@ -242,6 +240,7 @@ func bzzd(ctx *cli.Context) error {
}
func registerBzzService(ctx *cli.Context, stack *node.Node) {
+
prvkey := getAccount(ctx, stack)
chbookaddr := common.HexToAddress(ctx.GlobalString(ChequebookAddrFlag.Name))
@@ -249,6 +248,7 @@ func registerBzzService(ctx *cli.Context, stack *node.Node) {
if bzzdir == "" {
bzzdir = stack.InstanceDir()
}
+
bzzconfig, err := bzzapi.NewConfig(bzzdir, chbookaddr, prvkey, ctx.GlobalUint64(SwarmNetworkIdFlag.Name))
if err != nil {
utils.Fatalf("unable to configure swarm: %v", err)
@@ -280,6 +280,7 @@ func registerBzzService(ctx *cli.Context, stack *node.Node) {
func getAccount(ctx *cli.Context, stack *node.Node) *ecdsa.PrivateKey {
keyid := ctx.GlobalString(SwarmAccountFlag.Name)
+
if keyid == "" {
utils.Fatalf("Option %q is required", SwarmAccountFlag.Name)
}