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
627c2311
Commit
627c2311
authored
Mar 07, 2016
by
Kobi Gurkan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd/utils: add --keystore
parent
d45f01d5
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
2 deletions
+19
-2
main.go
cmd/geth/main.go
+1
-0
usage.go
cmd/geth/usage.go
+1
-0
flags.go
cmd/utils/flags.go
+17
-2
No files found.
cmd/geth/main.go
View file @
627c2311
...
...
@@ -284,6 +284,7 @@ JavaScript API. See https://github.com/ethereum/go-ethereum/wiki/Javascipt-Conso
utils
.
GenesisFileFlag
,
utils
.
BootnodesFlag
,
utils
.
DataDirFlag
,
utils
.
KeyStoreDirFlag
,
utils
.
BlockchainVersionFlag
,
utils
.
OlympicFlag
,
utils
.
FastSyncFlag
,
...
...
cmd/geth/usage.go
View file @
627c2311
...
...
@@ -63,6 +63,7 @@ var AppHelpFlagGroups = []flagGroup{
Name
:
"ETHEREUM"
,
Flags
:
[]
cli
.
Flag
{
utils
.
DataDirFlag
,
utils
.
KeyStoreDirFlag
,
utils
.
NetworkIdFlag
,
utils
.
OlympicFlag
,
utils
.
TestNetFlag
,
...
...
cmd/utils/flags.go
View file @
627c2311
...
...
@@ -102,6 +102,10 @@ var (
Usage
:
"Data directory for the databases and keystore"
,
Value
:
DirectoryString
{
common
.
DefaultDataDir
()},
}
KeyStoreDirFlag
=
DirectoryFlag
{
Name
:
"keystore"
,
Usage
:
"Directory for the keystore (default = inside the datadir)"
,
}
NetworkIdFlag
=
cli
.
IntFlag
{
Name
:
"networkid"
,
Usage
:
"Network identifier (integer, 0=Olympic, 1=Frontier, 2=Morden)"
,
...
...
@@ -393,6 +397,16 @@ func MustMakeDataDir(ctx *cli.Context) string {
return
""
}
// MakeKeyStoreDir resolves the folder to use for storing the account keys from the
// set command line flags, returning the explicitly requested path, or one inside
// the data directory otherwise.
func
MakeKeyStoreDir
(
datadir
string
,
ctx
*
cli
.
Context
)
string
{
if
path
:=
ctx
.
GlobalString
(
KeyStoreDirFlag
.
Name
);
path
!=
""
{
return
path
}
return
filepath
.
Join
(
datadir
,
"keystore"
)
}
// MakeIPCPath creates an IPC path configuration from the set command line flags,
// returning an empty string if IPC was explicitly disabled, or the set path.
func
MakeIPCPath
(
ctx
*
cli
.
Context
)
string
{
...
...
@@ -526,7 +540,8 @@ func MakeAccountManager(ctx *cli.Context) *accounts.Manager {
// Assemble an account manager using the configured datadir
var
(
datadir
=
MustMakeDataDir
(
ctx
)
keystore
=
crypto
.
NewKeyStorePassphrase
(
filepath
.
Join
(
datadir
,
"keystore"
),
scryptN
,
scryptP
)
keystoredir
=
MakeKeyStoreDir
(
datadir
,
ctx
)
keystore
=
crypto
.
NewKeyStorePassphrase
(
keystoredir
,
scryptN
,
scryptP
)
)
return
accounts
.
NewManager
(
keystore
)
}
...
...
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