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
c0ae5c58
Commit
c0ae5c58
authored
Jul 15, 2014
by
Maran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rewrote mnemonic word loading to facilitate deployable builds.
parent
e53acdc2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
29 deletions
+31
-29
flags.go
ethereal/flags.go
+2
-29
cmd.go
utils/cmd.go
+29
-0
No files found.
ethereal/flags.go
View file @
c0ae5c58
package
main
package
main
import
(
import
(
"bitbucket.org/kardianos/osext"
"flag"
"flag"
"fmt"
"fmt"
"github.com/ethereum/eth-go/ethlog"
"github.com/ethereum/eth-go/ethlog"
"github.com/ethereum/go-ethereum/utils"
"os"
"os"
"os/user"
"os/user"
"path"
"path"
"path/filepath"
"runtime"
)
)
var
Identifier
string
var
Identifier
string
...
@@ -36,31 +34,6 @@ var LogLevel int
...
@@ -36,31 +34,6 @@ var LogLevel int
// flags specific to gui client
// flags specific to gui client
var
AssetPath
string
var
AssetPath
string
func
defaultAssetPath
()
string
{
var
assetPath
string
// If the current working directory is the go-ethereum dir
// assume a debug build and use the source directory as
// asset directory.
pwd
,
_
:=
os
.
Getwd
()
if
pwd
==
path
.
Join
(
os
.
Getenv
(
"GOPATH"
),
"src"
,
"github.com"
,
"ethereum"
,
"go-ethereum"
,
"ethereal"
)
{
assetPath
=
path
.
Join
(
pwd
,
"assets"
)
}
else
{
switch
runtime
.
GOOS
{
case
"darwin"
:
// Get Binary Directory
exedir
,
_
:=
osext
.
ExecutableFolder
()
assetPath
=
filepath
.
Join
(
exedir
,
"../Resources"
)
case
"linux"
:
assetPath
=
"/usr/share/ethereal"
case
"windows"
:
assetPath
=
"./assets"
default
:
assetPath
=
"."
}
}
return
assetPath
}
func
defaultDataDir
()
string
{
func
defaultDataDir
()
string
{
usr
,
_
:=
user
.
Current
()
usr
,
_
:=
user
.
Current
()
return
path
.
Join
(
usr
.
HomeDir
,
".ethereal"
)
return
path
.
Join
(
usr
.
HomeDir
,
".ethereal"
)
...
@@ -93,7 +66,7 @@ func Init() {
...
@@ -93,7 +66,7 @@ func Init() {
flag
.
StringVar
(
&
DebugFile
,
"debug"
,
""
,
"debug file (no debugging if not set)"
)
flag
.
StringVar
(
&
DebugFile
,
"debug"
,
""
,
"debug file (no debugging if not set)"
)
flag
.
IntVar
(
&
LogLevel
,
"loglevel"
,
int
(
ethlog
.
InfoLevel
),
"loglevel: 0-5: silent,error,warn,info,debug,debug detail)"
)
flag
.
IntVar
(
&
LogLevel
,
"loglevel"
,
int
(
ethlog
.
InfoLevel
),
"loglevel: 0-5: silent,error,warn,info,debug,debug detail)"
)
flag
.
StringVar
(
&
AssetPath
,
"asset_path"
,
d
efaultAssetPath
(),
"absolute path to GUI assets directory"
)
flag
.
StringVar
(
&
AssetPath
,
"asset_path"
,
utils
.
D
efaultAssetPath
(),
"absolute path to GUI assets directory"
)
flag
.
Parse
()
flag
.
Parse
()
}
}
utils/cmd.go
View file @
c0ae5c58
package
utils
package
utils
import
(
import
(
"bitbucket.org/kardianos/osext"
"fmt"
"fmt"
"github.com/ethereum/eth-go"
"github.com/ethereum/eth-go"
"github.com/ethereum/eth-go/ethcrypto"
"github.com/ethereum/eth-go/ethcrypto"
...
@@ -16,6 +17,8 @@ import (
...
@@ -16,6 +17,8 @@ import (
"os"
"os"
"os/signal"
"os/signal"
"path"
"path"
"path/filepath"
"runtime"
"time"
"time"
)
)
...
@@ -164,7 +167,33 @@ func NewKeyManager(KeyStore string, Datadir string, db ethutil.Database) *ethcry
...
@@ -164,7 +167,33 @@ func NewKeyManager(KeyStore string, Datadir string, db ethutil.Database) *ethcry
return
keyManager
return
keyManager
}
}
func
DefaultAssetPath
()
string
{
var
assetPath
string
// If the current working directory is the go-ethereum dir
// assume a debug build and use the source directory as
// asset directory.
pwd
,
_
:=
os
.
Getwd
()
if
pwd
==
path
.
Join
(
os
.
Getenv
(
"GOPATH"
),
"src"
,
"github.com"
,
"ethereum"
,
"go-ethereum"
,
"ethereal"
)
{
assetPath
=
path
.
Join
(
pwd
,
"assets"
)
}
else
{
switch
runtime
.
GOOS
{
case
"darwin"
:
// Get Binary Directory
exedir
,
_
:=
osext
.
ExecutableFolder
()
assetPath
=
filepath
.
Join
(
exedir
,
"../Resources"
)
case
"linux"
:
assetPath
=
"/usr/share/ethereal"
case
"windows"
:
assetPath
=
"./assets"
default
:
assetPath
=
"."
}
}
return
assetPath
}
func
KeyTasks
(
keyManager
*
ethcrypto
.
KeyManager
,
KeyRing
string
,
GenAddr
bool
,
SecretFile
string
,
ExportDir
string
,
NonInteractive
bool
)
{
func
KeyTasks
(
keyManager
*
ethcrypto
.
KeyManager
,
KeyRing
string
,
GenAddr
bool
,
SecretFile
string
,
ExportDir
string
,
NonInteractive
bool
)
{
ethcrypto
.
InitWords
(
DefaultAssetPath
())
// Init mnemonic word list
var
err
error
var
err
error
switch
{
switch
{
case
GenAddr
:
case
GenAddr
:
...
...
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