diff options
author | Péter Szilágyi <peterke@gmail.com> | 2017-01-30 22:36:30 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-30 22:36:30 +0800 |
commit | 1c140f73820e2a915dcc61eccaeca7ea359cf07b (patch) | |
tree | ed3c5330a14344d6c716d19306154f17cd1efcbc /cmd | |
parent | f3c368ca736ed2884943cf87b029d305b7fc7c61 (diff) | |
parent | e5a93bf99abc0db5efbfab17feb61cfaef5a19ed (diff) | |
download | dexon-1c140f73820e2a915dcc61eccaeca7ea359cf07b.tar dexon-1c140f73820e2a915dcc61eccaeca7ea359cf07b.tar.gz dexon-1c140f73820e2a915dcc61eccaeca7ea359cf07b.tar.bz2 dexon-1c140f73820e2a915dcc61eccaeca7ea359cf07b.tar.lz dexon-1c140f73820e2a915dcc61eccaeca7ea359cf07b.tar.xz dexon-1c140f73820e2a915dcc61eccaeca7ea359cf07b.tar.zst dexon-1c140f73820e2a915dcc61eccaeca7ea359cf07b.zip |
Merge pull request #3615 from nolash/bzzpathfix_real5
cmd/swarm, swarm/api: bzzr improve + networkid prio
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/swarm/main.go | 5 |
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) } |