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
cc0064b2
Commit
cc0064b2
authored
Nov 10, 2016
by
Felix Lange
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
node: add InstanceDir method
parent
1aaa5991
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
2 deletions
+15
-2
config.go
node/config.go
+9
-2
node.go
node/node.go
+6
-0
No files found.
node/config.go
View file @
cc0064b2
...
...
@@ -268,7 +268,7 @@ func (c *Config) name() string {
return
c
.
Name
}
// These resources are resolved differently for
the "geth" and "geth-testnet
" instances.
// These resources are resolved differently for
"geth
" instances.
var
isOldGethResource
=
map
[
string
]
bool
{
"chaindata"
:
true
,
"nodes"
:
true
,
...
...
@@ -297,7 +297,14 @@ func (c *Config) resolvePath(path string) string {
return
oldpath
}
}
return
filepath
.
Join
(
c
.
DataDir
,
c
.
name
(),
path
)
return
filepath
.
Join
(
c
.
instanceDir
(),
path
)
}
func
(
c
*
Config
)
instanceDir
()
string
{
if
c
.
DataDir
==
""
{
return
""
}
return
filepath
.
Join
(
c
.
DataDir
,
c
.
name
())
}
// NodeKey retrieves the currently configured private key of the node, checking
...
...
node/node.go
View file @
cc0064b2
...
...
@@ -601,10 +601,16 @@ func (n *Node) Service(service interface{}) error {
}
// DataDir retrieves the current datadir used by the protocol stack.
// Deprecated: No files should be stored in this directory, use InstanceDir instead.
func
(
n
*
Node
)
DataDir
()
string
{
return
n
.
config
.
DataDir
}
// InstanceDir retrieves the instance directory used by the protocol stack.
func
(
n
*
Node
)
InstanceDir
()
string
{
return
n
.
config
.
instanceDir
()
}
// AccountManager retrieves the account manager used by the protocol stack.
func
(
n
*
Node
)
AccountManager
()
*
accounts
.
Manager
{
return
n
.
accman
...
...
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