Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
a0aa071c
Commit
a0aa071c
authored
7 years ago
by
Péter Szilágyi
Committed by
GitHub
7 years ago
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #14732 from ethersphere/swarm-remove-ethapi
cmd/swarm: Exit if --ethapi is set
parents
41318f37
c7041fe1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
16 deletions
+15
-16
main.go
cmd/swarm/main.go
+13
-14
run_test.go
cmd/swarm/run_test.go
+1
-1
boot-cluster.sh
swarm/dev/scripts/boot-cluster.sh
+1
-1
No files found.
cmd/swarm/main.go
View file @
a0aa071c
...
...
@@ -100,10 +100,6 @@ var (
Name
:
"sync"
,
Usage
:
"Swarm Syncing enabled (default true)"
,
}
EthAPIFlag
=
cli
.
StringFlag
{
Name
:
"ethapi"
,
Usage
:
"DEPRECATED: please use --ens-api and --swap-api"
,
}
EnsAPIFlag
=
cli
.
StringFlag
{
Name
:
"ens-api"
,
Usage
:
"URL of the Ethereum API provider to use for ENS record lookups"
,
...
...
@@ -142,6 +138,12 @@ var (
Name
:
"corsdomain"
,
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
...
...
@@ -266,7 +268,6 @@ Cleans database of corrupted entries.
utils
.
PasswordFileFlag
,
// bzzd-specific flags
CorsStringFlag
,
EthAPIFlag
,
EnsAPIFlag
,
EnsAddrFlag
,
SwarmConfigPathFlag
,
...
...
@@ -285,6 +286,8 @@ Cleans database of corrupted entries.
SwarmUploadDefaultPath
,
SwarmUpFromStdinFlag
,
SwarmUploadMimeType
,
//deprecated flags
DeprecatedEthAPIFlag
,
}
app
.
Flags
=
append
(
app
.
Flags
,
debug
.
Flags
...
)
app
.
Before
=
func
(
ctx
*
cli
.
Context
)
error
{
...
...
@@ -319,6 +322,11 @@ func version(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
utils
.
SetNodeConfig
(
ctx
,
&
cfg
)
stack
,
err
:=
node
.
New
(
&
cfg
)
...
...
@@ -408,21 +416,12 @@ func registerBzzService(ctx *cli.Context, stack *node.Node) {
swapEnabled
:=
ctx
.
GlobalBool
(
SwarmSwapEnabledFlag
.
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
)
if
swapEnabled
&&
swapapi
==
""
{
utils
.
Fatalf
(
"SWAP is enabled but --swap-api is not set"
)
}
ensapi
:=
ctx
.
GlobalString
(
EnsAPIFlag
.
Name
)
// use the deprecated --ethapi if --ens-api is not set
if
ensapi
==
""
{
ensapi
=
ethapi
}
ensAddr
:=
ctx
.
GlobalString
(
EnsAddrFlag
.
Name
)
cors
:=
ctx
.
GlobalString
(
CorsStringFlag
.
Name
)
...
...
This diff is collapsed.
Click to expand it.
cmd/swarm/run_test.go
View file @
a0aa071c
...
...
@@ -194,7 +194,7 @@ func newTestNode(t *testing.T, dir string) *testNode {
"--nodiscover"
,
"--datadir"
,
dir
,
"--ipcpath"
,
conf
.
IPCPath
,
"--e
th
api"
,
""
,
"--e
ns-
api"
,
""
,
"--bzzaccount"
,
account
.
Address
.
String
(),
"--bzznetworkid"
,
"321"
,
"--bzzport"
,
httpPort
,
...
...
This diff is collapsed.
Click to expand it.
swarm/dev/scripts/boot-cluster.sh
View file @
a0aa071c
...
...
@@ -208,7 +208,7 @@ start_swarm_node() {
--bootnodes
"
${
BOOTNODE_URL
}
"
--datadir
"
${
dir
}
"
--identity
"
${
name
}
"
--e
thapi
"
${
GETH_RPC_URL
}
"
--e
ns-api
"
${
GETH_RPC_URL
}
"
--bzznetworkid
"321"
--bzzaccount
"
${
address
}
"
--password
"
${
dir
}
/password"
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment