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
4825d9c3
Unverified
Commit
4825d9c3
authored
Dec 03, 2018
by
Péter Szilágyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd/puppeth: enforce lowercase network names
parent
ef8ced41
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
puppeth.go
cmd/puppeth/puppeth.go
+2
-2
wizard_intro.go
cmd/puppeth/wizard_intro.go
+3
-3
No files found.
cmd/puppeth/puppeth.go
View file @
4825d9c3
...
...
@@ -49,8 +49,8 @@ func main() {
rand
.
Seed
(
time
.
Now
()
.
UnixNano
())
network
:=
c
.
String
(
"network"
)
if
strings
.
Contains
(
network
,
" "
)
||
strings
.
Contains
(
network
,
"-"
)
{
log
.
Crit
(
"No spaces
or hyphen
s allowed in network name"
)
if
strings
.
Contains
(
network
,
" "
)
||
strings
.
Contains
(
network
,
"-"
)
||
strings
.
ToLower
(
network
)
!=
network
{
log
.
Crit
(
"No spaces
, hyphens or capital letter
s allowed in network name"
)
}
// Start the wizard and relinquish control
makeWizard
(
c
.
String
(
"network"
))
.
run
()
...
...
cmd/puppeth/wizard_intro.go
View file @
4825d9c3
...
...
@@ -61,14 +61,14 @@ func (w *wizard) run() {
// Make sure we have a good network name to work with fmt.Println()
// Docker accepts hyphens in image names, but doesn't like it for container names
if
w
.
network
==
""
{
fmt
.
Println
(
"Please specify a network name to administer (no spaces
or hyphens,
please)"
)
fmt
.
Println
(
"Please specify a network name to administer (no spaces
, hyphens or capital letters
please)"
)
for
{
w
.
network
=
w
.
readString
()
if
!
strings
.
Contains
(
w
.
network
,
" "
)
&&
!
strings
.
Contains
(
w
.
network
,
"-"
)
{
if
!
strings
.
Contains
(
w
.
network
,
" "
)
&&
!
strings
.
Contains
(
w
.
network
,
"-"
)
&&
strings
.
ToLower
(
w
.
network
)
==
w
.
network
{
fmt
.
Printf
(
"
\n
Sweet, you can set this via --network=%s next time!
\n\n
"
,
w
.
network
)
break
}
log
.
Error
(
"I also like to live dangerously, still no spaces
or hyphen
s"
)
log
.
Error
(
"I also like to live dangerously, still no spaces
, hyphens or capital letter
s"
)
}
}
log
.
Info
(
"Administering Ethereum network"
,
"name"
,
w
.
network
)
...
...
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