aboutsummaryrefslogtreecommitdiffstats
path: root/node
diff options
context:
space:
mode:
Diffstat (limited to 'node')
-rw-r--r--node/config.go15
-rw-r--r--node/doc.go2
-rw-r--r--node/node.go2
-rw-r--r--node/utils_test.go2
4 files changed, 13 insertions, 8 deletions
diff --git a/node/config.go b/node/config.go
index 61e0008ef..b9b5e5b92 100644
--- a/node/config.go
+++ b/node/config.go
@@ -35,7 +35,7 @@ import (
"github.com/ethereum/go-ethereum/p2p/discover"
)
-var (
+const (
datadirPrivateKey = "nodekey" // Path within the datadir to the node's private key
datadirDefaultKeyStore = "keystore" // Path within the datadir to the keystore
datadirStaticNodes = "static-nodes.json" // Path within the datadir to the static node list
@@ -160,7 +160,7 @@ func (c *Config) NodeDB() string {
if c.DataDir == "" {
return "" // ephemeral
}
- return c.resolvePath("nodes")
+ return c.resolvePath(datadirNodeDatabase)
}
// DefaultIPCEndpoint returns the IPC path used by default.
@@ -316,8 +316,8 @@ func (c *Config) StaticNodes() []*discover.Node {
return c.parsePersistentNodes(c.resolvePath(datadirStaticNodes))
}
-// TrusterNodes returns a list of node enode URLs configured as trusted nodes.
-func (c *Config) TrusterNodes() []*discover.Node {
+// TrustedNodes returns a list of node enode URLs configured as trusted nodes.
+func (c *Config) TrustedNodes() []*discover.Node {
return c.parsePersistentNodes(c.resolvePath(datadirTrustedNodes))
}
@@ -393,11 +393,18 @@ func makeAccountManager(conf *Config) (*accounts.Manager, string, error) {
keystore.NewKeyStore(keydir, scryptN, scryptP),
}
if !conf.NoUSB {
+ // Start a USB hub for Ledger hardware wallets
if ledgerhub, err := usbwallet.NewLedgerHub(); err != nil {
log.Warn(fmt.Sprintf("Failed to start Ledger hub, disabling: %v", err))
} else {
backends = append(backends, ledgerhub)
}
+ // Start a USB hub for Trezor hardware wallets
+ if trezorhub, err := usbwallet.NewTrezorHub(); err != nil {
+ log.Warn(fmt.Sprintf("Failed to start Trezor hub, disabling: %v", err))
+ } else {
+ backends = append(backends, trezorhub)
+ }
}
return accounts.NewManager(backends...), ephemeral, nil
}
diff --git a/node/doc.go b/node/doc.go
index f009e6f85..d9688e0a1 100644
--- a/node/doc.go
+++ b/node/doc.go
@@ -68,7 +68,7 @@ unless its location is changed through the KeyStoreDir configuration option.
Data Directory Sharing Example
-In this exanple, two node instances named A and B are started with the same data
+In this example, two node instances named A and B are started with the same data
directory. Mode instance A opens the database "db", node instance B opens the databases
"db" and "db-2". The following files will be created in the data directory:
diff --git a/node/node.go b/node/node.go
index a372b1c25..e3f0232b4 100644
--- a/node/node.go
+++ b/node/node.go
@@ -160,7 +160,7 @@ func (n *Node) Start() error {
n.serverConfig.StaticNodes = n.config.StaticNodes()
}
if n.serverConfig.TrustedNodes == nil {
- n.serverConfig.TrustedNodes = n.config.TrusterNodes()
+ n.serverConfig.TrustedNodes = n.config.TrustedNodes()
}
if n.serverConfig.NodeDatabase == "" {
n.serverConfig.NodeDatabase = n.config.NodeDB()
diff --git a/node/utils_test.go b/node/utils_test.go
index 7cdfc2b3a..8eddce3ed 100644
--- a/node/utils_test.go
+++ b/node/utils_test.go
@@ -41,12 +41,10 @@ func NewNoopService(*ServiceContext) (Service, error) { return new(NoopService),
type NoopServiceA struct{ NoopService }
type NoopServiceB struct{ NoopService }
type NoopServiceC struct{ NoopService }
-type NoopServiceD struct{ NoopService }
func NewNoopServiceA(*ServiceContext) (Service, error) { return new(NoopServiceA), nil }
func NewNoopServiceB(*ServiceContext) (Service, error) { return new(NoopServiceB), nil }
func NewNoopServiceC(*ServiceContext) (Service, error) { return new(NoopServiceC), nil }
-func NewNoopServiceD(*ServiceContext) (Service, error) { return new(NoopServiceD), nil }
// InstrumentedService is an implementation of Service for which all interface
// methods can be instrumented both return value as well as event hook wise.