mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 01:43:47 +00:00
node: add an interface to retrieve node key from config
This commit is contained in:
parent
e03ac4b7ae
commit
fddd6635b5
1 changed files with 6 additions and 0 deletions
|
|
@ -17,6 +17,7 @@
|
|||
package node
|
||||
|
||||
import (
|
||||
"crypto/ecdsa"
|
||||
"reflect"
|
||||
|
||||
"github.com/ethereum/go-ethereum/accounts"
|
||||
|
|
@ -67,6 +68,11 @@ func (ctx *ServiceContext) Service(service interface{}) error {
|
|||
return ErrServiceUnknown
|
||||
}
|
||||
|
||||
// NodeKey returns node key from config
|
||||
func (ctx *ServiceContext) NodeKey() *ecdsa.PrivateKey {
|
||||
return ctx.config.NodeKey()
|
||||
}
|
||||
|
||||
// ServiceConstructor is the function signature of the constructors needed to be
|
||||
// registered for service instantiation.
|
||||
type ServiceConstructor func(ctx *ServiceContext) (Service, error)
|
||||
|
|
|
|||
Loading…
Reference in a new issue